Skip to content

Commit

Permalink
feat(onesignal): add missing functions
Browse files Browse the repository at this point in the history
closes: #2504
  • Loading branch information
danielsogl committed Sep 18, 2018
1 parent 8bab321 commit 51006a7
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions src/@ionic-native/plugins/onesignal/index.ts
Expand Up @@ -706,9 +706,66 @@ export class OneSignal extends IonicNativePlugin {
return;
}

/**
* Allows you to set the user's email address with the OneSignal SDK.
* @param {string} email Email address
* @param {string} [emailAuthToken] Email auth token
*/
@Cordova()
setEmail(email: string, emailAuthToken?: string): Promise<any> {
return;
}

/**
* If your app implements logout functionality, you can call logoutEmail to dissociate the email from the device
*/
@Cordova()
logoutEmail(): Promise<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
})
addEmailSubscriptionObserver(): Observable<any> {
return;
}

/**
* Clears all OneSignal notifications
*/
@Cordova({ sync: true })
clearOneSignalNotifications(): void {}

/**
* Allows you to delay the initialization of the SDK until the user provides privacy consent.
* The SDK will not be fully initialized until the provideUserConsent(true) method is called.
* @param {boolean} required
*/
@Cordova()
setRequiresUserPrivacyConsent(required: boolean): void {}

/**
* If your application is set to require the user's privacy consent, you can provide this consent using this method.
* Until you call provideUserConsent(true), the SDK will not fully initialize and will not send any data to OneSignal.
* @param {boolean} granted
*/
@Cordova()
provideUserConsent(granted: boolean): void {}

/**
* Accepts a callback, which returns a boolean variable indicating if the user has given privacy consent yet.
* @param {Function} callback
*/
@Cordova()
userProvidedPrivacyConsent(callback: Function): void {}
}

0 comments on commit 51006a7

Please sign in to comment.