mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-17 00:51:07 +08:00
feat(one-signal): add getPermissionSubscriptionState (#1678)
* Create index.ts * Create index.ts
This commit is contained in:
parent
ed6fe880b6
commit
e9283a994d
@ -219,6 +219,41 @@ export interface OSActionButton {
|
|||||||
*/
|
*/
|
||||||
icon: string;
|
icon: string;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* OSPermissionState
|
||||||
|
*/
|
||||||
|
export interface OSPermissionState {
|
||||||
|
/**
|
||||||
|
* User was prompted.
|
||||||
|
*/
|
||||||
|
hasPrompted: boolean;
|
||||||
|
/**
|
||||||
|
* Permissions Status
|
||||||
|
*/
|
||||||
|
status: any;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* OSSubscriptionState
|
||||||
|
*/
|
||||||
|
export interface OSSubscriptionState {
|
||||||
|
subscribed: boolean;
|
||||||
|
userSubscriptionSetting: any;
|
||||||
|
userId: any;
|
||||||
|
pushToken: any;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Subscription and permissions status
|
||||||
|
*/
|
||||||
|
export interface OSPermissionSubscriptionState {
|
||||||
|
/**
|
||||||
|
* Id assigned to the button.
|
||||||
|
*/
|
||||||
|
permissionStatus: OSPermissionState;
|
||||||
|
/**
|
||||||
|
* Text show on the button to the user.
|
||||||
|
*/
|
||||||
|
subscriptionStatus: OSSubscriptionState;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* **ANDROID** - If a background image was set, this object will be available.
|
* **ANDROID** - If a background image was set, this object will be available.
|
||||||
@ -537,6 +572,18 @@ export class OneSignal extends IonicNativePlugin {
|
|||||||
@Cordova({ sync: true })
|
@Cordova({ sync: true })
|
||||||
setSubscription(enable: boolean): void { }
|
setSubscription(enable: boolean): void { }
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current notification and permission state. Returns a OSPermissionSubscriptionState type described below.
|
||||||
|
* You can pass true later to opt users back into notifications.
|
||||||
|
*
|
||||||
|
* @param {boolean} enable
|
||||||
|
*/
|
||||||
|
@Cordova({ sync: true })
|
||||||
|
getPermissionSubscriptionState(): OSPermissionSubscriptionState { }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
|
* @param {notificationObj} Parameters see POST [documentation](https://documentation.onesignal.com/v2.0/docs/notifications-create-notification)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user