From aa9504166516e36d604cd961ffe72fc2efa36315 Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Wed, 8 Jun 2022 13:38:02 -0500 Subject: [PATCH] 1.0.1 Release Commit --- .npmignore | 3 ++- example/src/App.vue | 12 ++++++++++++ index.ts | 12 ++++++------ package.json | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/.npmignore b/.npmignore index ca45589..fc4b13b 100644 --- a/.npmignore +++ b/.npmignore @@ -8,7 +8,6 @@ build .rpt2_cache # misc -example .DS_Store .env .env.local @@ -20,3 +19,5 @@ example npm-debug.log* yarn-debug.log* yarn-error.log* + +example diff --git a/example/src/App.vue b/example/src/App.vue index 51f4084..55f2334 100644 --- a/example/src/App.vue +++ b/example/src/App.vue @@ -15,6 +15,18 @@ export default { }, mounted() { this.$OneSignal.showSlidedownPrompt(); + this.$OneSignal.on("permissionPromptDisplay", (e) => { + console.warn("permissionPromptDisplay", e) + }) + this.$OneSignal.on("subscriptionChange", e => { + console.warn("subscriptionChange", e); + }) + this.$OneSignal.on("notificationDisplay", e => { + console.warn("notificationDisplay", e); + }) + this.$OneSignal.on("notificationDismiss", e => { + console.warn("notificationDismiss", e); + }) } } diff --git a/index.ts b/index.ts index 1a1523d..f32c906 100644 --- a/index.ts +++ b/index.ts @@ -98,9 +98,9 @@ interface IInitObject { interface IOneSignal { init(options: IInitObject): Promise - on(event: string, listener: () => void): void - off(event: string, listener: () => void): void - once(event: string, listener: () => void): void + on(event: string, listener: (eventData?: any) => void): void + off(event: string, listener: (eventData?: any) => void): void + once(event: string, listener: (eventData?: any) => void): void isPushNotificationsEnabled(callback?: Action): Promise showHttpPrompt(options?: AutoPromptOptions): Promise registerForPushNotifications(options?: RegisterOptions): Promise @@ -165,7 +165,7 @@ function init(options: IInitObject) { }); } - function on(event: string, listener: () => void): void { + function on(event: string, listener: (eventData?: any) => void): void { if (!doesOneSignalExist()) { vueOneSignalFunctionQueue.push({ name: 'on', @@ -179,7 +179,7 @@ function init(options: IInitObject) { }); } - function off(event: string, listener: () => void): void { + function off(event: string, listener: (eventData?: any) => void): void { if (!doesOneSignalExist()) { vueOneSignalFunctionQueue.push({ name: 'off', @@ -193,7 +193,7 @@ function init(options: IInitObject) { }); } - function once(event: string, listener: () => void): void { + function once(event: string, listener: (eventData?: any) => void): void { if (!doesOneSignalExist()) { vueOneSignalFunctionQueue.push({ name: 'once', diff --git a/package.json b/package.json index 4d2923e..653a105 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onesignal/onesignal-vue3", - "version": "1.0.0", + "version": "1.0.1", "description": "Vue 3 OneSignal Plugin: Make it easy to integrate OneSignal with your Vue App!", "author": "rgomezp", "contributors": [