From 7edcb008ef0df469c7364a146603501c60e63cdb Mon Sep 17 00:00:00 2001 From: Olivier Favre Date: Fri, 8 Aug 2025 12:28:55 +0200 Subject: [PATCH] feat(wonderpush): new Delegate methods + Add initialize() and isInitialized() methods (#4942) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(wonderpush): new Delegate methods * feat(wonderpush): Add initialize() and isInitialized() methods --------- Co-authored-by: Stéphane JAIS --- .../plugins/wonderpush/index.ts | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/@awesome-cordova-plugins/plugins/wonderpush/index.ts b/src/@awesome-cordova-plugins/plugins/wonderpush/index.ts index a8c251c2d..ac78ca951 100644 --- a/src/@awesome-cordova-plugins/plugins/wonderpush/index.ts +++ b/src/@awesome-cordova-plugins/plugins/wonderpush/index.ts @@ -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} + */ + @Cordova() + initialize(clientId: string, clientSecret: string): Promise { + return; + } + + /** + * Whether the SDK has been initialized. + * + * The SDK is ready when it is initialized with its Client ID and Client Secret. + * @returns {Promise} + */ + @Cordova() + isInitialized(): Promise { + return; + } + /** * Sets the user id, used to identify a single identity across multiple devices, * and to correctly identify multiple users on a single device.