Skip to content

Commit

Permalink
Merge pull request #9 from OneSignal/1.0.1-release
Browse files Browse the repository at this point in the history
1.0.1 Release Commit
  • Loading branch information
rgomezp authored Jun 8, 2022
2 parents cc1265f + aa95041 commit b00bdf0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ build
.rpt2_cache

# misc
example
.DS_Store
.env
.env.local
Expand All @@ -20,3 +19,5 @@ example
npm-debug.log*
yarn-debug.log*
yarn-error.log*

example
12 changes: 12 additions & 0 deletions example/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
})
}
}
</script>
Expand Down
12 changes: 6 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ interface IInitObject {

interface IOneSignal {
init(options: IInitObject): Promise<void>
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<boolean>): Promise<boolean>
showHttpPrompt(options?: AutoPromptOptions): Promise<void>
registerForPushNotifications(options?: RegisterOptions): Promise<void>
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
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": "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": [
Expand Down

0 comments on commit b00bdf0

Please sign in to comment.