@bubblsdk/react-native-sdk 4.1.7 → 5.0.0-alpha.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.
Files changed (176) hide show
  1. package/BubblReactNativeSdk.podspec +29 -9
  2. package/CHANGELOG.md +52 -1
  3. package/LICENSE +202 -1
  4. package/README.md +172 -83
  5. package/android/build.gradle +33 -30
  6. package/android/src/main/AndroidManifest.xml +1 -0
  7. package/android/src/main/java/tech/bubbl/reactnative/BubblJson.kt +135 -0
  8. package/android/src/main/java/tech/bubbl/reactnative/BubblSdkModule.kt +277 -0
  9. package/android/src/main/java/tech/bubbl/reactnative/BubblSdkPackage.kt +26 -0
  10. package/app.plugin.js +2 -0
  11. package/ios/BubblPush.swift +44 -0
  12. package/ios/BubblSdk.h +7 -0
  13. package/ios/BubblSdk.mm +252 -0
  14. package/ios/BubblSdkImpl.swift +335 -0
  15. package/ios-extension/BubblReactNativeNotificationService.podspec +44 -0
  16. package/ios-extension/Sources/BubblCore/API/ApiResponse.swift +90 -0
  17. package/ios-extension/Sources/BubblCore/API/CredentialStore.swift +116 -0
  18. package/ios-extension/Sources/BubblCore/API/DeviceApiClient.swift +239 -0
  19. package/ios-extension/Sources/BubblCore/API/ErrorActions.swift +68 -0
  20. package/ios-extension/Sources/BubblCore/API/Http.swift +39 -0
  21. package/ios-extension/Sources/BubblCore/API/ServerClock.swift +69 -0
  22. package/ios-extension/Sources/BubblCore/BubblVersion.swift +5 -0
  23. package/ios-extension/Sources/BubblCore/Device/ConfigSync.swift +216 -0
  24. package/ios-extension/Sources/BubblCore/Device/DeviceSync.swift +160 -0
  25. package/ios-extension/Sources/BubblCore/Device/ProvisioningProfile.swift +24 -0
  26. package/ios-extension/Sources/BubblCore/Engine/EngineCore.swift +523 -0
  27. package/ios-extension/Sources/BubblCore/Engine/Geofencing.swift +170 -0
  28. package/ios-extension/Sources/BubblCore/Engine/Permissions.swift +90 -0
  29. package/ios-extension/Sources/BubblCore/Engine/Privacy.swift +64 -0
  30. package/ios-extension/Sources/BubblCore/Engine/PrivacyControls.swift +184 -0
  31. package/ios-extension/Sources/BubblCore/Engine/Pushes.swift +61 -0
  32. package/ios-extension/Sources/BubblCore/Engine/Sandbox.swift +149 -0
  33. package/ios-extension/Sources/BubblCore/Events/EventQueue.swift +207 -0
  34. package/ios-extension/Sources/BubblCore/Events/EventStore.swift +159 -0
  35. package/ios-extension/Sources/BubblCore/Geofence/Geofence.swift +160 -0
  36. package/ios-extension/Sources/BubblCore/Geofence/GeofenceEngine.swift +488 -0
  37. package/ios-extension/Sources/BubblCore/Geofence/GeofenceState.swift +103 -0
  38. package/ios-extension/Sources/BubblCore/Geofence/RegionBudget.swift +62 -0
  39. package/ios-extension/Sources/BubblCore/Notification/BubblNotification.swift +137 -0
  40. package/ios-extension/Sources/BubblCore/Notification/NotificationEvents.swift +160 -0
  41. package/ios-extension/Sources/BubblCore/Notification/Push.swift +134 -0
  42. package/ios-extension/Sources/BubblCore/Notification/SurveyForm.swift +185 -0
  43. package/ios-extension/Sources/BubblCore/RequestSigner.swift +56 -0
  44. package/ios-extension/Sources/BubblCore/Support/AsyncMutex.swift +39 -0
  45. package/ios-extension/Sources/BubblCore/Support/BubblLog.swift +52 -0
  46. package/ios-extension/Sources/BubblCore/Support/JSON.swift +31 -0
  47. package/ios-extension/Sources/BubblCore/Support/JSONValue.swift +94 -0
  48. package/ios-extension/Sources/BubblCore/Support/Locking.swift +11 -0
  49. package/ios-extension/Sources/BubblCore/Support/ValueStore.swift +109 -0
  50. package/ios-extension/Sources/BubblNotificationService/BubblNotificationService.swift +124 -0
  51. package/ios-sdk/BubblCore/API/ApiResponse.swift +90 -0
  52. package/ios-sdk/BubblCore/API/CredentialStore.swift +116 -0
  53. package/ios-sdk/BubblCore/API/DeviceApiClient.swift +239 -0
  54. package/ios-sdk/BubblCore/API/ErrorActions.swift +68 -0
  55. package/ios-sdk/BubblCore/API/Http.swift +39 -0
  56. package/ios-sdk/BubblCore/API/ServerClock.swift +69 -0
  57. package/ios-sdk/BubblCore/BubblVersion.swift +5 -0
  58. package/ios-sdk/BubblCore/Device/ConfigSync.swift +216 -0
  59. package/ios-sdk/BubblCore/Device/DeviceSync.swift +160 -0
  60. package/ios-sdk/BubblCore/Device/ProvisioningProfile.swift +24 -0
  61. package/ios-sdk/BubblCore/Engine/EngineCore.swift +523 -0
  62. package/ios-sdk/BubblCore/Engine/Geofencing.swift +170 -0
  63. package/ios-sdk/BubblCore/Engine/Permissions.swift +90 -0
  64. package/ios-sdk/BubblCore/Engine/Privacy.swift +64 -0
  65. package/ios-sdk/BubblCore/Engine/PrivacyControls.swift +184 -0
  66. package/ios-sdk/BubblCore/Engine/Pushes.swift +61 -0
  67. package/ios-sdk/BubblCore/Engine/Sandbox.swift +149 -0
  68. package/ios-sdk/BubblCore/Events/EventQueue.swift +207 -0
  69. package/ios-sdk/BubblCore/Events/EventStore.swift +159 -0
  70. package/ios-sdk/BubblCore/Geofence/Geofence.swift +160 -0
  71. package/ios-sdk/BubblCore/Geofence/GeofenceEngine.swift +488 -0
  72. package/ios-sdk/BubblCore/Geofence/GeofenceState.swift +103 -0
  73. package/ios-sdk/BubblCore/Geofence/RegionBudget.swift +62 -0
  74. package/ios-sdk/BubblCore/Notification/BubblNotification.swift +137 -0
  75. package/ios-sdk/BubblCore/Notification/NotificationEvents.swift +160 -0
  76. package/ios-sdk/BubblCore/Notification/Push.swift +134 -0
  77. package/ios-sdk/BubblCore/Notification/SurveyForm.swift +185 -0
  78. package/ios-sdk/BubblCore/RequestSigner.swift +56 -0
  79. package/ios-sdk/BubblCore/Support/AsyncMutex.swift +39 -0
  80. package/ios-sdk/BubblCore/Support/BubblLog.swift +52 -0
  81. package/ios-sdk/BubblCore/Support/JSON.swift +31 -0
  82. package/ios-sdk/BubblCore/Support/JSONValue.swift +94 -0
  83. package/ios-sdk/BubblCore/Support/Locking.swift +11 -0
  84. package/ios-sdk/BubblCore/Support/ValueStore.swift +109 -0
  85. package/ios-sdk/BubblLaunch/BubblLaunch.m +45 -0
  86. package/ios-sdk/BubblLaunch/include/BubblLaunch.h +5 -0
  87. package/ios-sdk/BubblSDK/Bubbl.swift +308 -0
  88. package/ios-sdk/BubblSDK/BubblBackend.swift +118 -0
  89. package/ios-sdk/BubblSDK/BubblCredential.swift +30 -0
  90. package/ios-sdk/BubblSDK/BubblMessage.swift +151 -0
  91. package/ios-sdk/BubblSDK/BubblOptions.swift +39 -0
  92. package/ios-sdk/BubblSDK/BubblPermissions.swift +79 -0
  93. package/ios-sdk/BubblSDK/BubblTestDeviceResult.swift +10 -0
  94. package/ios-sdk/BubblSDK/Engine/BackgroundRefresh.swift +92 -0
  95. package/ios-sdk/BubblSDK/Engine/EngineHost+Geofences.swift +177 -0
  96. package/ios-sdk/BubblSDK/Engine/EngineHost+Privacy.swift +65 -0
  97. package/ios-sdk/BubblSDK/Engine/EngineHost+Push.swift +154 -0
  98. package/ios-sdk/BubblSDK/Engine/EngineHost.swift +356 -0
  99. package/ios-sdk/BubblSDK/Engine/SupportedBubbl.swift +320 -0
  100. package/ios-sdk/BubblSDK/Engine/SystemLog.swift +27 -0
  101. package/ios-sdk/BubblSDK/Engine/WorkRunner.swift +107 -0
  102. package/ios-sdk/BubblSDK/Notification/Look.swift +78 -0
  103. package/ios-sdk/BubblSDK/Notification/NotificationMedia.swift +329 -0
  104. package/ios-sdk/BubblSDK/Notification/NotificationModel.swift +172 -0
  105. package/ios-sdk/BubblSDK/Notification/NotificationScreen.swift +428 -0
  106. package/ios-sdk/BubblSDK/Notification/ScreenPresenter.swift +148 -0
  107. package/ios-sdk/BubblSDK/Permissions/PermissionFlow.swift +169 -0
  108. package/ios-sdk/BubblSDK/Permissions/PrivacyView.swift +110 -0
  109. package/ios-sdk/BubblSDK/Platform/AppleDevicePlatform.swift +95 -0
  110. package/ios-sdk/BubblSDK/Platform/KeychainCredentialStore.swift +114 -0
  111. package/ios-sdk/BubblSDK/Platform/LocationService.swift +418 -0
  112. package/ios-sdk/BubblSDK/Platform/PushIntegration.swift +288 -0
  113. package/ios-sdk/BubblSDK/Platform/URLSessionHttpClient.swift +69 -0
  114. package/ios-sdk/BubblSDK/PrivacyInfo.xcprivacy +76 -0
  115. package/jest/index.js +75 -0
  116. package/lib/commonjs/BubblModule.js +14 -0
  117. package/lib/commonjs/BubblModule.js.map +1 -0
  118. package/lib/commonjs/BubblModule.web.js +13 -0
  119. package/lib/commonjs/BubblModule.web.js.map +1 -0
  120. package/lib/commonjs/NativeBubblSdk.js +20 -0
  121. package/lib/commonjs/NativeBubblSdk.js.map +1 -0
  122. package/lib/commonjs/index.js +336 -0
  123. package/lib/commonjs/index.js.map +1 -0
  124. package/lib/commonjs/package.json +1 -0
  125. package/lib/commonjs/types.js +2 -0
  126. package/lib/commonjs/types.js.map +1 -0
  127. package/lib/module/BubblModule.js +5 -0
  128. package/lib/module/BubblModule.js.map +1 -0
  129. package/lib/module/BubblModule.web.js +9 -0
  130. package/lib/module/BubblModule.web.js.map +1 -0
  131. package/lib/module/NativeBubblSdk.js +18 -0
  132. package/lib/module/NativeBubblSdk.js.map +1 -0
  133. package/lib/module/index.js +331 -0
  134. package/lib/module/index.js.map +1 -0
  135. package/lib/module/package.json +1 -0
  136. package/lib/module/types.js +2 -0
  137. package/lib/module/types.js.map +1 -0
  138. package/lib/typescript/commonjs/package.json +1 -0
  139. package/lib/typescript/commonjs/src/BubblModule.d.ts +3 -0
  140. package/lib/typescript/commonjs/src/BubblModule.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/src/BubblModule.web.d.ts +8 -0
  142. package/lib/typescript/commonjs/src/BubblModule.web.d.ts.map +1 -0
  143. package/lib/typescript/commonjs/src/NativeBubblSdk.d.ts +59 -0
  144. package/lib/typescript/commonjs/src/NativeBubblSdk.d.ts.map +1 -0
  145. package/lib/typescript/commonjs/src/index.d.ts +111 -0
  146. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  147. package/lib/typescript/commonjs/src/types.d.ts +192 -0
  148. package/lib/typescript/commonjs/src/types.d.ts.map +1 -0
  149. package/lib/typescript/module/package.json +1 -0
  150. package/lib/typescript/module/src/BubblModule.d.ts +3 -0
  151. package/lib/typescript/module/src/BubblModule.d.ts.map +1 -0
  152. package/lib/typescript/module/src/BubblModule.web.d.ts +8 -0
  153. package/lib/typescript/module/src/BubblModule.web.d.ts.map +1 -0
  154. package/lib/typescript/module/src/NativeBubblSdk.d.ts +59 -0
  155. package/lib/typescript/module/src/NativeBubblSdk.d.ts.map +1 -0
  156. package/lib/typescript/module/src/index.d.ts +111 -0
  157. package/lib/typescript/module/src/index.d.ts.map +1 -0
  158. package/lib/typescript/module/src/types.d.ts +192 -0
  159. package/lib/typescript/module/src/types.d.ts.map +1 -0
  160. package/package.json +105 -24
  161. package/plugin/build/imageNotifications.d.ts +35 -0
  162. package/plugin/build/imageNotifications.js +198 -0
  163. package/plugin/build/index.d.ts +84 -0
  164. package/plugin/build/index.js +176 -0
  165. package/src/BubblModule.ts +2 -0
  166. package/src/BubblModule.web.ts +9 -0
  167. package/src/NativeBubblSdk.ts +67 -0
  168. package/src/index.ts +338 -282
  169. package/src/types.ts +182 -0
  170. package/android/src/main/kotlin/tech/bubbl/reactnative/BubblSdkModule.kt +0 -680
  171. package/android/src/main/kotlin/tech/bubbl/reactnative/BubblSdkNotificationIntents.kt +0 -32
  172. package/android/src/main/kotlin/tech/bubbl/reactnative/BubblSdkPackage.kt +0 -14
  173. package/ios/BubblSdk.swift +0 -802
  174. package/ios/BubblSdkBridge.m +0 -86
  175. package/react-native.config.js +0 -11
  176. package/src/specs/NativeBubblSdk.ts +0 -54
