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:
Olivier Favre
2025-08-08 12:28:55 +02:00
committed by GitHub
parent cc1bb196af
commit 7edcb008ef

View File

@@ -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.