@onesignal/onesignal-vue3
Advanced tools
Comparing version 2.0.0-beta.2 to 2.0.0-beta.3
@@ -124,2 +124,8 @@ import { App } from 'vue'; | ||
removeSms(smsNumber: string): void; | ||
addTag(key: string, value: string): void; | ||
addTags(tags: { | ||
[key: string]: string; | ||
}): void; | ||
removeTag(key: string): void; | ||
removeTags(keys: string[]): void; | ||
} | ||
@@ -126,0 +132,0 @@ interface IOneSignalPushSubscription { |
@@ -9,4 +9,6 @@ const ONESIGNAL_SDK_ID = 'onesignal-sdk'; | ||
let isOneSignalScriptFailed = false; | ||
window.OneSignalDeferred = window.OneSignalDeferred || []; | ||
addSDKScript(); | ||
if (window) { | ||
window.OneSignalDeferred = window.OneSignalDeferred || []; | ||
addSDKScript(); | ||
} | ||
/* H E L P E R S */ | ||
@@ -425,2 +427,26 @@ function handleOnError() { | ||
} | ||
function userAddTag(key, value) { | ||
var _a; | ||
(_a = window.OneSignalDeferred) === null || _a === void 0 ? void 0 : _a.push((OneSignal) => { | ||
OneSignal.User.addTag(key, value); | ||
}); | ||
} | ||
function userAddTags(tags) { | ||
var _a; | ||
(_a = window.OneSignalDeferred) === null || _a === void 0 ? void 0 : _a.push((OneSignal) => { | ||
OneSignal.User.addTags(tags); | ||
}); | ||
} | ||
function userRemoveTag(key) { | ||
var _a; | ||
(_a = window.OneSignalDeferred) === null || _a === void 0 ? void 0 : _a.push((OneSignal) => { | ||
OneSignal.User.removeTag(key); | ||
}); | ||
} | ||
function userRemoveTags(keys) { | ||
var _a; | ||
(_a = window.OneSignalDeferred) === null || _a === void 0 ? void 0 : _a.push((OneSignal) => { | ||
OneSignal.User.removeTags(keys); | ||
}); | ||
} | ||
function pushSubscriptionOptIn() { | ||
@@ -498,2 +524,6 @@ return new Promise(function (resolve, reject) { | ||
removeSms: userRemoveSms, | ||
addTag: userAddTag, | ||
addTags: userAddTags, | ||
removeTag: userRemoveTag, | ||
removeTags: userRemoveTags, | ||
PushSubscription: PushSubscriptionNamespace, | ||
@@ -500,0 +530,0 @@ }; |
39
index.ts
@@ -13,6 +13,7 @@ import { App } from 'vue'; | ||
window.OneSignalDeferred = window.OneSignalDeferred || []; | ||
if (window) { | ||
window.OneSignalDeferred = window.OneSignalDeferred || []; | ||
addSDKScript(); | ||
} | ||
addSDKScript(); | ||
/* H E L P E R S */ | ||
@@ -204,2 +205,6 @@ | ||
removeSms(smsNumber: string): void; | ||
addTag(key: string, value: string): void; | ||
addTags(tags: { [key: string]: string }): void; | ||
removeTag(key: string): void; | ||
removeTags(keys: string[]): void; | ||
} | ||
@@ -566,2 +571,26 @@ interface IOneSignalPushSubscription { | ||
function userAddTag(key: string, value: string): void { | ||
window.OneSignalDeferred?.push((OneSignal) => { | ||
OneSignal.User.addTag(key, value) | ||
}); | ||
} | ||
function userAddTags(tags: { [key: string]: string }): void { | ||
window.OneSignalDeferred?.push((OneSignal) => { | ||
OneSignal.User.addTags(tags) | ||
}); | ||
} | ||
function userRemoveTag(key: string): void { | ||
window.OneSignalDeferred?.push((OneSignal) => { | ||
OneSignal.User.removeTag(key) | ||
}); | ||
} | ||
function userRemoveTags(keys: string[]): void { | ||
window.OneSignalDeferred?.push((OneSignal) => { | ||
OneSignal.User.removeTags(keys) | ||
}); | ||
} | ||
function pushSubscriptionOptIn(): Promise<void> { | ||
@@ -639,2 +668,6 @@ return new Promise(function (resolve, reject) { | ||
removeSms: userRemoveSms, | ||
addTag: userAddTag, | ||
addTags: userAddTags, | ||
removeTag: userRemoveTag, | ||
removeTags: userRemoveTags, | ||
PushSubscription: PushSubscriptionNamespace, | ||
@@ -641,0 +674,0 @@ }; |
{ | ||
"name": "@onesignal/onesignal-vue3", | ||
"version": "2.0.0-beta.2", | ||
"version": "2.0.0-beta.3", | ||
"description": "Vue 3 OneSignal Plugin: Make it easy to integrate OneSignal with your Vue App!", | ||
@@ -5,0 +5,0 @@ "author": "rgomezp", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98602
1421