onesignal-vue 1.0.0-beta3 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +0 -3
- package/LICENSE +24 -0
- package/README.md +109 -41
- package/dist/index.d.ts +118 -120
- package/dist/index.es.js +36 -36
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +655 -9187
- package/dist/index.js.map +1 -1
- package/index.ts +178 -180
- package/package.json +16 -47
- package/tsconfig.json +2 -2
- package/.babelrc +0 -8
- package/index.d.ts +0 -53
package/.eslintrc.js
CHANGED
package/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Modified MIT License
|
|
2
|
+
|
|
3
|
+
Copyright 2022 OneSignal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
1. The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
2. All copies of substantial portions of the Software may only be used in connection
|
|
16
|
+
with services provided by OneSignal.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
24
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
<h1 align="center">welcome to onesignal-vue 👋</h1>
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/onesignal-vue) [](https://www.npmjs.com/package/onesignal-vue)
|
|
4
|
+
|
|
2
5
|
Vue OneSignal Plugin: Make it easy to integrate OneSignal with your Vue App!
|
|
3
6
|
|
|
4
7
|
This is a JavaScript module that can be used to easily include [OneSignal](https://onesignal.com/) code in a website or app that uses Vue for its front-end codebase.
|
|
@@ -7,12 +10,25 @@ OneSignal is the world's leader for Mobile Push Notifications, Web Push, and In-
|
|
|
7
10
|
|
|
8
11
|
You can find more information on OneSignal [here](https://onesignal.com/).
|
|
9
12
|
|
|
13
|
+
* 🏠 [Homepage](https://onesignal.com)
|
|
14
|
+
* 🖤 [npm](https://www.npmjs.com/package/onesignal-vue)
|
|
15
|
+
|
|
10
16
|
## Contents
|
|
11
17
|
- [Install](#install)
|
|
12
18
|
- [Usage](#usage)
|
|
13
19
|
- [API](#onesignal-api)
|
|
14
20
|
- [Advanced Usage](#advanced-usage)
|
|
15
21
|
|
|
22
|
+
---
|
|
23
|
+
## Vue Compatibility
|
|
24
|
+
Make sure you install a plugin version compatible with your Vue environment.
|
|
25
|
+
|
|
26
|
+
| Vue | OneSignal Plugin |
|
|
27
|
+
|-----|------------------|
|
|
28
|
+
| 2 | onesignal-vue |
|
|
29
|
+
| 3 | [onesignal-vue3](https://github.com/OneSignal/onesignal-vue3) |
|
|
30
|
+
|
|
31
|
+
|
|
16
32
|
---
|
|
17
33
|
## Install
|
|
18
34
|
|
|
@@ -88,6 +104,24 @@ export default {
|
|
|
88
104
|
### Options
|
|
89
105
|
You can pass other [options](https://documentation.onesignal.com/docs/web-push-sdk#init) to the `init` function. Use these options to configure personalized prompt options, auto-resubscribe, and more.
|
|
90
106
|
|
|
107
|
+
**Service Worker Params**
|
|
108
|
+
You can customize the location and filenames of service worker assets. You are also able to specify the specific scope that your service worker should control. You can read more [here](https://documentation.onesignal.com/docs/onesignal-service-worker-faq#sdk-parameter-reference-for-service-workers).
|
|
109
|
+
|
|
110
|
+
In this distribution, you can specify the parameters via the following:
|
|
111
|
+
|
|
112
|
+
| Field | Details |
|
|
113
|
+
|----------------------------|------------------------------------------------------------------------------------------------------------------------|
|
|
114
|
+
| `serviceWorkerParam` | Use to specify the scope, or the path the service worker has control of. Example: `{ scope: "/js/push/onesignal/" }` |
|
|
115
|
+
| `serviceWorkerPath` | The path to the service worker file. |
|
|
116
|
+
|
|
117
|
+
### Service Worker File
|
|
118
|
+
If you haven't done so already, you will need to add the [OneSignal Service Worker file](https://github.com/OneSignal/OneSignal-Website-SDK/files/7585231/OneSignal-Web-SDK-HTTPS-Integration-Files.zip) to your site ([learn more](https://documentation.onesignal.com/docs/web-push-quickstart#step-6-upload-files)).
|
|
119
|
+
|
|
120
|
+
The OneSignal SDK file must be publicly accessible. You can put them in your top-level root or a subdirectory. However, if you are placing the file not on top-level root make sure to specify the path via the service worker params in the init options (see section above).
|
|
121
|
+
|
|
122
|
+
**Tip:**
|
|
123
|
+
Visit `https://yoursite.com/OneSignalSDKWorker.js` in the address bar to make sure the files are being served successfully.
|
|
124
|
+
|
|
91
125
|
---
|
|
92
126
|
## OneSignal API
|
|
93
127
|
### Typescript
|
|
@@ -95,43 +129,43 @@ This package includes Typescript support.
|
|
|
95
129
|
|
|
96
130
|
```ts
|
|
97
131
|
interface IOneSignal {
|
|
98
|
-
init(options
|
|
99
|
-
on(event: string, listener:
|
|
100
|
-
off(event: string, listener:
|
|
101
|
-
once(event: string, listener:
|
|
102
|
-
isPushNotificationsEnabled(callback?: Action<boolean>): Promise<boolean
|
|
103
|
-
showHttpPrompt(options?: AutoPromptOptions): Promise<void
|
|
104
|
-
registerForPushNotifications(options?: RegisterOptions): Promise<void
|
|
105
|
-
setDefaultNotificationUrl(url: string): Promise<void
|
|
106
|
-
setDefaultTitle(title: string): Promise<void
|
|
107
|
-
getTags(callback?: Action<any>): Promise<void
|
|
108
|
-
sendTag(key: string, value: any, callback?: Action<Object>): Promise<Object | null
|
|
109
|
-
sendTags(tags: TagsObject<any>, callback?: Action<Object>): Promise<Object | null
|
|
110
|
-
deleteTag(tag: string): Promise<Array<string
|
|
111
|
-
deleteTags(tags: Array<string>, callback?: Action<Array<string>>): Promise<Array<string
|
|
112
|
-
addListenerForNotificationOpened(callback?: Action<Notification>): Promise<void
|
|
113
|
-
setSubscription(newSubscription: boolean): Promise<void
|
|
114
|
-
showHttpPermissionRequest(options?: AutoPromptOptions): Promise<any
|
|
115
|
-
showNativePrompt(): Promise<void
|
|
116
|
-
showSlidedownPrompt(options?: AutoPromptOptions): Promise<void
|
|
117
|
-
showCategorySlidedown(options?: AutoPromptOptions): Promise<void
|
|
118
|
-
showSmsSlidedown(options?: AutoPromptOptions): Promise<void
|
|
119
|
-
showEmailSlidedown(options?: AutoPromptOptions): Promise<void
|
|
120
|
-
showSmsAndEmailSlidedown(options?: AutoPromptOptions): Promise<void
|
|
121
|
-
getNotificationPermission(onComplete?: Function): Promise<NotificationPermission
|
|
122
|
-
getUserId(callback?: Action<string | undefined | null>): Promise<string | undefined | null
|
|
123
|
-
getSubscription(callback?: Action<boolean>): Promise<boolean
|
|
124
|
-
setEmail(email: string, options?: SetEmailOptions): Promise<string|null
|
|
125
|
-
setSMSNumber(smsNumber: string, options?: SetSMSOptions): Promise<string | null
|
|
126
|
-
logoutEmail(): Promise<void
|
|
127
|
-
logoutSMS(): Promise<void
|
|
128
|
-
setExternalUserId(externalUserId: string | undefined | null, authHash?: string): Promise<void
|
|
129
|
-
removeExternalUserId(): Promise<void
|
|
130
|
-
getExternalUserId(): Promise<string | undefined | null
|
|
131
|
-
provideUserConsent(consent: boolean): Promise<void
|
|
132
|
-
getEmailId(callback?: Action<string | undefined>): Promise<string | null | undefined
|
|
133
|
-
getSMSId(callback?: Action<string | undefined>): Promise<string | null | undefined
|
|
134
|
-
sendOutcome(outcomeName: string, outcomeWeight?: number | undefined): Promise<void
|
|
132
|
+
init(options: IInitObject): Promise<void>;
|
|
133
|
+
on(event: string, listener: () => void): void;
|
|
134
|
+
off(event: string, listener: () => void): void;
|
|
135
|
+
once(event: string, listener: () => void): void;
|
|
136
|
+
isPushNotificationsEnabled(callback?: Action<boolean>): Promise<boolean>;
|
|
137
|
+
showHttpPrompt(options?: AutoPromptOptions): Promise<void>;
|
|
138
|
+
registerForPushNotifications(options?: RegisterOptions): Promise<void>;
|
|
139
|
+
setDefaultNotificationUrl(url: string): Promise<void>;
|
|
140
|
+
setDefaultTitle(title: string): Promise<void>;
|
|
141
|
+
getTags(callback?: Action<any>): Promise<void>;
|
|
142
|
+
sendTag(key: string, value: any, callback?: Action<Object>): Promise<Object | null>;
|
|
143
|
+
sendTags(tags: TagsObject<any>, callback?: Action<Object>): Promise<Object | null>;
|
|
144
|
+
deleteTag(tag: string): Promise<Array<string>>;
|
|
145
|
+
deleteTags(tags: Array<string>, callback?: Action<Array<string>>): Promise<Array<string>>;
|
|
146
|
+
addListenerForNotificationOpened(callback?: Action<Notification>): Promise<void>;
|
|
147
|
+
setSubscription(newSubscription: boolean): Promise<void>;
|
|
148
|
+
showHttpPermissionRequest(options?: AutoPromptOptions): Promise<any>;
|
|
149
|
+
showNativePrompt(): Promise<void>;
|
|
150
|
+
showSlidedownPrompt(options?: AutoPromptOptions): Promise<void>;
|
|
151
|
+
showCategorySlidedown(options?: AutoPromptOptions): Promise<void>;
|
|
152
|
+
showSmsSlidedown(options?: AutoPromptOptions): Promise<void>;
|
|
153
|
+
showEmailSlidedown(options?: AutoPromptOptions): Promise<void>;
|
|
154
|
+
showSmsAndEmailSlidedown(options?: AutoPromptOptions): Promise<void>;
|
|
155
|
+
getNotificationPermission(onComplete?: Function): Promise<NotificationPermission>;
|
|
156
|
+
getUserId(callback?: Action<string | undefined | null>): Promise<string | undefined | null>;
|
|
157
|
+
getSubscription(callback?: Action<boolean>): Promise<boolean>;
|
|
158
|
+
setEmail(email: string, options?: SetEmailOptions): Promise<string | null>;
|
|
159
|
+
setSMSNumber(smsNumber: string, options?: SetSMSOptions): Promise<string | null>;
|
|
160
|
+
logoutEmail(): Promise<void>;
|
|
161
|
+
logoutSMS(): Promise<void>;
|
|
162
|
+
setExternalUserId(externalUserId: string | undefined | null, authHash?: string): Promise<void>;
|
|
163
|
+
removeExternalUserId(): Promise<void>;
|
|
164
|
+
getExternalUserId(): Promise<string | undefined | null>;
|
|
165
|
+
provideUserConsent(consent: boolean): Promise<void>;
|
|
166
|
+
getEmailId(callback?: Action<string | undefined>): Promise<string | null | undefined>;
|
|
167
|
+
getSMSId(callback?: Action<string | undefined>): Promise<string | null | undefined>;
|
|
168
|
+
sendOutcome(outcomeName: string, outcomeWeight?: number | undefined): Promise<void>;
|
|
135
169
|
}
|
|
136
170
|
```
|
|
137
171
|
|
|
@@ -141,10 +175,18 @@ See the official [OneSignal WebSDK reference](https://documentation.onesignal.co
|
|
|
141
175
|
---
|
|
142
176
|
## Advanced Usage
|
|
143
177
|
### Events and Event Listeners
|
|
144
|
-
|
|
178
|
+
Use listeners to react to OneSignal-related events:
|
|
179
|
+
|
|
180
|
+
* `subscriptionChange`
|
|
181
|
+
* `permissionPromptDisplay`
|
|
182
|
+
* `notificationPermissionChange`
|
|
183
|
+
* `popoverShown`
|
|
184
|
+
* `customPromptClick`
|
|
185
|
+
* `notificationDisplay`
|
|
186
|
+
* `notificationDismiss`
|
|
145
187
|
|
|
146
188
|
**Example**
|
|
147
|
-
```
|
|
189
|
+
```js
|
|
148
190
|
OneSignal.on('subscriptionChange', function(isSubscribed) {
|
|
149
191
|
console.log("The user's subscription state is now:", isSubscribed);
|
|
150
192
|
});
|
|
@@ -152,4 +194,30 @@ OneSignal.on('subscriptionChange', function(isSubscribed) {
|
|
|
152
194
|
|
|
153
195
|
See the [OneSignal WebSDK Reference](https://documentation.onesignal.com/docs/web-push-sdk) for all available event listeners.
|
|
154
196
|
|
|
155
|
-
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## 🤝 Contributing
|
|
200
|
+
|
|
201
|
+
Contributions, issues and feature requests are welcome!<br />Feel free to check [issues page](https://github.com/OneSignal/onesignal-vue/issues).
|
|
202
|
+
|
|
203
|
+
## Show your support
|
|
204
|
+
|
|
205
|
+
Give a ⭐️ if this project helped you!
|
|
206
|
+
|
|
207
|
+
## OneSignal
|
|
208
|
+
|
|
209
|
+
* [Website](https://onesignal.com)
|
|
210
|
+
* Twitter: [@onesignal](https://twitter.com/onesignal)
|
|
211
|
+
* Github: [@OneSignal](https://github.com/OneSignal)
|
|
212
|
+
* LinkedIn: [@onesignal](https://linkedin.com/company/onesignal)
|
|
213
|
+
|
|
214
|
+
## Discord
|
|
215
|
+
Reach out to us via our [Discord server](https://discord.com/invite/EP7gf6Uz7G)!
|
|
216
|
+
|
|
217
|
+
## 📝 License
|
|
218
|
+
|
|
219
|
+
Copyright © 2022 [OneSignal](https://github.com/OneSignal).<br />
|
|
220
|
+
This project is [Modified MIT](https://github.com/OneSignal/onesignal-vue/blob/main/LICENSE) licensed.
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
Enjoy!
|
package/dist/index.d.ts
CHANGED
|
@@ -1,120 +1,118 @@
|
|
|
1
|
-
declare const VueApp: any;
|
|
2
|
-
declare module 'vue/types/vue' {
|
|
3
|
-
interface Vue {
|
|
4
|
-
$OneSignal: IOneSignal;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
declare global {
|
|
8
|
-
interface Window {
|
|
9
|
-
OneSignal: any;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
};
|
|
120
|
-
export default OneSignalVuePlugin;
|
|
1
|
+
declare const VueApp: any;
|
|
2
|
+
declare module 'vue/types/vue' {
|
|
3
|
+
interface Vue {
|
|
4
|
+
$OneSignal: IOneSignal;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
interface Window {
|
|
9
|
+
OneSignal: any;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
declare type Action<T> = (item: T) => void;
|
|
13
|
+
interface AutoPromptOptions {
|
|
14
|
+
force?: boolean;
|
|
15
|
+
forceSlidedownOverNative?: boolean;
|
|
16
|
+
slidedownPromptOptions?: IOneSignalAutoPromptOptions;
|
|
17
|
+
}
|
|
18
|
+
interface RegisterOptions {
|
|
19
|
+
modalPrompt?: boolean;
|
|
20
|
+
httpPermissionRequest?: boolean;
|
|
21
|
+
slidedown?: boolean;
|
|
22
|
+
autoAccept?: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface SetSMSOptions {
|
|
25
|
+
identifierAuthHash?: string;
|
|
26
|
+
}
|
|
27
|
+
interface SetEmailOptions {
|
|
28
|
+
identifierAuthHash?: string;
|
|
29
|
+
emailAuthHash?: string;
|
|
30
|
+
}
|
|
31
|
+
interface TagsObject<T> {
|
|
32
|
+
[key: string]: T;
|
|
33
|
+
}
|
|
34
|
+
interface IOneSignalAutoPromptOptions {
|
|
35
|
+
force?: boolean;
|
|
36
|
+
forceSlidedownOverNative?: boolean;
|
|
37
|
+
isInUpdateMode?: boolean;
|
|
38
|
+
categoryOptions?: IOneSignalCategories;
|
|
39
|
+
}
|
|
40
|
+
interface IOneSignalCategories {
|
|
41
|
+
positiveUpdateButton: string;
|
|
42
|
+
negativeUpdateButton: string;
|
|
43
|
+
savingButtonText: string;
|
|
44
|
+
errorButtonText: string;
|
|
45
|
+
updateMessage: string;
|
|
46
|
+
tags: IOneSignalTagCategory[];
|
|
47
|
+
}
|
|
48
|
+
interface IOneSignalTagCategory {
|
|
49
|
+
tag: string;
|
|
50
|
+
label: string;
|
|
51
|
+
checked?: boolean;
|
|
52
|
+
}
|
|
53
|
+
interface IInitObject {
|
|
54
|
+
appId: string;
|
|
55
|
+
subdomainName?: string;
|
|
56
|
+
requiresUserPrivacyConsent?: boolean;
|
|
57
|
+
promptOptions?: object;
|
|
58
|
+
welcomeNotification?: object;
|
|
59
|
+
notifyButton?: object;
|
|
60
|
+
persistNotification?: boolean;
|
|
61
|
+
webhooks?: object;
|
|
62
|
+
autoResubscribe?: boolean;
|
|
63
|
+
autoRegister?: boolean;
|
|
64
|
+
notificationClickHandlerMatch?: string;
|
|
65
|
+
notificationClickHandlerAction?: string;
|
|
66
|
+
serviceWorkerParam?: {
|
|
67
|
+
scope: string;
|
|
68
|
+
};
|
|
69
|
+
serviceWorkerPath?: string;
|
|
70
|
+
serviceWorkerUpdaterPath?: string;
|
|
71
|
+
path?: string;
|
|
72
|
+
allowLocalhostAsSecureOrigin?: boolean;
|
|
73
|
+
[key: string]: any;
|
|
74
|
+
}
|
|
75
|
+
interface IOneSignal {
|
|
76
|
+
init(options: IInitObject): Promise<void>;
|
|
77
|
+
on(event: string, listener: () => void): void;
|
|
78
|
+
off(event: string, listener: () => void): void;
|
|
79
|
+
once(event: string, listener: () => void): void;
|
|
80
|
+
isPushNotificationsEnabled(callback?: Action<boolean>): Promise<boolean>;
|
|
81
|
+
showHttpPrompt(options?: AutoPromptOptions): Promise<void>;
|
|
82
|
+
registerForPushNotifications(options?: RegisterOptions): Promise<void>;
|
|
83
|
+
setDefaultNotificationUrl(url: string): Promise<void>;
|
|
84
|
+
setDefaultTitle(title: string): Promise<void>;
|
|
85
|
+
getTags(callback?: Action<any>): Promise<void>;
|
|
86
|
+
sendTag(key: string, value: any, callback?: Action<Object>): Promise<Object | null>;
|
|
87
|
+
sendTags(tags: TagsObject<any>, callback?: Action<Object>): Promise<Object | null>;
|
|
88
|
+
deleteTag(tag: string): Promise<Array<string>>;
|
|
89
|
+
deleteTags(tags: Array<string>, callback?: Action<Array<string>>): Promise<Array<string>>;
|
|
90
|
+
addListenerForNotificationOpened(callback?: Action<Notification>): Promise<void>;
|
|
91
|
+
setSubscription(newSubscription: boolean): Promise<void>;
|
|
92
|
+
showHttpPermissionRequest(options?: AutoPromptOptions): Promise<any>;
|
|
93
|
+
showNativePrompt(): Promise<void>;
|
|
94
|
+
showSlidedownPrompt(options?: AutoPromptOptions): Promise<void>;
|
|
95
|
+
showCategorySlidedown(options?: AutoPromptOptions): Promise<void>;
|
|
96
|
+
showSmsSlidedown(options?: AutoPromptOptions): Promise<void>;
|
|
97
|
+
showEmailSlidedown(options?: AutoPromptOptions): Promise<void>;
|
|
98
|
+
showSmsAndEmailSlidedown(options?: AutoPromptOptions): Promise<void>;
|
|
99
|
+
getNotificationPermission(onComplete?: Action<NotificationPermission>): Promise<NotificationPermission>;
|
|
100
|
+
getUserId(callback?: Action<string | undefined | null>): Promise<string | undefined | null>;
|
|
101
|
+
getSubscription(callback?: Action<boolean>): Promise<boolean>;
|
|
102
|
+
setEmail(email: string, options?: SetEmailOptions): Promise<string | null>;
|
|
103
|
+
setSMSNumber(smsNumber: string, options?: SetSMSOptions): Promise<string | null>;
|
|
104
|
+
logoutEmail(): Promise<void>;
|
|
105
|
+
logoutSMS(): Promise<void>;
|
|
106
|
+
setExternalUserId(externalUserId: string | undefined | null, authHash?: string): Promise<void>;
|
|
107
|
+
removeExternalUserId(): Promise<void>;
|
|
108
|
+
getExternalUserId(): Promise<string | undefined | null>;
|
|
109
|
+
provideUserConsent(consent: boolean): Promise<void>;
|
|
110
|
+
getEmailId(callback?: Action<string | undefined>): Promise<string | null | undefined>;
|
|
111
|
+
getSMSId(callback?: Action<string | undefined>): Promise<string | null | undefined>;
|
|
112
|
+
sendOutcome(outcomeName: string, outcomeWeight?: number | undefined): Promise<void>;
|
|
113
|
+
[index: string]: Function;
|
|
114
|
+
}
|
|
115
|
+
declare const OneSignalVuePlugin: {
|
|
116
|
+
install(app: typeof VueApp): void;
|
|
117
|
+
};
|
|
118
|
+
export default OneSignalVuePlugin;
|