From f60c82b50a2b9fc4cd2c957f15dcef50ae761565 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Mon, 27 Jul 2026 22:17:44 +0200 Subject: [PATCH] feat(wonderpush): add credential-remembering init and subscribeToNotifications fallback param --- .../plugins/wonderpush/index.ts | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/src/@awesome-cordova-plugins/plugins/wonderpush/index.ts b/src/@awesome-cordova-plugins/plugins/wonderpush/index.ts index ac78ca951..7eea7fe57 100644 --- a/src/@awesome-cordova-plugins/plugins/wonderpush/index.ts +++ b/src/@awesome-cordova-plugins/plugins/wonderpush/index.ts @@ -228,7 +228,6 @@ export class UserPreferencesMethods extends NestedObject { }) @Injectable() export class WonderPush extends AwesomeCordovaNativePlugin { - /** * Initializes the WonderPush SDK * @param clientId @@ -242,6 +241,33 @@ export class WonderPush extends AwesomeCordovaNativePlugin { return; } + /** + * Initializes the SDK and remembers credentials for subsequent auto-initialization. + * + * You can disable AUTO_INIT or instead use `"USE_REMEMBERED"` as a value for the Client ID and Client Secret. + * This is aimed at enabling complex integration scenarios where the Client ID and Client Secret are resolved dynamically and reused ever after. + * If you provide a null value, the credential will be forgotten and the SDK won't be initialized. + * + * @param {?string} clientId + * @param {?string} clientSecret + * @returns {Promise} + */ + @Cordova() + initializeAndRememberCredentials(clientId: string | null, clientSecret: string | null): Promise { + return; + } + + /** + * Returns the remembered Client ID given to `initializeAndRememberCredentials()`. + * There is no similar getter for the Client Secret. + * + * @returns {Promise} The remembered Client ID if both a non-empty Client ID and Client Secret were last remembered, `null` otherwise. + */ + @Cordova() + getRememberedClientId(): Promise { + return; + } + /** * Whether the SDK has been initialized. * @@ -553,10 +579,11 @@ export class WonderPush extends AwesomeCordovaNativePlugin { * Because in iOS you only have *one* chance for prompting the user, you should find a good timing for that. * For a start, you can systematically call it when the application starts, so that the user will be prompted directly at the first launch. * + * @param {boolean} [fallbackToSettings] - When true, WonderPush will show a dialog prompting the user to go to settings and activate push notifications * @returns {Promise} Returns a promise that resolves upon successful subscription */ @Cordova() - subscribeToNotifications(): Promise { + subscribeToNotifications(fallbackToSettings?: boolean): Promise { return; }