Skip to content

Commit

Permalink
feat(one-signal): add getPermissionSubscriptionState (#1678)
Browse files Browse the repository at this point in the history
* Create index.ts

* Create index.ts
  • Loading branch information
neoassyrian authored and ihadeed committed Jun 11, 2017
1 parent ed6fe88 commit e9283a9
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions src/@ionic-native/plugins/onesignal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,41 @@ export interface OSActionButton {
*/
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.
Expand Down Expand Up @@ -537,6 +572,18 @@ export class OneSignal extends IonicNativePlugin {
@Cordova({ sync: true })
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)
Expand Down

0 comments on commit e9283a9

Please sign in to comment.