cordova-plugin-reteno 2.0.4 → 2.2.0

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/docs/android.md CHANGED
@@ -35,8 +35,7 @@ Notes:
35
35
  You can request it via the plugin API:
36
36
 
37
37
  ```js
38
- RetenoPlugin
39
- .requestNotificationPermission()
38
+ RetenoPlugin.requestNotificationPermission()
40
39
  .then((grantedInt) => {
41
40
  // grantedInt: 1 (granted) or 0 (declined)
42
41
  })
@@ -50,8 +49,7 @@ RetenoPlugin
50
49
  Initialize Reteno once during app startup:
51
50
 
52
51
  ```js
53
- RetenoPlugin
54
- .init()
52
+ RetenoPlugin.init()
55
53
  .then(() => {
56
54
  // initialized
57
55
  })
@@ -60,7 +58,7 @@ RetenoPlugin
60
58
  });
61
59
  ```
62
60
 
63
- For Android SDK `2.9.4+`, you can also configure session duration and split session lifecycle flags during init:
61
+ For Android SDK `2.9.6+`, you can also configure session duration and split session lifecycle flags during init:
64
62
 
65
63
  ```js
66
64
  RetenoPlugin.init({
@@ -68,7 +66,7 @@ RetenoPlugin.init({
68
66
  sessionDurationSeconds: 30 * 60,
69
67
  lifecycleTrackingOptions: {
70
68
  appLifecycleEnabled: true,
71
- // ApplicationForgrounded/ApplicationBackgrounded events (disabled by default in 2.9.4)
69
+ // ApplicationForgrounded/ApplicationBackgrounded events (disabled by default)
72
70
  foregroundLifecycleEnabled: false,
73
71
  pushSubscriptionEnabled: true,
74
72
  // SessionStart/SessionEnd can now be managed separately
@@ -86,7 +84,7 @@ If you need advanced Reteno configuration (custom `RetenoConfig`, custom device
86
84
 
87
85
  ## Push notification listeners
88
86
 
89
- The plugin uses the listener-based API (`EventListener` / `Procedure`, Android SDK `2.9.4`) for all push events.
87
+ The plugin uses the listener-based API (`EventListener` / `Procedure`, Android SDK `2.9.6`) for all push events.
90
88
 
91
89
  - `setOnRetenoPushDismissedListener(listener)` — called when a push notification is dismissed (swiped away).
92
90
  - `setOnRetenoCustomPushReceivedListener(listener)` — called when a custom push notification is received.
@@ -110,6 +108,23 @@ RetenoPlugin.removeOnRetenoPushDismissedListener(onDismissed);
110
108
  RetenoPlugin.removeOnRetenoCustomPushReceivedListener(onCustomReceived);
111
109
  ```
112
110
 
111
+ ## Notification grouping
112
+
113
+ Android notifications can be assigned to a group using either a value from the push payload or a constant group ID. The configuration is stored natively and restored when the Android process starts, so it does not depend on the Cordova WebView being active.
114
+
115
+ ```js
116
+ // Group notifications by the `chatId` field in the push payload.
117
+ await RetenoPlugin.setNotificationGroupingRule({ payloadKey: 'chatId' });
118
+
119
+ // Alternatively, assign all Reteno notifications to one group.
120
+ await RetenoPlugin.setNotificationGroupingRule({ groupId: 'messages' });
121
+
122
+ // Disable grouping.
123
+ await RetenoPlugin.setNotificationGroupingRule(null);
124
+ ```
125
+
126
+ This configures the group key on each notification. If you want Android to display a summary row for the group, the application must create its own notification with `setGroupSummary(true)` using the same group ID.
127
+
113
128
  ### Without Firebasex (Cordova)
114
129
 
115
130
  If you **do not need** `cordova-plugin-firebasex` features, you can still use Reteno Push on Android.