@@ -0,0 +1,336 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.Bubbl = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _BubblModule = _interopRequireDefault(require("./BubblModule"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ /** The one native event every event, and every notification for the app's listener, arrives on. */
11
+ const NATIVE_EVENT = 'BubblSdkEvent';
12
+ const PACKAGE = '@bubblsdk/react-native-sdk';
13
+ const JEST_MOCK = `jest.mock('${PACKAGE}', () => require('${PACKAGE}/jest'))`;
14
+ /** Why there's no native module, as specifically as can be told from here. */
15
+ function missingReason() {
16
+ const globals = globalThis;
17
+ if (_reactNative.Platform.OS === 'web') {
18
+ return `${PACKAGE}: Bubbl is for Android and iOS; on the web its calls do nothing.`;
19
+ }
20
+ if (globals.process?.env?.JEST_WORKER_ID != null) {
21
+ return `${PACKAGE}: there's no native module in Jest, so Bubbl's calls do nothing. Mock it: ${JEST_MOCK}.`;
22
+ }
23
+ if (globals.__turboModuleProxy == null && globals.RN$Bridgeless !== true) {
24
+ return `${PACKAGE}: Bubbl needs React Native's New Architecture, and this app runs the old one, so ` + "Bubbl's calls do nothing. Turn it on (newArchEnabled=true in android/gradle.properties, " + 'RCT_NEW_ARCH_ENABLED=1 for pod install, or newArchEnabled in the Expo config) and rebuild.';
25
+ }
26
+ return `${PACKAGE}: the native module isn't in this build, so Bubbl's calls do nothing. Rebuild the app ` + "after installing (npx expo prebuild, or pod install / a Gradle sync); Expo Go can't load it.";
27
+ }
28
+ let reportedMissing = false;
29
+
30
+ /**
31
+ * The native module, or null where there isn't one (web, Expo Go, Jest, a build from before the
32
+ * install), said once in the console. Bubbl never stops the app, so without it calls do nothing.
33
+ */
34
+ function native() {
35
+ if (!_BubblModule.default && !reportedMissing) {
36
+ reportedMissing = true;
37
+ (_reactNative.Platform.OS === 'web' ? console.warn : console.error)(missingReason());
38
+ }
39
+ return _BubblModule.default ?? null;
40
+ }
41
+ const eventListeners = new Set();
42
+ let notificationListener = null;
43
+ let nativeSubscription = null;
44
+
45
+ /**
46
+ * Listens to the native event once anything wants it: events go to every event listener, and
47
+ * "notification.handle" (a notification the native side held back for the app's listener, only
48
+ * ever while the app is in the foreground) goes to the notification listener.
49
+ */
50
+ function listenToNative() {
51
+ if (nativeSubscription || !_BubblModule.default) {
52
+ return;
53
+ }
54
+ nativeSubscription = new _reactNative.NativeEventEmitter(_BubblModule.default).addListener(NATIVE_EVENT, json => {
55
+ let payload;
56
+ try {
57
+ payload = JSON.parse(String(json));
58
+ } catch {
59
+ return;
60
+ }
61
+ if (payload.type === 'notification.handle') {
62
+ void handleNotification(String(payload.token), payload.message);
63
+ return;
64
+ }
65
+ const event = payload;
66
+ eventListeners.forEach(listener => {
67
+ try {
68
+ listener(event);
69
+ } catch (error) {
70
+ console.error('Bubbl: an event listener threw', error);
71
+ }
72
+ });
73
+ });
74
+ }
75
+ function stopListeningIfIdle() {
76
+ if (eventListeners.size === 0 && !notificationListener) {
77
+ nativeSubscription?.remove();
78
+ nativeSubscription = null;
79
+ }
80
+ }
81
+
82
+ /**
83
+ * The app's listener decides; anything but true (false, a throw, no listener any more) is Bubbl's
84
+ * to show. Claimed first, so native knows JS has it; finished after, so native shows it unless the
85
+ * app does. If JS goes away in between (a reload), native shows it: it's never lost.
86
+ */
87
+ async function handleNotification(token, message) {
88
+ native()?.claimNotification(token);
89
+ let showsItself = false;
90
+ try {
91
+ showsItself = notificationListener ? (await notificationListener(message)) === true : false;
92
+ } catch (error) {
93
+ console.error('Bubbl: the notification listener threw; Bubbl shows the notification', error);
94
+ }
95
+ native()?.finishNotification(token, showsItself);
96
+ }
97
+
98
+ /** Diagnostics where there's no native module: nothing runs, and lastError says why. */
99
+ function unavailableDiagnostics() {
100
+ return {
101
+ started: false,
102
+ sdkVersion: '',
103
+ supported: false,
104
+ sdkSupported: true,
105
+ registered: false,
106
+ installId: null,
107
+ active: false,
108
+ pausedUntil: null,
109
+ consentRequired: false,
110
+ consent: null,
111
+ locationEnabled: false,
112
+ permissions: null,
113
+ hasPushToken: false,
114
+ geofences: 0,
115
+ queuedEvents: 0,
116
+ lastError: missingReason(),
117
+ credentialRejected: false,
118
+ environment: null,
119
+ testDevice: null,
120
+ backgroundLocation: false,
121
+ transitionsDroppedWhileLocked: 0,
122
+ backgroundRestricted: null,
123
+ batteryOptimized: null,
124
+ backgroundRefreshAvailable: null,
125
+ lowPowerMode: null,
126
+ osWatchesGeofences: null
127
+ };
128
+ }
129
+ function parse(json) {
130
+ return json == null ? null : JSON.parse(json);
131
+ }
132
+
133
+ /**
134
+ * Bubbl for a React Native app: the same functions as the native SDKs (docs/PUBLIC_API.md).
135
+ * Install the package, then call start once, early, e.g. at the top of index.js:
136
+ *
137
+ * Bubbl.start('pk_live_…', { baseUrl: 'https://…' });
138
+ *
139
+ * Bubbl never stops the app: a mistake (an empty key, an http:// URL) is logged natively, not
140
+ * thrown, calls before start do nothing, and so do calls where there's no native module (web,
141
+ * Expo Go, Jest), said once in the console. Geofences and pushes keep working with the app
142
+ * closed: the native SDK starts itself from its saved settings when the OS wakes the app.
143
+ */
144
+ const Bubbl = exports.Bubbl = {
145
+ /**
146
+ * Whether Bubbl works on this device: iOS 17 and later, Android 8.1 (API 27) and later. The
147
+ * package installs on older versions too, and there every call does nothing (permissions give
148
+ * null, the listener is never asked, diagnostics say supported: false). False where there's no
149
+ * native module.
150
+ */
151
+ get isSupported() {
152
+ return native()?.isSupported() ?? false;
153
+ },
154
+ /** Start Bubbl. Calling again with the same key and options changes nothing. */
155
+ start(apiKey, options) {
156
+ native()?.start(apiKey, JSON.stringify(options));
157
+ },
158
+ /**
159
+ * Start with a device credential issued outside the app (installs provisioned ahead of time, an
160
+ * app's own pairing flow) instead of an API key: the device never registers itself. As start
161
+ * otherwise, at every launch. A different credential than last time starts afresh as a new
162
+ * device; if the server refuses it, Bubbl stops ('credential.rejected', diagnostics) until it's
163
+ * started with a new one. An incomplete credential is logged natively (without the secret).
164
+ */
165
+ startWithCredential(credential, options) {
166
+ // The secret goes to the native SDK and nowhere else: not into JSON, not into a log.
167
+ native()?.startWithCredential(credential.keyId, credential.secret, credential.installId, JSON.stringify(options));
168
+ },
169
+ /** Stop on this device until start is called again; the server isn't told, nothing is dropped. */
170
+ stop() {
171
+ native()?.stop();
172
+ },
173
+ /** For requireConsent: true starts everything, false is optOut. */
174
+ setConsent(granted) {
175
+ native()?.setConsent(granted);
176
+ },
177
+ /** Stop for this user; the server is told. */
178
+ optOut() {
179
+ native()?.optOut();
180
+ },
181
+ /** Erase the device on the server and here; Bubbl stays off afterwards. */
182
+ deleteMyData() {
183
+ native()?.deleteMyData();
184
+ },
185
+ /** Location (geofences) off or on; the rest carries on. */
186
+ setLocationEnabled(enabled) {
187
+ native()?.setLocationEnabled(enabled);
188
+ },
189
+ /**
190
+ * The permissions Bubbl uses. Asking shows the privacy view first when the dashboard says so,
191
+ * then the system prompt.
192
+ */
193
+ permissions: {
194
+ /** Where the device stands; null before start. */
195
+ async status() {
196
+ return parse((await native()?.permissionStatus()) ?? null);
197
+ },
198
+ async requestNotifications() {
199
+ return parse((await native()?.requestNotifications()) ?? null);
200
+ },
201
+ /** While the app is in use, or always (geofences with the app closed): a second step. */
202
+ async requestLocation(options = {}) {
203
+ return parse((await native()?.requestLocation(options.always === true)) ?? null);
204
+ },
205
+ /** The app's page in system settings, for a permission refused for good. */
206
+ openSettings() {
207
+ native()?.openSettings();
208
+ }
209
+ },
210
+ /** The device's segments (replaces any set before). */
211
+ setSegments(segments) {
212
+ native()?.setSegments(segments);
213
+ },
214
+ /**
215
+ * A custom event: a name of letters, digits and . _ : - (at most 100), with up to 50 flat
216
+ * properties (text, numbers, true/false, null).
217
+ */
218
+ track(name, properties = {}) {
219
+ native()?.track(name, JSON.stringify(properties));
220
+ },
221
+ /** BubblEvents as they happen. */
222
+ addEventListener(listener) {
223
+ eventListeners.add(listener);
224
+ listenToNative();
225
+ return {
226
+ remove: () => {
227
+ eventListeners.delete(listener);
228
+ stopListeningIfIdle();
229
+ }
230
+ };
231
+ },
232
+ /**
233
+ * The app's say before Bubbl shows a notification while the app is open: return true to show it
234
+ * yourself (then report what happens with the report functions), false to let Bubbl. With the
235
+ * app in the background it isn't asked: Bubbl posts its system notification, whose tap opens
236
+ * Bubbl's card. Null goes back to Bubbl showing everything.
237
+ */
238
+ setNotificationListener(listener) {
239
+ notificationListener = listener;
240
+ if (listener) {
241
+ listenToNative();
242
+ }
243
+ native()?.setNotificationListenerEnabled(listener != null);
244
+ stopListeningIfIdle();
245
+ },
246
+ /** Show a message in Bubbl's notification screen (e.g. one kept from before). */
247
+ present(message) {
248
+ native()?.present(message.json);
249
+ },
250
+ /** For an app drawing notifications itself: it's on screen. */
251
+ reportDisplayed(message) {
252
+ native()?.reportDisplayed(message.json);
253
+ },
254
+ /** …the user opened it. */
255
+ reportOpened(message) {
256
+ native()?.reportOpened(message.json);
257
+ },
258
+ /** …the user tapped its call to action. */
259
+ reportCtaClicked(message) {
260
+ native()?.reportCtaClicked(message.json);
261
+ },
262
+ /** …the user closed it without acting. */
263
+ reportDismissed(message) {
264
+ native()?.reportDismissed(message.json);
265
+ },
266
+ /** …its media was shown or started playing. */
267
+ reportMediaViewed(message) {
268
+ native()?.reportMediaViewed(message.json);
269
+ },
270
+ /** …its video or audio played to the end, durationSeconds long. */
271
+ reportMediaCompleted(message, durationSeconds) {
272
+ native()?.reportMediaCompleted(message.json, durationSeconds);
273
+ },
274
+ /** …the user started answering its survey. */
275
+ reportSurveyStarted(message) {
276
+ native()?.reportSurveyStarted(message.json);
277
+ },
278
+ /**
279
+ * Send the answers to a survey the app showed itself, checked as the server checks them: false
280
+ * (with the reason logged natively) when they can't be sent.
281
+ */
282
+ async submitSurvey(message, answers) {
283
+ return (await native()?.submitSurvey(message.json, JSON.stringify(answers))) ?? false;
284
+ },
285
+ /** Open the message's call to action as Bubbl would, and report it. */
286
+ openCta(message) {
287
+ native()?.openCta(message.json);
288
+ },
289
+ /** Whether a push's data is Bubbl's, so the app's own push handling can skip it. */
290
+ isBubblMessage(data) {
291
+ return data?.bubbl === '1';
292
+ },
293
+ /**
294
+ * Sandbox: approve this device as a test device with the code the dashboard shows, so it gets
295
+ * the Sandbox's notifications. Never throws: not approved comes with the reason as message
296
+ * (a wrong or expired code, no network, before start, an unsupported device).
297
+ */
298
+ async registerTestDevice(code) {
299
+ const module = native();
300
+ if (!module) {
301
+ return {
302
+ approved: false,
303
+ message: missingReason()
304
+ };
305
+ }
306
+ const result = JSON.parse(await module.registerTestDevice(code));
307
+ return result.message ? {
308
+ approved: result.approved,
309
+ message: result.message
310
+ } : {
311
+ approved: result.approved
312
+ };
313
+ },
314
+ /**
315
+ * Where Bubbl stands on this device. Where there's no native module (see above) it still
316
+ * resolves, like every other call: not started, with the reason as lastError.
317
+ */
318
+ async diagnostics() {
319
+ const module = native();
320
+ if (!module) {
321
+ return unavailableDiagnostics();
322
+ }
323
+ const diagnostics = JSON.parse(await module.diagnostics());
324
+ // The code only while there is one (native sends null).
325
+ const device = diagnostics.testDevice;
326
+ diagnostics.testDevice = device && (device.code ? {
327
+ status: device.status,
328
+ code: device.code
329
+ } : {
330
+ status: device.status
331
+ });
332
+ return diagnostics;
333
+ }
334
+ };
335
+ var _default = exports.default = Bubbl;
336
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_BubblModule","_interopRequireDefault","e","__esModule","default","NATIVE_EVENT","PACKAGE","JEST_MOCK","missingReason","globals","globalThis","Platform","OS","process","env","JEST_WORKER_ID","__turboModuleProxy","RN$Bridgeless","reportedMissing","native","NativeBubblSdk","console","warn","error","eventListeners","Set","notificationListener","nativeSubscription","listenToNative","NativeEventEmitter","addListener","json","payload","JSON","parse","String","type","handleNotification","token","message","event","forEach","listener","stopListeningIfIdle","size","remove","claimNotification","showsItself","finishNotification","unavailableDiagnostics","started","sdkVersion","supported","sdkSupported","registered","installId","active","pausedUntil","consentRequired","consent","locationEnabled","permissions","hasPushToken","geofences","queuedEvents","lastError","credentialRejected","environment","testDevice","backgroundLocation","transitionsDroppedWhileLocked","backgroundRestricted","batteryOptimized","backgroundRefreshAvailable","lowPowerMode","osWatchesGeofences","Bubbl","exports","isSupported","start","apiKey","options","stringify","startWithCredential","credential","keyId","secret","stop","setConsent","granted","optOut","deleteMyData","setLocationEnabled","enabled","status","permissionStatus","requestNotifications","requestLocation","always","openSettings","setSegments","segments","track","name","properties","addEventListener","add","delete","setNotificationListener","setNotificationListenerEnabled","present","reportDisplayed","reportOpened","reportCtaClicked","reportDismissed","reportMediaViewed","reportMediaCompleted","durationSeconds","reportSurveyStarted","submitSurvey","answers","openCta","isBubblMessage","data","bubbl","registerTestDevice","code","module","approved","result","diagnostics","device","_default"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AAA2C,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAkB3C;AACA,MAAMG,YAAY,GAAG,eAAe;AAEpC,MAAMC,OAAO,GAAG,4BAA4B;AAC5C,MAAMC,SAAS,GAAG,cAAcD,OAAO,qBAAqBA,OAAO,UAAU;AAQ7E;AACA,SAASE,aAAaA,CAAA,EAAW;EAC/B,MAAMC,OAAO,GAAGC,UAAqB;EACrC,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACzB,OAAO,GAAGN,OAAO,kEAAkE;EACrF;EACA,IAAIG,OAAO,CAACI,OAAO,EAAEC,GAAG,EAAEC,cAAc,IAAI,IAAI,EAAE;IAChD,OAAO,GAAGT,OAAO,6EAA6EC,SAAS,GAAG;EAC5G;EACA,IAAIE,OAAO,CAACO,kBAAkB,IAAI,IAAI,IAAIP,OAAO,CAACQ,aAAa,KAAK,IAAI,EAAE;IACxE,OACE,GAAGX,OAAO,mFAAmF,GAC7F,0FAA0F,GAC1F,4FAA4F;EAEhG;EACA,OACE,GAAGA,OAAO,wFAAwF,GAClG,8FAA8F;AAElG;AACA,IAAIY,eAAe,GAAG,KAAK;;AAE3B;AACA;AACA;AACA;AACA,SAASC,MAAMA,CAAA,EAAgB;EAC7B,IAAI,C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AAG;MAAEyF,QAAQ,EAAEC,MAAM,CAACD;IAAS,CAAC;EAChH,CAAC;EAED;AACF;AACA;AACA;EACE,MAAME,WAAWA,CAAA,EAA8B;IAC7C,MAAMH,MAAM,GAAG5G,MAAM,CAAC,CAAC;IACvB,IAAI,CAAC4G,MAAM,EAAE;MACX,OAAO9E,sBAAsB,CAAC,CAAC;IACjC;IACA,MAAMiF,WAAW,GAAGjG,IAAI,CAACC,KAAK,CAAC,MAAM6F,MAAM,CAACG,WAAW,CAAC,CAAC,CAExD;IACD;IACA,MAAMC,MAAM,GAAGD,WAAW,CAAC9D,UAAU;IACrC8D,WAAW,CAAC9D,UAAU,GAAG+D,MAAM,KAAKA,MAAM,CAACL,IAAI,GAAG;MAAEhC,MAAM,EAAEqC,MAAM,CAACrC,MAAM;MAAEgC,IAAI,EAAEK,MAAM,CAACL;IAAK,CAAC,GAAG;MAAEhC,MAAM,EAAEqC,MAAM,CAACrC;IAAO,CAAC,CAAC;IAC3H,OAAOoC,WAAW;EACpB;AACF,CAAC;AAAC,IAAAE,QAAA,GAAAvD,OAAA,CAAAzE,OAAA,GAEawE,KAAK","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ /** The native module, or null where it isn't in the build. On the web, BubblModule.web.ts. */
4
+ export { default } from "./NativeBubblSdk.js";
5
+ //# sourceMappingURL=BubblModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["default"],"sourceRoot":"../../src","sources":["BubblModule.ts"],"mappings":";;AAAA;AACA,SAASA,OAAO,QAAQ,qBAAkB","ignoreList":[]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * No native module on the web, and react-native-web has no TurboModuleRegistry to ask for one, so
5
+ * NativeBubblSdk.ts isn't loaded at all: Bubbl's calls do nothing there.
6
+ */
7
+ const BubblModule = null;
8
+ export default BubblModule;
9
+ //# sourceMappingURL=BubblModule.web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BubblModule"],"sourceRoot":"../../src","sources":["BubblModule.web.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA,MAAMA,WAAwB,GAAG,IAAI;AAErC,eAAeA,WAAW","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ import { TurboModuleRegistry } from 'react-native';
4
+
5
+ /**
6
+ * The native module under the facade (src/index.ts): the Bubbl SDK on each platform, called with
7
+ * JSON strings rather than mapped objects (the same convention as the Flutter wrapper), so the
8
+ * bridge stays small and the native types stay the source of truth.
9
+ *
10
+ * - Messages cross as their contract Notification JSON (BubblMessage.json) going in, and as the
11
+ * public message object (fields worked out natively, plus json) coming out.
12
+ * - Events and notifications for the app's listener arrive as JSON on one event, "BubblSdkEvent".
13
+ *
14
+ * Codegen reads this file (package.json codegenConfig); keep it to the types codegen knows.
15
+ */
16
+
17
+ export default TurboModuleRegistry.get('BubblSdk');
18
+ //# sourceMappingURL=NativeBubblSdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","get"],"sourceRoot":"../../src","sources":["NativeBubblSdk.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAqDA,eAAeA,mBAAmB,CAACC,GAAG,CAAO,UAAU,CAAC","ignoreList":[]}