Methods
-
accessIssue( )
-
Performs an action on an issue. If the user has no access it will trigger a buy
If the user has access it will trigger a download, if the user has downloaded
the issue it will open the issue. Response callback has the following parameters:
state: purchase/download/view/purchaseComplete/purchaseFailed,
size: number,
progress: number,- Source:
- core.js, line 265
-
externalURL( url )
-
Requests the app display a URL
Parameters:
Name Type Description url
String The url to display
- Source:
- core.js, line 235
-
getIssues( limit, callback )
-
Requests a list of the available issues within the app.
Each issue will be returned with the following metadata:
{
title: string,
publishedDate: YYYY-MM-dd-'T'-HH:mm:ss'Z',
description: string,
issueIdentifier: string,
state: purchase/download/view,
price: string (optional)
}Parameters:
Name Type Description limit
Number How many items should be returned? 0 will return all issues
callback
Function The function to call when the issues are available. Should take a result parameter
which will contain the array of issues. This callback will be retained by the app and called as required if
the issue metadata changes.- Source:
- core.js, line 254
-
getSubscriptions( callback )
-
Requests a list of subscription info describing existing Apple subscriptions in the app.
'Price' info may not be available when called as this data may not have been returned by the
App Store yet. Each subscription will be returned with the following metadata:
{
title: string,
identifier: string,
price: string (optional)
subscribed: bool
}Parameters:
Name Type Description callback
Function The function to call when the subscriptions are available. Should take a result parameter
which will contain the array of subscriptions.- Source:
- core.js, line 310
-
loggedInUser( callback )
-
Returns the user details for the currently logged in third party user
On successful login the results object will contain:
{
userName: string
}Parameters:
Name Type Description callback
Function The callback function to call to get the results dictionary. Should take a result parameter.
- Source:
- core.js, line 294
-
login( callback )
-
Invoke a login action in the app.
On successful login the results dictionary will contain:
{
userName: string
}Parameters:
Name Type Description callback
Function The function to call when the login succeeds or fails. Should take a result parameter.
- Source:
- core.js, line 276
-
logout( )
-
Invoke a logout action in the app.
Method will return immediately and contains no callback.- Source:
- core.js, line 283
-
offline( callback )
-
Is the device currently offline?
Parameters:
Name Type Description callback
Function The function to call when the value is available. Should take a result parameter
- Source:
- core.js, line 228
-
subscribe( callback )
-
Attempts to subscribe to an Apple subscription identified by subscriptionId.
Will be called back with a status of success, cancelled or failed with the following metadata:
{
identifier: string,
status: number,
expiry: string of the form YYYY-MM-dd-'T'-HH:mm:ss'Z' (optional)
}
status codes are defined as follows:
SubscriptionStatus: {
SUCCESS: 100,
CANCELLED: 101,
FAILED: 102
}Parameters:
Name Type Description callback
Function The function to call when the subscriptions are available. Should take parameters
for identifier, status and expiry.- Source:
- core.js, line 330