Skip to content

Commit 7edcb00

Browse files
ofavreStéphane JAIS
andauthored
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 <[email protected]>
1 parent cc1bb19 commit 7edcb00

File tree

1 file changed

+28
-1
lines changed
  • src/@awesome-cordova-plugins/plugins/wonderpush

1 file changed

+28
-1
lines changed

src/@awesome-cordova-plugins/plugins/wonderpush/index.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { Injectable } from '@angular/core';
22
import { Plugin, Cordova, AwesomeCordovaNativePlugin, getPromise } from '@awesome-cordova-plugins/core';
33

44
export interface WonderPushDelegate {
5-
urlForDeepLink(url: string, callback: (url?: string) => void): void;
5+
urlForDeepLink?: (url: string, callback: (url?: string) => void) => void;
6+
onNotificationOpened?: (notification: object, buttonIndex: number) => void;
7+
onNotificationReceived?: (notification: object) => void;
68
}
79

810
export interface WonderPushChannel {
@@ -226,6 +228,31 @@ export class UserPreferencesMethods extends NestedObject {
226228
})
227229
@Injectable()
228230
export class WonderPush extends AwesomeCordovaNativePlugin {
231+
232+
/**
233+
* Initializes the WonderPush SDK
234+
* @param clientId
235+
* @param clientSecret
236+
* @param onSuccess
237+
* @param onFailure
238+
* @returns {Promise<any>}
239+
*/
240+
@Cordova()
241+
initialize(clientId: string, clientSecret: string): Promise<any> {
242+
return;
243+
}
244+
245+
/**
246+
* Whether the SDK has been initialized.
247+
*
248+
* The SDK is ready when it is initialized with its Client ID and Client Secret.
249+
* @returns {Promise<boolean>}
250+
*/
251+
@Cordova()
252+
isInitialized(): Promise<boolean> {
253+
return;
254+
}
255+
229256
/**
230257
* Sets the user id, used to identify a single identity across multiple devices,
231258
* and to correctly identify multiple users on a single device.

0 commit comments

Comments
 (0)