feat(onesignal): add new methods

closes #1677
This commit is contained in:
Ibby Hadeed 2017-07-10 09:14:56 -04:00
parent ff793d649b
commit b35dab2634
No known key found for this signature in database
GPG Key ID: 22EFE47A3DDBDB5C

View File

@ -466,6 +466,15 @@ export class OneSignal extends IonicNativePlugin {
@Cordova({ sync: true })
endInit(): any { return; }
/**
* Prompt the user for notification permissions. Callback fires as soon as the user accepts or declines notifications.
* @returns {Promise<boolean>}
*/
@Cordova({
platforms: ['iOS']
})
promptForPushNotificationsWithUserResponse(): Promise<boolean> { return; }
/**
* Retrieve a list of tags that have been set on the user from the OneSignal server.
*
@ -591,6 +600,13 @@ export class OneSignal extends IonicNativePlugin {
@Cordova()
postNotification(notificationObj: OSNotification): Promise<any> { return; }
/**
* Cancels a single OneSignal notification based on its Android notification integer id. Use instead of NotificationManager.cancel(id); otherwise the notification will be restored when your app is restarted.
* @param notificationId {string}
*/
@Cordova({ sync: true })
cancelNotification(notificationId: string): void {}
/**
* Prompts the user for location permission to allow geotagging based on the "Location radius" filter on the OneSignal dashboard.
*/
@ -618,4 +634,31 @@ export class OneSignal extends IonicNativePlugin {
visualLevel: number
}): void { }
/**
* The passed in function will be fired when a notification permission setting changes.
* This includes the following events:
* - Notification permission prompt shown
* - The user accepting or declining the permission prompt
* - Enabling/disabling notifications for your app in the device Settings after returning to your app.
* @return {Observable<any>}
*/
@Cordova({
observable: true
})
addPermissionObserver(): Observable<any> { return; }
/**
* The passed in function will be fired when a notification subscription property changes.
* This includes the following events:
* - Getting a push token from Apple / Google.
* - Getting a player / user id from OneSignal
* - OneSignal.setSubscription is called
* - User disables or enables notifications
* @return {Observable<any>}
*/
@Cordova({
observable: true
})
addSubscriptionObserver(): Observable<any> { return; }
}