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 19 additions and 10 deletions
@@ -61,16 +61,7 @@ export interface MediaFileData {
}
export interface CaptureError {
/**
* One of the `CaptureError` codes:
* - `0` - CAPTURE_INTERNAL_ERR: Camera or microphone failed to capture image or sound.
* - `1` - CAPTURE_APPLICATION_BUSY: Camera application or audio capture application is currently serving other capture request.
* - `2` - CAPTURE_INVALID_ARGUMENT: Invalid use of the API (e.g. limit parameter has value less than one).
* - `3` - CAPTURE_NO_MEDIA_FILES: User exited camera application or audio capture application before capturing anything.
* - `4` - CAPTURE_PERMISSION_DENIED: User denied permissions required to perform the capture request.
* - `20` - CAPTURE_NOT_SUPPORTED: The requested capture operation is not supported.
*/
code: number;
code: string;
}
export interface CaptureAudioOptions {
@@ -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;
}
}