MobbinAPI is an third-party unofficial open-source intuitive SWIFT API for Mobbin.
- 100% build in SWIFT
- 100% build with ASYNC
- Fetch Apps, Screens, Flows and Collections
- Support Free Mobbin Account
- Persistent "Login" Status
let mobbinAPI = MobbinAPI(email: "[email protected]")
let mobbinAPI = MobbinAPI(email: "[email protected]")
let mobbinAPI = MobbinAPI(email: "[email protected]", token: Token(...))
let mobbinAPI = MobbinAPI(userInfo: UserInfo(...))
let mobbinAPI = MobbinAPI(userInfo: UserInfo(...), token: Token(...))
struct UserInfo {
...
}
id
: User's' IDaud
: User's' AUDrole
: Role of the Useremail
: Email of the User (Login / Signup Email)emailConfirmedAt
: The time when the email is confirmedrecoverySentAt
: The time when the the recovery sentlastSignInAt
: Last Signin timeavatarUrl
: The URL of the User's avatarfullName
: User's full name
If you created the MobbinAPI
either by email or by UserInfo
but did not set the token, the following steps are mandatory to be executed.
try await mobbinAPI.sendEmail()
Check the email inbox and copy the verification code that Mobbin sent.
try await mobbinAPI.verify(code: ...)
After a successful login, MobbinAPI can obtain a token, which will be used in all future steps. If you create a MobbinAPI
object using UserInfo
and do not want to log in again, you need to save the previous token and pass it as the initial value for the MobbinAPI
object.
struct Token {
...
}
accessToken
: Used for AuthenticationrefreshToken
: Used for refreshingaccessToken
generatedTime
: When theaccessToken
was generated
Mobbin has a strict policy regarding tokens, wherein each token only lasts for one day. Therefore, it is necessary to refresh the token daily.
try await mobbinAPI.refreshToken()
MobbinAPI currently only supports one workspace account.
name
: Workspace Name (usually email prefix)id
: Workspace IDtype
: Type of Workspace (usuallypersonaly
)
let workspace = try await mobbinAPI.fetchWorkspace()
MobbinAPI can fetch all iOS apps that Mobbin has.
This variable displays the number of apps that Mobbin has, but it appears to be incorrect. Perhaps the developers of Mobbin should rectify it, as it shows a higher number than the actual count.
let iOSAppsCount = try await mobbinAPI.iOSAppsCount
struct App {
....
}
id
: The ID of this AppappName
: The name of this AppappCategory
: The category of this AppappStyle
: The style of this App (seems a future feature)appLogoUrl
: The url of the App's logoappTagline
: The tag line of the AppcompanyHqRegion
: The HQ region of the App (Honestly, I don't know what it is...)companyStage
: The current stage of the company behind this appplatform
: The platform where the app runs oncreatedAt
: When this app row was createdappVersionId
: The ID of the versionappVersionCreatedAt
: When the version was createdappVersionUpdatedAt
: When the version was updatedappVersionPublishedAt
: When the version was publishedpreviewScreenUrls
: Three preview images' urls
try await mobbinAPI.getAlliOSApps()
This method will return 24 apps, which represents a page. To query the next page, use the last app you queried previously. Use nil
to query the first page.
try await mobbinAPI.queryNextPage(nil) // Query first page
try await mobbinAPI.queryNextPage(App(...))
After you successfully queried apps, you can query the detailed information for certian app.
Mobbin can provide all the screens snapshots of the app.
struct Screen {
....
}
screenNumber
: The number of the screenscreenUrl
: The URL of the image of this screenappVersionId
: The ID of the App's Versionid
: The ID of the screenscreenElements
: A array that contains all the elements in the screenscreenPatterns
: A array that contains all the patterns in the screenupdatedAt
: When the screen was updatedcreatedAt
: When the screen was created
try await api.getiOSScreens(of: App(...))
Mobbin can provide the entire flows of the app, which consists of a series of screens.
struct Flow {
...
}
id
: The ID of the flowname
: The name of the flowactions
: A array that contains all the actions in the flowparentAppSectionId
: The ID of the parent flow (flow is a tree sturture)order
: The order of the flowupdatedAt
: When the screen was updatedappVersionId
: The app verion ID of the app, which contains this flowscreens
: All the screens contained in the flow
struct Flow {
...
struct Screen {
....
}
}
appScreenId
: The ID of the Screenorder
: The order of the flowhotspotWidth
: The width of the hotspot (if there is one)hotspotHeight
: The height of the hotspot (if there is one)hotspotX
: The x coordinate of the hotspot (if there is one)hotspotY
: The y coordinate of the hotspot (if there is one)hotspotType
: The type of the hotspot (if there is one)screenUrl
: The url of the screen's image
try await api.getiOSFlows(of: App(...))
MobbinAPI is capable of generating a tree structure based on the flow array. Tree
is an Enum with a single case .children
.
let tree = api.generateTreeSturctureFlow(from: flows)
Will support in the future.
Will support in the future.
Will support in the future.
Will support in the future.
MobbinAPI supports full control over an account's collections.
Platform count refers to the number of screens or flows in a particular collection's platform.
let platfrom = try await api.platformCount(of: Collection(...))
let collections = try await api.queryCollections()
try await api.delete(collection: Collection(...))
let workspace = try await api.fetchWorkspace()
try await api.createCollection(in: workspace, name: "...", description: "...")
let newCollection = try await api.edit(collection: collection, name: "...", description: "...")
The following method can fetch apps in collections. The result is a Collection.App
structure, which is almost the same as the normal App
structure.
let apps = try await api.queryApps(in: Collection(...))
The following method can fetch screens in collections. The result is a Collection.Screen
structure, which is almost the same as the normal Screen
structure.
let apps = try await api.queryScreens(in: Collection(...))
The following method can fetch flows in collections. The result is a Collection.Flow
structure, which is almost the same as the normal Flow
structure.
let apps = try await api.queryFlows(in: Collection(...))
Mobbins's API is very special in that some features require the use of Mobbin's own API service instead of a third-party service. The MobbinAPI
provides control over these levels.
Almost all of Mobbin's API endpoints use the GET method, and Mobbin requires a query token to authenticate requests. The duration of the token's validity is uncertain, so the best practice is to obtain a new token each time.
let token = try await mobbinAPI.getMobbinQueryToken()
This method will generate a Mobbin query token, which can used in the future actions.
Mobbin collects the download URL for every app, but it is not visible through the third-party API service. Therefore, we need to use Mobbin's own API.
let downloadURL = try await mobbinAPI.downloadURL(of: App(...), mobbinToken: "...")
let downloadURL = try await mobbinAPI.downloadURL(of: App(...),)
Mobbin provides a special feature for paid users, which allows them to view previous versions of an app. This feature can be easily accessed using the MobbinAPI
.
let versions: [Version] = try await mobbinAPI.versions(of: App(...), mobbinToken: "...")
let versions: [Version] = try await mobbinAPI.versions(of: App(...),)
id
: The id of the version (same asApp
'sappVersionId
)createAt
: The create date of the version (same asApp
'sappVersionCreatedAt
)updateAt
: The update date of the version (same asApp
'sappVersionUpdatedAt
)
The default fetch methods assume fetching the latest version, but you can control which version you want to fetch by passing the specific Version
.
let flows = try await api.getiOSFlows(by: Version(...))
let screens = try await api.getiOSScreens(by: Version(...))