Compare commits

..
Author SHA1 Message Date
Daniel Sogl c8a746bce8 feat(sms): add requestPermission method and android slot option 2026-07-27 22:17:59 +02:00
2 changed files with 20 additions and 29 deletions
@@ -18,6 +18,12 @@ export interface SmsOptionsAndroid {
* Set to "INTENT" to send SMS with the native android SMS messaging. Leaving it empty will send the SMS without opening any app.
*/
intent?: string;
/**
* Selects which SIM to use on dual-SIM devices when sending with no intent. Use "0" for the primary SIM slot and "1" for the secondary SIM slot.
* If no slot is specified the default SIM slot will be used.
*/
slot?: string;
}
/**
@@ -78,4 +84,16 @@ export class SMS extends AwesomeCordovaNativePlugin {
hasPermission(): Promise<boolean> {
return;
}
/**
* Requests permission to send SMS (Android Marshmallow and later)
*
* @returns {Promise<boolean>} returns a promise that resolves with a boolean that indicates if permission was granted
*/
@Cordova({
platforms: ['Android'],
})
requestPermission(): Promise<boolean> {
return;
}
}
@@ -228,6 +228,7 @@ export class UserPreferencesMethods extends NestedObject {
})
@Injectable()
export class WonderPush extends AwesomeCordovaNativePlugin {
/**
* Initializes the WonderPush SDK
* @param clientId
@@ -241,33 +242,6 @@ 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<any>}
*/
@Cordova()
initializeAndRememberCredentials(clientId: string | null, clientSecret: string | null): Promise<any> {
return;
}
/**
* Returns the remembered Client ID given to `initializeAndRememberCredentials()`.
* There is no similar getter for the Client Secret.
*
* @returns {Promise<string | null>} The remembered Client ID if both a non-empty Client ID and Client Secret were last remembered, `null` otherwise.
*/
@Cordova()
getRememberedClientId(): Promise<string | null> {
return;
}
/**
* Whether the SDK has been initialized.
*
@@ -579,11 +553,10 @@ 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<any>} Returns a promise that resolves upon successful subscription
*/
@Cordova()
subscribeToNotifications(fallbackToSettings?: boolean): Promise<any> {
subscribeToNotifications(): Promise<any> {
return;
}