Skip to content

Commit

Permalink
Merge pull request #21 from OneSignal/cd_update
Browse files Browse the repository at this point in the history
Generator Update
  • Loading branch information
rgomezp authored Mar 30, 2023
2 parents fb4c1f0 + 5852f24 commit 0ba8bb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ declare module '@vue/runtime-core' {
declare global {
interface Window {
OneSignalDeferred?: OneSignalDeferredLoadedCallback[];
OneSignal?: IOneSignalOneSignal;
safari?: {
pushNotification: any;
};
Expand Down Expand Up @@ -201,6 +202,9 @@ interface IOneSignalUser {
removeSms(smsNumber: string): void;
}
interface IOneSignalPushSubscription {
id: string | null | undefined;
token: string | null | undefined;
optedIn: boolean | undefined;
optIn(): Promise<void>;
optOut(): Promise<void>;
addEventListener(event: 'subscriptionChange', listener: (change: SubscriptionChangeEvent) => void): void;
Expand Down Expand Up @@ -611,6 +615,9 @@ function debugSetLogLevel(logLevel: string): void {
});
}
const PushSubscriptionNamespace: IOneSignalPushSubscription = {
get id(): string | null | undefined { return window.OneSignal?.User?.PushSubscription?.id },
get token(): string | null | undefined { return window.OneSignal?.User?.PushSubscription?.token },
get optedIn(): boolean | undefined { return window.OneSignal?.User?.PushSubscription?.optedIn },
optIn: pushSubscriptionOptIn,
optOut: pushSubscriptionOptOut,
addEventListener: pushSubscriptionAddEventListener,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@onesignal/onesignal-vue3",
"version": "2.0.0-beta.1",
"version": "2.0.0-beta.2",
"description": "Vue 3 OneSignal Plugin: Make it easy to integrate OneSignal with your Vue App!",
"author": "rgomezp",
"contributors": [
Expand Down

0 comments on commit 0ba8bb5

Please sign in to comment.