mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2026-02-04 00:06:19 +08:00
feat(wonderpush): new Delegate methods + Add initialize() and isInitialized() methods (#4942)
* feat(wonderpush): new Delegate methods * feat(wonderpush): Add initialize() and isInitialized() methods --------- Co-authored-by: Stéphane JAIS <stephane@wonderpush.com>
This commit is contained in:
@@ -2,7 +2,9 @@ import { Injectable } from '@angular/core';
|
||||
import { Plugin, Cordova, AwesomeCordovaNativePlugin, getPromise } from '@awesome-cordova-plugins/core';
|
||||
|
||||
export interface WonderPushDelegate {
|
||||
urlForDeepLink(url: string, callback: (url?: string) => void): void;
|
||||
urlForDeepLink?: (url: string, callback: (url?: string) => void) => void;
|
||||
onNotificationOpened?: (notification: object, buttonIndex: number) => void;
|
||||
onNotificationReceived?: (notification: object) => void;
|
||||
}
|
||||
|
||||
export interface WonderPushChannel {
|
||||
@@ -226,6 +228,31 @@ export class UserPreferencesMethods extends NestedObject {
|
||||
})
|
||||
@Injectable()
|
||||
export class WonderPush extends AwesomeCordovaNativePlugin {
|
||||
|
||||
/**
|
||||
* Initializes the WonderPush SDK
|
||||
* @param clientId
|
||||
* @param clientSecret
|
||||
* @param onSuccess
|
||||
* @param onFailure
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
@Cordova()
|
||||
initialize(clientId: string, clientSecret: string): Promise<any> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the SDK has been initialized.
|
||||
*
|
||||
* The SDK is ready when it is initialized with its Client ID and Client Secret.
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
@Cordova()
|
||||
isInitialized(): Promise<boolean> {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user id, used to identify a single identity across multiple devices,
|
||||
* and to correctly identify multiple users on a single device.
|
||||
|
||||
Reference in New Issue
Block a user