feat(one-signal): add clearOneSignalNotifications function

feat(one-signal): add clearOneSignalNotifications function
This commit is contained in:
Daniel Sogl 2018-03-16 16:41:01 +01:00 committed by GitHub
commit 91f66decab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -397,7 +397,6 @@ export enum OSActionType {
}) })
@Injectable() @Injectable()
export class OneSignal extends IonicNativePlugin { export class OneSignal extends IonicNativePlugin {
/** /**
* constants to use in inFocusDisplaying() * constants to use in inFocusDisplaying()
*/ */
@ -415,7 +414,9 @@ export class OneSignal extends IonicNativePlugin {
* @returns {any} * @returns {any}
*/ */
@Cordova({ sync: true }) @Cordova({ sync: true })
startInit(appId: string, googleProjectNumber?: string): any { return; } startInit(appId: string, googleProjectNumber?: string): any {
return;
}
/** /**
* Callback to run when a notification is received, whether it was displayed or not. * Callback to run when a notification is received, whether it was displayed or not.
@ -425,7 +426,9 @@ export class OneSignal extends IonicNativePlugin {
@Cordova({ @Cordova({
observable: true observable: true
}) })
handleNotificationReceived(): Observable<OSNotification> { return; } handleNotificationReceived(): Observable<OSNotification> {
return;
}
/** /**
* Callback to run when a notification is tapped on from the notification shade (**ANDROID**) or notification * Callback to run when a notification is tapped on from the notification shade (**ANDROID**) or notification
@ -437,7 +440,9 @@ export class OneSignal extends IonicNativePlugin {
@Cordova({ @Cordova({
observable: true observable: true
}) })
handleNotificationOpened(): Observable<OSNotificationOpenedResult> { return; } handleNotificationOpened(): Observable<OSNotificationOpenedResult> {
return;
}
/** /**
* **iOS** - Settings for iOS apps * **iOS** - Settings for iOS apps
@ -457,7 +462,9 @@ export class OneSignal extends IonicNativePlugin {
iOSSettings(settings: { iOSSettings(settings: {
kOSSettingsKeyAutoPrompt: boolean; kOSSettingsKeyAutoPrompt: boolean;
kOSSettingsKeyInAppLaunchURL: boolean; kOSSettingsKeyInAppLaunchURL: boolean;
}): any { return; } }): any {
return;
}
/** /**
* Must be called after `startInit` to complete initialization of OneSignal. * Must be called after `startInit` to complete initialization of OneSignal.
@ -465,7 +472,9 @@ export class OneSignal extends IonicNativePlugin {
* @returns {any} * @returns {any}
*/ */
@Cordova({ sync: true }) @Cordova({ sync: true })
endInit(): any { return; } endInit(): any {
return;
}
/** /**
* Prompt the user for notification permissions. Callback fires as soon as the user accepts or declines notifications. * Prompt the user for notification permissions. Callback fires as soon as the user accepts or declines notifications.
@ -474,7 +483,9 @@ export class OneSignal extends IonicNativePlugin {
@Cordova({ @Cordova({
platforms: ['iOS'] platforms: ['iOS']
}) })
promptForPushNotificationsWithUserResponse(): Promise<boolean> { return; } promptForPushNotificationsWithUserResponse(): Promise<boolean> {
return;
}
/** /**
* Retrieve a list of tags that have been set on the user from the OneSignal server. * Retrieve a list of tags that have been set on the user from the OneSignal server.
@ -484,7 +495,9 @@ export class OneSignal extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves when tags are recieved. * @returns {Promise<any>} Returns a Promise that resolves when tags are recieved.
*/ */
@Cordova() @Cordova()
getTags(): Promise<any> { return; } getTags(): Promise<any> {
return;
}
/** /**
* Lets you retrieve the OneSignal user id and device token. * Lets you retrieve the OneSignal user id and device token.
@ -497,8 +510,9 @@ export class OneSignal extends IonicNativePlugin {
* pushToken {string} A push token is a Google/Apple assigned identifier(unique per device per app). * pushToken {string} A push token is a Google/Apple assigned identifier(unique per device per app).
*/ */
@Cordova() @Cordova()
getIds(): Promise<{userId: string; pushToken: string}> { return; } getIds(): Promise<{ userId: string; pushToken: string }> {
return;
}
/** /**
* Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users. * Tag a user based on an app event of your choosing so later you can create segments on [onesignal.com](https://onesignal.com/) to target these users.
@ -574,7 +588,9 @@ export class OneSignal extends IonicNativePlugin {
* @returns {any} * @returns {any}
*/ */
@Cordova({ sync: true }) @Cordova({ sync: true })
inFocusDisplaying(displayOption: OSDisplayType): any { return; } inFocusDisplaying(displayOption: OSDisplayType): any {
return;
}
/** /**
* You can call this method with false to opt users out of receiving all notifications through OneSignal. * You can call this method with false to opt users out of receiving all notifications through OneSignal.
@ -591,7 +607,9 @@ export class OneSignal extends IonicNativePlugin {
* @returns {Promise<OSPermissionSubscriptionState>} * @returns {Promise<OSPermissionSubscriptionState>}
*/ */
@Cordova() @Cordova()
getPermissionSubscriptionState(): Promise<OSPermissionSubscriptionState> { return; } getPermissionSubscriptionState(): Promise<OSPermissionSubscriptionState> {
return;
}
/** /**
* *
@ -599,7 +617,9 @@ export class OneSignal extends IonicNativePlugin {
* @returns {Promise<any>} Returns a Promise that resolves if the notification was send successfully. * @returns {Promise<any>} Returns a Promise that resolves if the notification was send successfully.
*/ */
@Cordova() @Cordova()
postNotification(notificationObj: OSNotification): Promise<any> { return; } 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. * 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.
@ -630,10 +650,7 @@ export class OneSignal extends IonicNativePlugin {
* @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages) * @param {loglevel} contains two properties: logLevel (for console logging) and visualLevel (for dialog messages)
*/ */
@Cordova({ sync: true }) @Cordova({ sync: true })
setLogLevel(logLevel: { setLogLevel(logLevel: { logLevel: number; visualLevel: number }): void {}
logLevel: number,
visualLevel: number
}): void { }
/** /**
* The passed in function will be fired when a notification permission setting changes. * The passed in function will be fired when a notification permission setting changes.
@ -646,7 +663,9 @@ export class OneSignal extends IonicNativePlugin {
@Cordova({ @Cordova({
observable: true observable: true
}) })
addPermissionObserver(): Observable<any> { return; } addPermissionObserver(): Observable<any> {
return;
}
/** /**
* The passed in function will be fired when a notification subscription property changes. * The passed in function will be fired when a notification subscription property changes.
@ -660,6 +679,13 @@ export class OneSignal extends IonicNativePlugin {
@Cordova({ @Cordova({
observable: true observable: true
}) })
addSubscriptionObserver(): Observable<any> { return; } addSubscriptionObserver(): Observable<any> {
return;
}
/**
* Clears all OneSignla notifications
*/
@Cordova({ sync: true })
clearOneSignalNotifications(): void {}
} }