onesignal-vue 2.5.0 → 2.5.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "onesignal-vue",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "Vue OneSignal Plugin: Make it easy to integrate OneSignal with your Vue App!",
5
5
  "type": "module",
6
6
  "contributors": [
@@ -27,11 +27,7 @@
27
27
  "typescript": "^4.6.3"
28
28
  },
29
29
  "files": [
30
- "dist",
31
- "README.md",
32
- "LICENSE",
33
- "CHANGELOG.md",
34
- "MigrationGuide.md"
30
+ "dist"
35
31
  ],
36
32
  "keywords": [
37
33
  "onesignal",
package/CHANGELOG.md DELETED
@@ -1,39 +0,0 @@
1
- # Changelog
2
-
3
- ## [2.5.0](https://github.com/OneSignal/onesignal-vue/compare/2.4.2...2.5.0) (2025-09-18)
4
-
5
- ### Features
6
-
7
- * sync with web-shim-codegen v3.0.6 ([646d78a](https://github.com/OneSignal/onesignal-vue/commit/646d78abc4034412cf3afe8bdf13a14d1e4ce605))
8
-
9
- ## [2.4.2](https://github.com/OneSignal/onesignal-vue/compare/2.4.1...2.4.2) (2025-06-06)
10
-
11
- ### Bug Fixes
12
-
13
- * sync with web-shim-codegen v3.0.5 ([0597a34](https://github.com/OneSignal/onesignal-vue/commit/0597a346a9d44670828c316db2194f0652aad3a0))
14
-
15
- ## [2.4.1](https://github.com/OneSignal/onesignal-vue/compare/2.4.0...2.4.1) (2025-05-12)
16
-
17
- ## [2.4.0](https://github.com/OneSignal/onesignal-vue/compare/2.3.0...2.4.0) (2025-05-10)
18
-
19
- ### Features
20
-
21
- * sync with web-shim-codegen v3.0.4 ([ce0d876](https://github.com/OneSignal/onesignal-vue/commit/ce0d8763eac93873cb38e74b7e8b3fe13af43a70))
22
-
23
- ## [2.3.0](https://github.com/OneSignal/onesignal-vue/compare/2.2.0...2.3.0) (2025-03-28)
24
-
25
- ### Features
26
-
27
- * sync with web-shim-codegen v3.0.4 ([c7bb67e](https://github.com/OneSignal/onesignal-vue/commit/c7bb67e6f905488fca8e14207f044970f0ed0279))
28
-
29
- ## [2.2.0](https://github.com/OneSignal/onesignal-vue/compare/2.1.0...2.2.0) (2025-03-24)
30
-
31
- ### Features
32
-
33
- * sync with web-shim-codegen v3.0.2 ([5937a51](https://github.com/OneSignal/onesignal-vue/commit/5937a513bcd7927fc1dc73fcc0407bb3d19f573d))
34
-
35
- ## [2.1.0](https://github.com/OneSignal/onesignal-vue/compare/2.0.1...2.1.0) (2025-03-18)
36
-
37
- ### Features
38
-
39
- * sync with web-shim-codegen v3.0.1 ([689df89](https://github.com/OneSignal/onesignal-vue/commit/689df8984f94f143b3371b0e7af46fe65b71da15)), closes [#143](https://github.com/OneSignal/onesignal-vue/issues/143)
package/MigrationGuide.md DELETED
@@ -1,244 +0,0 @@
1
-
2
- # Migration Guide
3
-
4
- ## Version 2
5
- ### Intro
6
- In this release, we are making a significant shift from a device-centered model to a user-centered model. This means that instead of identifying devices, we now focus on identifying individual users. This update is part of a larger effort to shift towards a user-oriented omni-channel messaging system.
7
-
8
- To facilitate this change, the externalId approach for identifying users is being replaced by the login and logout methods. In addition, the SDK now makes use of namespaces such as User, Notifications, and Slidedown to better separate code.
9
-
10
- This guide will walk you through these and other important changes in the version 16 update.
11
-
12
- ### Overview
13
- Under the new model, the concept of a "player" is being updated to include three new concepts: users, subscriptions, and aliases.
14
-
15
- ### Users
16
- Users own subscriptions and are identified by aliases which are used to point to users using different alias schemes.
17
-
18
- ### Subscriptions
19
-
20
- Subscriptions refer to the way in which a user can receive various communication methods offered by OneSignal, including push notifications, SMS, and email.
21
-
22
- ### Aliases
23
- Aliases are identifiers that point to users and are made up of an alias label and id. Users can have multiple aliases. Consider the need to identify a user with your own application's unique identifier as well as identifiers from other integrated applications.
24
-
25
- The SDK will use `external_id` as the default alias label for the public `OneSignal.login("1234")` method.
26
-
27
- **Alias Example:**
28
- ```
29
- "aliases": [
30
- {
31
- "label": "external_id",
32
- "id": "1234"
33
- },
34
- {
35
- "label": "my_alias",
36
- "id": "5678"
37
- }
38
- ]
39
- ```
40
-
41
- ```js
42
- // WebSDK-specific example
43
- {
44
- external_id: "1234",
45
- my_alias: "5678"
46
- }
47
- ```
48
-
49
- # Guide
50
- ## 1. Setup Changes
51
- ### Service Worker File
52
-
53
- From:
54
- ```js
55
- importScripts("https://onesignal.com/sdks/OneSignalSDKWorker.js");
56
- ```
57
-
58
- To:
59
- ```js
60
- importScripts("https://onesignal.com/sdks/web/v16/OneSignalSDK.sw.js");
61
- ```
62
-
63
- ## 2. External User ID
64
- Update any usages of `OneSignal.setExternalId` to `OneSignal.login` or `OneSignal.logout`
65
- From:
66
- ```js
67
- OneSignal.setExternalId("myId");
68
- ```
69
-
70
- To:
71
- ```js
72
- OneSignal.login("myId");
73
- ```
74
-
75
- Use `OneSignal.logout();` instead anywhere you have `OneSignal.setExternalId("");` or are setting it to `null`.
76
-
77
- ## 3. API Changes
78
- Update your code to use the new API. The following namespaces are on the `OneSignal` object.
79
-
80
- ### User Namespace
81
-
82
- Example:
83
- ```js
84
- OneSignal.User.addAlias("my_alias", "1234");
85
- ```
86
-
87
- All user functions are synchronous.
88
-
89
- | Function Name | Description | Argument List |
90
- | --------------- | ---------------------------------------------- | ------------------------------------ |
91
- | `addAlias` | Adds a new alias for the current user. | `label: string, id: string` |
92
- | `addAliases` | Adds multiple aliases for the current user. | `aliases: { [key: string]: string }` |
93
- | `removeAlias` | Removes an alias for the current user. | `label: string` |
94
- | `removeAliases` | Removes multiple aliases for the current user. | `labels: string[]` |
95
- | `addEmail` | Adds an email address for the current user. | `email: string` |
96
- | `removeEmail` | Removes an email address for the current user. | `email: string` |
97
- | `addSms` | Adds an SMS number for the current user. | `smsNumber: string` |
98
- | `removeSms` | Removes an SMS number for the current user. | `smsNumber: string` |
99
- | `addTag` | Adds a tag for the current user. | `key: string, value: string` |
100
- | `addTags` | Adds multiple tags for the current user. | `tags: { [key: string]: string }` |
101
- | `removeTag` | Removes a tag for the current user. | `key: string` |
102
- | `removeTags` | Removes multiple tags for the current user. | `keys: string[]` |
103
-
104
- ### Notifications Namespace
105
-
106
- Example:
107
- ```js
108
- await OneSignal.Notifications.requestPermission();
109
- ```
110
-
111
-
112
- | Sync/Async | Property/Function | Description | Argument List |
113
- | ---------- | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
114
- | `async` | `setDefaultUrl()` | Sets the default URL for notifications. | `url` (string) |
115
- | `async` | `setDefaultTitle()` | Sets the default title for notifications. | `title` (string) |
116
- | `sync` | `isPushSupported()` | Returns true if the current browser supports web push. | |
117
- | `async` | `requestPermission()` | Requests push notifications permission via the native browser prompt. | |
118
- | | `permission` | Returns true if your site has permission to display notifications. | |
119
- | | `permissionNative` | Returns browser's native notification permission status; `"default"`(end-user has not accept or decided yet), `"granted"`, or `"denied"`. | |
120
- | `sync` | `addEventListener()` | Adds an event listener for the following events:<br><br>- `click`<br>- `foregroundWillDisplay`<br>- `dismiss`<br>- `permissionPromptDisplay`<br>- `permissionChange`*<br> * argument type: bool | - `<event>` (string)<br>- `(arg: <type>) => {}` (callback) |
121
- | `sync` | `removeEventListener()` | Removes the event listener. | `() => {}` (the event listener you want to remove) |
122
-
123
-
124
-
125
- ### Slidedown Namespace
126
-
127
- Example:
128
- ```js
129
- await OneSignal.Slidedown.promptPush();
130
- ```
131
-
132
- | Sync/Async | Function Name | Description | Argument List |
133
- | ---------- | ---------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------- |
134
- | `async` | `promptPush` | Displays the notification permission prompt. | `options` (AutoPromptOptions) |
135
- | `async` | `promptPushCategories` | Displays the notification permission prompt for notification categories. | `options` (AutoPromptOptions) |
136
- | `async` | `promptSms` | Displays the SMS subscription prompt. | `options` (AutoPromptOptions) |
137
- | `async` | `promptEmail` | Displays the email subscription prompt. | `options` (AutoPromptOptions) |
138
- | `async` | `promptSmsAndEmail` | Displays the SMS and email subscription prompts. | `options` (AutoPromptOptions) |
139
- | `sync` | `addEventListener` | Adds an event listener for the `slidedownShown` event. | - `event` ("slidedownShown"), <br>- `listener` ((wasShown: boolean) => void) |
140
- | `sync` | `removeEventListener` | Removes an event listener for the `slidedownShown` event. | - `event` ("slidedownShown")<br>- `listener` ((wasShown: boolean) => void) |
141
-
142
-
143
-
144
- ### Push Subscription Namespace
145
-
146
- Example:
147
- ```js
148
- OneSignal.User.PushSubscription.optIn();
149
- ```
150
-
151
- | Sync/Async | Property/Function | Description | Argument List |
152
- | ---------- | ----------------------- | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
153
- | | `id` | Gets the current user's ID. | |
154
- | | `token` | Gets the current user's push notification token. | |
155
- | | `optedIn` | Gets a boolean value indicating whether the current user is subscribed to push notifications. | |
156
- | `async` | `optIn()` | Subscribes the current user to push notifications. | |
157
- | `async` | `optOut()` | Unsubscribes the current user from push notifications. | |
158
- | `sync` | `addEventListener()` | Adds an event listener for the `change` event. | - `event` ("change")<br>- `listener` ((change: SubscriptionChangeEvent) => void) |
159
- | `sync` | `removeEventListener()` | Removes an event listener for the `change` event. | - `event` ("change")<br>- `listener` ((change: SubscriptionChangeEvent) => void) |
160
-
161
- ### Debug Namespace
162
-
163
- Example:
164
- ```js
165
- OneSignal.Debug.setLogLevel(“trace”);
166
- ```
167
-
168
- | Function Name | Description | Argument List |
169
- | --------------- | ---------------------------------------------- | ------------------------------------ |
170
- | `setLogLevel` | Turns on logging with the given log level. | `setLogLevel: string`<br>- `"trace"`<br>- `"debug"`<br>- `"info"`<br>- `"warn"`<br>- `"error"` |
171
-
172
- # Limitations
173
- * HTTP environments are no longer supported.
174
- * AMP environments are not supported.
175
- * Identity verification not available yet, coming soon.
176
-
177
- # Glossary
178
-
179
- **OneSignal user**
180
-
181
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(noun) lowercase*
182
-
183
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A user of the OneSignal service.
184
-
185
- **user**
186
-
187
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(noun) lowercase*
188
-
189
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An end-user of an application using the OneSignal service. They may or may not have a subscription.
190
-
191
- **user ID**
192
-
193
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(noun) lowercase*
194
-
195
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A OneSignal-provisioned unique identifier for Users (User.onesignal_id).
196
-
197
-
198
- **user external ID**
199
-
200
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(noun) lowercase*
201
-
202
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A customer-provisioned unique identifier for Users (User.external_id).
203
-
204
-
205
- **user alias**
206
-
207
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(noun) lowercase*
208
-
209
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A customer provisioned key-value pair used to uniquely identify a User.
210
-
211
-
212
- **subscription**
213
-
214
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(noun) lowercase*
215
-
216
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An established communication channel between an App and its User, such as a push-subscribed device, email address, or SMS-subscribed phone number.
217
-
218
-
219
- **subscription ID**
220
-
221
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(noun) lowercase*
222
-
223
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A OneSignal-provisioned unique identifier for a single subscription.
224
-
225
-
226
- **notification**
227
-
228
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(noun) lowercase*
229
-
230
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A unidirectional outbound communication message from an App to one or more Users via their Subscriptions.
231
-
232
-
233
- **notification ID**
234
-
235
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(noun) lowercase*
236
-
237
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A OneSignal-provisioned unique identifier for Notifications (Notification.id).
238
-
239
-
240
- **notification external ID**
241
-
242
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*(noun) lowercase*
243
-
244
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A customer-provisioned unique identifier for Notifications (Notification.external_id).