You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure your `applicationId` value matches exactly what you've defined in your Engagement project settings.
176
+
Make sure your `applicationId` value matches exactly Application ID configured in your Bloomreach Engagement under **Project Settings > Campaigns > Channels > Push Notifications.**
177
177
178
178
**Single mobile app:** If your Engagement project supports only one app, you can skip the `applicationId` configuration. The SDK will automatically use the default value "default-application".
Copy file name to clipboardExpand all lines: Documentation/firebase.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,15 @@ Next, you must create and register a service that extends `FirebaseMessagingServ
74
74
75
75
The SDK will only handle push notification messages sent from the Engagement platform. A helper method `Exponea.isExponeaPushNotification()` is also provided.
76
76
77
-
If you run the app, the SDK should the track push token to the Engagement platform. If you enabled the self-check, it will you inform you of this. Alternatively, you can find the customer in the Engagement web app and check the customer property `google_push_notification_id`.
77
+
After running your application, the SDK tracks the push token to the Engagement platform. If you enabled the self-check feature, it will confirm successful tracking.
78
+
You can also verify token tracking manually by locating the customer in the Bloomreach Engagement web application:
79
+
80
+
-**SDK versions below 4.6.0:** Check the customer property `google_push_notification_id`
81
+
-**SDK versions 4.6.0 and higher:** Check the `notification_state` event with property `push_notification_token`
82
+
83
+
> ❗️Important
84
+
>
85
+
> SDK versions 4.6.0 and higher use event-based token tracking to support multiple mobile applications per project. Learn more about [Token tracking via notification_state event](https://documentation.bloomreach.com/engagement/docs/android-sdk-push-notifications#token-tracking-via-notification_state-event).
78
86
79
87
A push token is typically generated at the first application start, but it has its own lifecycle. Your `FirebaseMessagingService` implementation is triggered only if a token is created or its value has changed. Please validate your expectations against the defined [token update triggers](https://firebase.google.com/docs/cloud-messaging/android/client#sample-register)
Copy file name to clipboardExpand all lines: Documentation/huawei.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,15 @@ Next, you must create and register a service that extends `HmsMessageService`. T
83
83
84
84
TheSDK will only handle push notification messages sent from the Engagement platform. A helper method `Exponea.isExponeaPushNotification()` is also provided.
85
85
86
-
If you run the app, the SDK should the track push token to the Engagement platform. If you enabled the self-check, it will you inform you of this. Alternatively, you can find the customer in the Engagement web app and check the customer property `huawei_push_notification_id`.
86
+
After running your application, the SDK tracks the push token to the Engagement platform. If you enabled the self-check feature, it will confirm successful tracking.
87
+
You can also verify token tracking manually by locating the customer in the BloomreachEngagement web application:
88
+
89
+
-**SDK versions below 4.6.0:**Check the customer property `huawei_push_notification_id`
90
+
-**SDK versions 4.6.0and higher:**Check the `notification_state` event with property `push_notification_token`
91
+
92
+
> ❗️Important
93
+
>
94
+
>SDK versions 4.6.0and higher use event-based token tracking to support multiple mobile applications per project. Learn more about [Token tracking via notification_state event](https://documentation.bloomreach.com/engagement/docs/android-sdk-push-notifications#token-tracking-via-notification_state-event).
87
95
88
96
A push token is typically generated at the first application start, but it has its own lifecycle. Your `HmsMessageService` implementation is triggered only if a token is created or its value has changed. Please validate your expectations against the defined [token update triggers](https://developer.huawei.com/consumer/en/doc/HMSCore-Guides/android-client-dev-0000001050042041#section487774626)
Copy file name to clipboardExpand all lines: Documentation/push-notifications.md
+96Lines changed: 96 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,10 @@ By default, the SDK tracks push notifications automatically. In the [SDK configu
92
92
93
93
If `automaticPushNotification` is enabled, the SDK will display push notifications from Engagement and track a "campaign" event for every delivered/opened push notification with the relevant properties.
94
94
95
+
> ❗️Important
96
+
>
97
+
> SDK versions 4.6.0 and higher use event-based token tracking to support multiple mobile applications per project. Learn more about [Token tracking via notification_state event](#token-tracking-via-notification_state-event).
98
+
95
99
### Respond to push notifications
96
100
97
101
When [creating a push notification](https://documentation.bloomreach.com/engagement/docs/mobile-push-notifications#creating-a-new-notification) in the Engagment web app, you can choose from three different actions to be performed when tapping the notification or additional buttons displayed with the notification.
@@ -249,6 +253,10 @@ Exponea.trackPushToken(
249
253
250
254
Invoking this method will track the push token immediately regardless of the [SDK configuration](https://documentation.bloomreach.com/engagement/docs/android-sdk-configuration) for `tokenTrackFrequency`.
251
255
256
+
> ❗️Important
257
+
>
258
+
> SDK versions 4.6.0 and higher use event-based token tracking to support multiple mobile applications per project. Learn more about [Token tracking via notification_state event](#token-tracking-via-notification_state-event).
259
+
252
260
#### Track delivered push notification
253
261
254
262
Use the [`trackDeliveredPush`](https://documentation.bloomreach.com/engagement/docs/android-sdk-tracking#track-push-notification-delivery-manually) method to manually track a delivered push notification:
@@ -356,6 +364,94 @@ Notification payloads use a JSON data structure.
356
364
}
357
365
```
358
366
367
+
## Token tracking via notification_state event
368
+
369
+
Starting with SDK version 4.6.0, push notification tokens are tracked using `notification_state` events instead of customer
370
+
profile properties. This change enables support for multiple mobile applications per project,
371
+
allowing you to track multiple push tokens for the same customer across different apps and devices.
372
+
373
+
### Token storage by SDK version
374
+
375
+
#### SDK versions below 4.6.0:
376
+
377
+
* Tokens are stored in customer profile properties: `google_push_notification_id` or `huawei_push_notification_id`
378
+
* One token per customer profile
379
+
* Single application per project
380
+
381
+
#### SDK versions 4.6.0 and higher:
382
+
383
+
* Tokens are stored as `notification_state` events
384
+
* Multiple tokens per customer (grouped by Application ID)
385
+
* Multiple applications per project supported
386
+
* Backward compatibility maintained for Application ID `default-application`
387
+
388
+
### When notification_state events are tracked
389
+
390
+
The SDK automatically tracks `notification_state` events in the following scenarios:
391
+
392
+
* SDK initialization
393
+
* App transitions from background to foreground
394
+
* New token received from Firebase or Huawei
395
+
* Manual token tracking using `Exponea.trackPushToken(...)` or `Exponea.trackHmsPushToken(...)`
396
+
* User anonymization via `Exponea.anonymize()`
397
+
* Notification permission requested via `Exponea.requestPushAuthorization(...)`
Logger.i(this, "Push notifications are allowed: $granted")
402
+
}
403
+
```
404
+
405
+
The frequency of `notification_state` event tracking depends on the `tokenTrackFrequency` configuration property. [See SDK configuration](https://documentation.bloomreach.com/engagement/docs/android-sdk-configuration).
> If you don't specify an `application_id` in your SDK configuration, the default value `default-application` is used. [See SDK configuration](https://documentation.bloomreach.com/engagement/docs/android-sdk-configuration).
421
+
422
+
### Understanding token states
423
+
424
+
The combination of `valid` and `description` properties indicates the token's current state:
|`false`|`Invalidated`| New token received \(old token becomes invalid\) or `Exponea.anonymize()` called |
429
+
|`false`|`Permission denied`|[requirePushAuthorization](https://documentation.bloomreach.com/engagement/docs/android-sdk-configuration) is `true` and user denied notification permission |
430
+
|`true`|`Permission granted`| Valid token tracked successfully \(all other cases\)|
431
+
432
+
### Configuring Application ID
433
+
434
+
> 📘 Note
435
+
>
436
+
> See this section to configure `application_id`. [Configure Application ID](https://documentation.bloomreach.com/engagement/docs/android-sdk-setup#configure-application-id).
437
+
438
+
> ❗️Important
439
+
>
440
+
> The SDK can automatically generate `notification_state` events,
441
+
> but your Engagement project must have event creation enabled. If your project uses custom event schemas
442
+
> or restricts event creation, add `notification_state` to the list of allowed events. Otherwise, push token registration will fail silently.
443
+
444
+
### Verifying token tracking
445
+
446
+
You can verify that tokens are being tracked correctly in the Bloomreach Engagement web application:
447
+
448
+
1. Navigate to Data & Assets > Customers
449
+
2. Locate the customer profile
450
+
3. Check for `notification_state` events in the customer's event history
451
+
4. Verify the `push_notification_token` property contains a valid token value
452
+
453
+
For SDK versions below 4.6.0, check the customer profile properties `google_push_notification_id` or `huawei_push_notification_id` instead.
Make sure your `applicationId` value matches exactly what you've defined in your Engagement project settings.
101
+
Make sure your `applicationId` value matches exactly Application ID configured in your Bloomreach Engagement under **Project Settings > Campaigns > Channels > Push Notifications.**
102
102
103
103
**Single mobile app:** If your Engagement project supports only one app, you can skip the `applicationId` configuration. The SDK will automatically use the default value "default-application".
Copy file name to clipboardExpand all lines: Documentation/tracking.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ By default, the SDK tracks certain events automatically, including:
13
13
* Installation (after app installation and after invoking [anonymize](#anonymize))
14
14
* User session start and end
15
15
* Banner event for showing an in-app message or content block
16
+
*`notification_state` event for push notification token tracking (SDK versions 4.6.0 and higher). [Learn more](https://documentation.bloomreach.com/engagement/docs/android-sdk-push-notifications#token-tracking-via-notification_state-event).
16
17
17
18
Additionally, you can track any custom event relevant to your business.
18
19
@@ -195,6 +196,22 @@ Invoking this method will cause the SDK to:
195
196
* Preload in-app messages, in-app content blocks, and app inbox for the new customer.
196
197
* Track a new `installation` event for the new customer.
197
198
199
+
#### How tokens are removed during anonymization
200
+
201
+
The SDK removes push notification tokens differently depending on the version:
202
+
203
+
**SDK versions below 4.6.0:**
204
+
205
+
- Assigns an empty string to the `google_push_notification_id` or `huawei_push_notification_id` customer property
206
+
207
+
**SDK versions 4.6.0 and higher:**
208
+
209
+
- Tracks a `notification_state` event with `valid = false` and `description = Invalidated`
210
+
211
+
> 📘 Note
212
+
>
213
+
> Learn more about [Token tracking via notification_state event](https://documentation.bloomreach.com/engagement/docs/android-sdk-push-notifications#token-tracking-via-notification_state-event).
214
+
198
215
You can also use the `anonymize` method to switch to a different Engagement project. The SDK will then track events to a new customer record in the new project, similar to the first app session after installation on a new device.
199
216
200
217
#### Examples
@@ -271,6 +288,10 @@ Invoking this method will track a push token immediately regardless of the value
271
288
272
289
Each time the app becomes active, the SDK calls `verifyPushStatusAndTrackPushToken` and tracks the token.
273
290
291
+
> 📘 Note
292
+
>
293
+
> SDK versions 4.6.0 and higher use event-based token tracking. Learn more about [Token tracking via notification_state event](https://documentation.bloomreach.com/engagement/docs/android-sdk-push-notifications#token-tracking-via-notification_state-event).
This guide will help you upgrade your Exponea SDK to the latest major version.
10
10
11
+
## Update to version 4.6.0 or higher
12
+
13
+
SDK versions 4.6.0 and higher support multiple mobile applications within a single Bloomreach Engagement project.
14
+
15
+
This update introduces two major changes:
16
+
17
+
### 1. **Application ID configuration**
18
+
19
+
Each mobile application integrated with the SDK can now have its own unique `applicationId`. This identifier distinguishes between different applications within the same project.
20
+
21
+
**When to configure Application ID:**
22
+
23
+
-**Multiple mobile apps:** You must specify a unique `applicationId` for each app in the SDK configuration. The value must match the Application ID configured in Bloomreach Engagement under **Project Settings > Campaigns > Channels > Push Notifications.**
24
+
-**Single mobile app:** If you use only one mobile application, you don't need to set `applicationId`. The SDK uses the default value `default-application` automatically.
25
+
26
+
Learn more about [SDK configuration](https://documentation.bloomreach.com/engagement/docs/android-sdk-configuration) and [Configure Application ID](https://documentation.bloomreach.com/engagement/docs/android-sdk-setup#configure-application-id).
27
+
28
+
### 2. **Push notification token tracking**
29
+
30
+
Push notification tokens are now tracked using `notification_state` events instead of customer properties (`google_push_notification_id` or `huawei_push_notification_id`). This change enables tracking multiple push tokens for the same customer across different applications and devices.
31
+
32
+
**Important prerequisites before upgrading:**
33
+
34
+
The SDK automatically generates `notification_state` events. Before upgrading to version 4.6.0 or higher:
35
+
36
+
- Ensure event creation is enabled for your Bloomreach Engagement project
37
+
- If your project uses custom event schemas or restricts event creation, add `notification_state` to the list of allowed events
38
+
- If your project blocks creation of new event types, push token registration will fail silently
39
+
40
+
**Symptoms of blocked event creation:**
41
+
42
+
- No new tokens appear in customer profiles or the event stream after SDK initialization
43
+
- Push notifications are not delivered
44
+
45
+
Learn more about [Token tracking via notification_state event](https://documentation.bloomreach.com/engagement/docs/android-sdk-push-notifications#token-tracking-via-notification_state-event).
46
+
11
47
## Update from version 3.x.x to 4.x.x
12
48
13
49
Updating Exponea SDK to version 4 or higher requires making some changes related to in-app messages callback implementations.
@@ -182,4 +218,3 @@ has changed to
182
218
> ❗️
183
219
>
184
220
> Invoking `Exponea.handleNewToken`, `Exponea.handleNewHmsToken`, and `Exponea.handleRemoteMessage` is allowed before SDK initialization in case it was initialized previously. In such a case, these methods will track events with the configuration of the last initialization. Please consider initializing the SDK in `Application::onCreate` to ensure a fresh configuration is applied in case of an update of your application.
0 commit comments