@attentive-mobile/attentive-react-native-sdk 2.0.0-beta.6 → 2.0.0-beta.8
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/README.md +165 -108
- package/android/build.gradle +1 -1
- package/android/src/main/kotlin/com/attentivereactnativesdk/AttentiveReactNativeSdkModule.kt +209 -21
- package/attentive-react-native-sdk.podspec +1 -1
- package/ios/Bridging/ATTNNativeSDK.swift +112 -49
- package/ios/Bridging/AttentiveSDKManager.swift +196 -27
- package/ios/Podfile +1 -1
- package/lib/commonjs/index.js +14 -16
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/index.js +14 -16
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/index.d.ts +14 -16
- package/lib/typescript/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.tsx +18 -17
- package/ios/AttentiveReactNativeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/AttentiveReactNativeSdk.xcodeproj/project.xcworkspace/xcuserdata/zheref.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/AttentiveReactNativeSdk.xcodeproj/xcuserdata/zheref.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
//
|
|
8
8
|
|
|
9
9
|
import Foundation
|
|
10
|
+
import UIKit
|
|
10
11
|
import UserNotifications
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -14,21 +15,21 @@ import UserNotifications
|
|
|
14
15
|
* This allows AppDelegate and other native code to access the SDK instance
|
|
15
16
|
* that was initialized from React Native.
|
|
16
17
|
*
|
|
17
|
-
*
|
|
18
|
+
* ## Minimal Integration (recommended)
|
|
19
|
+
*
|
|
20
|
+
* In your AppDelegate's `userNotificationCenter(_:didReceive:withCompletionHandler:)`,
|
|
21
|
+
* add **one line** to enable push-open and foreground-push tracking:
|
|
22
|
+
*
|
|
18
23
|
* ```swift
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* @unknown default:
|
|
29
|
-
* AttentiveSDKManager.shared.handlePushOpen(response: response, authorizationStatus: authStatus)
|
|
30
|
-
* }
|
|
31
|
-
* }
|
|
24
|
+
* func userNotificationCenter(_ center: UNUserNotificationCenter,
|
|
25
|
+
* didReceive response: UNNotificationResponse,
|
|
26
|
+
* withCompletionHandler completionHandler: @escaping () -> Void) {
|
|
27
|
+
* // Track push interaction with Attentive (handles app-state detection + auth status internally)
|
|
28
|
+
* AttentiveSDKManager.shared.handleNotificationResponse(response)
|
|
29
|
+
*
|
|
30
|
+
* // Forward to your push library (e.g. RNCPushNotificationIOS) for JS-side handling
|
|
31
|
+
* RNCPushNotificationIOS.didReceive(response)
|
|
32
|
+
* completionHandler()
|
|
32
33
|
* }
|
|
33
34
|
* ```
|
|
34
35
|
*/
|
|
@@ -36,10 +37,40 @@ import UserNotifications
|
|
|
36
37
|
/// Shared singleton instance
|
|
37
38
|
@objc public static let shared: AttentiveSDKManager = AttentiveSDKManager()
|
|
38
39
|
|
|
39
|
-
/// The Attentive SDK instance as AnyObject for Objective-C compatibility
|
|
40
|
-
///
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
/// The Attentive SDK instance as AnyObject for Objective-C compatibility.
|
|
41
|
+
/// When set, any pending (untracked) notification response is automatically flushed.
|
|
42
|
+
@objc public var sdk: AnyObject? {
|
|
43
|
+
didSet {
|
|
44
|
+
if sdk != nil {
|
|
45
|
+
flushPendingResponseIfNeeded()
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// MARK: - Notification Response Cache
|
|
51
|
+
|
|
52
|
+
/// The most recent UNNotificationResponse, cached so the RN bridge can use it
|
|
53
|
+
/// when JS calls handlePushOpen / handleForegroundPush.
|
|
54
|
+
///
|
|
55
|
+
/// **Known limitation:** This is a single-slot cache. If two notifications
|
|
56
|
+
/// arrive in rapid succession (e.g. a tap followed immediately by a
|
|
57
|
+
/// foreground delivery), the second call to `handleNotificationResponse`
|
|
58
|
+
/// overwrites the first before its async tracking completes. In practice
|
|
59
|
+
/// this is extremely rare because `didReceive` is serialized by the system.
|
|
60
|
+
private var pendingResponse: UNNotificationResponse?
|
|
61
|
+
|
|
62
|
+
/// Whether the pending response has already been tracked via `handleNotificationResponse`.
|
|
63
|
+
/// Prevents double-tracking when both the native convenience method and the JS bridge fire.
|
|
64
|
+
private var pendingResponseTracked: Bool = false
|
|
65
|
+
|
|
66
|
+
/// The app state captured at the moment `handleNotificationResponse` was called.
|
|
67
|
+
/// Stored so that cold-launch replays use the original state (typically `.inactive`
|
|
68
|
+
/// or `.background`) rather than `.active` which is what the app will be in by the
|
|
69
|
+
/// time the SDK finishes initializing.
|
|
70
|
+
private var pendingAppState: UIApplication.State = .inactive
|
|
71
|
+
|
|
72
|
+
/// Serialises access to the cache fields above.
|
|
73
|
+
private let responseLock = NSLock()
|
|
43
74
|
|
|
44
75
|
private override init() {
|
|
45
76
|
super.init()
|
|
@@ -55,29 +86,167 @@ import UserNotifications
|
|
|
55
86
|
sdk = nativeSDK
|
|
56
87
|
}
|
|
57
88
|
|
|
58
|
-
// MARK: - Push Notification
|
|
89
|
+
// MARK: - Push Notification Convenience Method
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Handle a push notification response in one call.
|
|
93
|
+
*
|
|
94
|
+
* This is the **recommended** way to track push interactions on iOS.
|
|
95
|
+
* It automatically determines the app state, fetches the current
|
|
96
|
+
* authorization status, and calls the appropriate native SDK method
|
|
97
|
+
* (`handlePushOpen` or `handleForegroundPush`).
|
|
98
|
+
*
|
|
99
|
+
* Call this from your AppDelegate's
|
|
100
|
+
* `userNotificationCenter(_:didReceive:withCompletionHandler:)`.
|
|
101
|
+
*
|
|
102
|
+
* The response is also cached so that if the JS layer later calls
|
|
103
|
+
* `handlePushOpen()` or `handleForegroundPush()` via the RN bridge,
|
|
104
|
+
* the bridge can fulfil the call using the real `UNNotificationResponse`
|
|
105
|
+
* without double-tracking.
|
|
106
|
+
*
|
|
107
|
+
* **Cold-launch safety:** If the SDK has not yet been initialized (e.g. the
|
|
108
|
+
* app was launched from a killed state via a push tap), the response is
|
|
109
|
+
* cached and will be automatically tracked once `sdk` is set during RN
|
|
110
|
+
* bridge initialization.
|
|
111
|
+
*
|
|
112
|
+
* @param response The `UNNotificationResponse` from the notification center delegate.
|
|
113
|
+
*/
|
|
114
|
+
@objc public func handleNotificationResponse(_ response: UNNotificationResponse) {
|
|
115
|
+
// UIApplication.shared.applicationState is a UIKit property that must
|
|
116
|
+
// be read on the main thread. userNotificationCenter(_:didReceive:) is
|
|
117
|
+
// almost always delivered on main, but we guard defensively.
|
|
118
|
+
let cacheAndTrack = { [self] (appState: UIApplication.State) in
|
|
119
|
+
// Cache the response for the RN bridge (consumed by handlePushOpenFromRN /
|
|
120
|
+
// handleForegroundPushFromRN).
|
|
121
|
+
responseLock.lock()
|
|
122
|
+
pendingResponse = response
|
|
123
|
+
pendingResponseTracked = false
|
|
124
|
+
pendingAppState = appState
|
|
125
|
+
responseLock.unlock()
|
|
126
|
+
|
|
127
|
+
trackResponse(response, appState: appState)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if Thread.isMainThread {
|
|
131
|
+
cacheAndTrack(UIApplication.shared.applicationState)
|
|
132
|
+
} else {
|
|
133
|
+
DispatchQueue.main.async {
|
|
134
|
+
cacheAndTrack(UIApplication.shared.applicationState)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// MARK: - Push Notification Handlers (legacy — prefer handleNotificationResponse)
|
|
59
140
|
|
|
60
141
|
/**
|
|
61
142
|
* Handle a push notification when the app is in the foreground (active state).
|
|
62
|
-
* Call this from AppDelegate's userNotificationCenter(_:didReceive:withCompletionHandler:)
|
|
63
|
-
* when UIApplication.shared.applicationState == .active
|
|
64
143
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
144
|
+
* - Important: Deprecated — use ``handleNotificationResponse(_:)`` instead,
|
|
145
|
+
* which handles app-state detection and auth-status lookup automatically.
|
|
146
|
+
* Do **not** call both methods for the same notification.
|
|
67
147
|
*/
|
|
148
|
+
@available(*, deprecated, message: "Use handleNotificationResponse(_:) instead")
|
|
68
149
|
@objc public func handleForegroundPush(response: UNNotificationResponse, authorizationStatus: UNAuthorizationStatus) {
|
|
69
150
|
nativeSDK?.handleForegroundPush(response: response, authorizationStatus: authorizationStatus)
|
|
70
151
|
}
|
|
71
152
|
|
|
72
153
|
/**
|
|
73
154
|
* Handle when a push notification is opened by the user (app in background/inactive state).
|
|
74
|
-
* Call this from AppDelegate's userNotificationCenter(_:didReceive:withCompletionHandler:)
|
|
75
|
-
* when UIApplication.shared.applicationState == .background or .inactive
|
|
76
155
|
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
156
|
+
* - Important: Deprecated — use ``handleNotificationResponse(_:)`` instead,
|
|
157
|
+
* which handles app-state detection and auth-status lookup automatically.
|
|
158
|
+
* Do **not** call both methods for the same notification.
|
|
79
159
|
*/
|
|
160
|
+
@available(*, deprecated, message: "Use handleNotificationResponse(_:) instead")
|
|
80
161
|
@objc public func handlePushOpen(response: UNNotificationResponse, authorizationStatus: UNAuthorizationStatus) {
|
|
81
162
|
nativeSDK?.handlePushOpen(response: response, authorizationStatus: authorizationStatus)
|
|
82
163
|
}
|
|
164
|
+
|
|
165
|
+
// MARK: - Response Cache (internal, used by RN bridge)
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Consume the cached notification response.
|
|
169
|
+
*
|
|
170
|
+
* Returns the cached `UNNotificationResponse` and whether it was already
|
|
171
|
+
* tracked by `handleNotificationResponse`. The bridge uses this to decide
|
|
172
|
+
* whether to call the native SDK again.
|
|
173
|
+
*
|
|
174
|
+
* After this call the cache is cleared.
|
|
175
|
+
*/
|
|
176
|
+
func consumePendingResponse() -> (response: UNNotificationResponse, alreadyTracked: Bool)? {
|
|
177
|
+
responseLock.lock()
|
|
178
|
+
defer { responseLock.unlock() }
|
|
179
|
+
|
|
180
|
+
guard let response = pendingResponse else { return nil }
|
|
181
|
+
let tracked = pendingResponseTracked
|
|
182
|
+
pendingResponse = nil
|
|
183
|
+
pendingResponseTracked = false
|
|
184
|
+
return (response, tracked)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// MARK: - Private
|
|
188
|
+
|
|
189
|
+
/// Attempt to track a cached response via the native SDK.
|
|
190
|
+
/// If nativeSDK is nil (cold launch), returns without marking tracked;
|
|
191
|
+
/// the `sdk` didSet will call `flushPendingResponseIfNeeded` later.
|
|
192
|
+
///
|
|
193
|
+
/// Uses the supplied `appState` (captured at `handleNotificationResponse` time)
|
|
194
|
+
/// rather than the current app state, so cold-launch replays classify the
|
|
195
|
+
/// event correctly.
|
|
196
|
+
private func trackResponse(_ response: UNNotificationResponse, appState: UIApplication.State) {
|
|
197
|
+
UNUserNotificationCenter.current().getNotificationSettings { [weak self] settings in
|
|
198
|
+
guard let self = self else { return }
|
|
199
|
+
let authStatus = settings.authorizationStatus
|
|
200
|
+
DispatchQueue.main.async {
|
|
201
|
+
// Check that this response is still pending and untracked, then
|
|
202
|
+
// mark tracked optimistically *before* releasing the lock. This
|
|
203
|
+
// closes the window where consumePendingResponse() could run on
|
|
204
|
+
// another thread, see alreadyTracked: false, and also call the
|
|
205
|
+
// native SDK — resulting in double-tracking.
|
|
206
|
+
self.responseLock.lock()
|
|
207
|
+
guard self.pendingResponse === response, !self.pendingResponseTracked else {
|
|
208
|
+
self.responseLock.unlock()
|
|
209
|
+
return
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
guard self.nativeSDK != nil else {
|
|
213
|
+
// SDK not yet initialized (cold launch). Leave
|
|
214
|
+
// pendingResponseTracked = false so the didSet observer
|
|
215
|
+
// on `sdk` can flush later.
|
|
216
|
+
self.responseLock.unlock()
|
|
217
|
+
return
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// Mark tracked while still holding the lock, before the SDK call.
|
|
221
|
+
self.pendingResponseTracked = true
|
|
222
|
+
self.responseLock.unlock()
|
|
223
|
+
|
|
224
|
+
// Safe to call outside the lock — we've already claimed ownership.
|
|
225
|
+
switch appState {
|
|
226
|
+
case .active:
|
|
227
|
+
self.nativeSDK?.handleForegroundPush(response: response, authorizationStatus: authStatus)
|
|
228
|
+
case .background, .inactive:
|
|
229
|
+
self.nativeSDK?.handlePushOpen(response: response, authorizationStatus: authStatus)
|
|
230
|
+
@unknown default:
|
|
231
|
+
self.nativeSDK?.handlePushOpen(response: response, authorizationStatus: authStatus)
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/// Called from `sdk` didSet when the SDK becomes available.
|
|
238
|
+
/// If there is a pending untracked response (cold-launch scenario),
|
|
239
|
+
/// track it now using the app state captured at the original
|
|
240
|
+
/// `handleNotificationResponse` call.
|
|
241
|
+
private func flushPendingResponseIfNeeded() {
|
|
242
|
+
responseLock.lock()
|
|
243
|
+
guard let response = pendingResponse, !pendingResponseTracked else {
|
|
244
|
+
responseLock.unlock()
|
|
245
|
+
return
|
|
246
|
+
}
|
|
247
|
+
let appState = pendingAppState
|
|
248
|
+
responseLock.unlock()
|
|
249
|
+
|
|
250
|
+
trackResponse(response, appState: appState)
|
|
251
|
+
}
|
|
83
252
|
}
|
package/ios/Podfile
CHANGED
package/lib/commonjs/index.js
CHANGED
|
@@ -338,17 +338,16 @@ function handleForegroundNotification(userInfo) {
|
|
|
338
338
|
|
|
339
339
|
/**
|
|
340
340
|
* Handle a push notification when the app is in the foreground (active state).
|
|
341
|
-
* This is the React Native equivalent of the native iOS handleForegroundPush method.
|
|
342
341
|
*
|
|
343
342
|
* Call this when you receive a notification response and the app state is 'active'.
|
|
344
|
-
* This is part of implementing the native iOS pattern:
|
|
345
|
-
* ```swift
|
|
346
|
-
* case .active:
|
|
347
|
-
* self.attentiveSdk?.handleForegroundPush(response: response, authorizationStatus: authStatus)
|
|
348
|
-
* ```
|
|
349
343
|
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
344
|
+
* **iOS prerequisite:** Your AppDelegate's
|
|
345
|
+
* `userNotificationCenter(_:didReceive:withCompletionHandler:)` must call
|
|
346
|
+
* `AttentiveSDKManager.shared.handleNotificationResponse(response)` so that
|
|
347
|
+
* the SDK can cache the `UNNotificationResponse` required by the native iOS SDK.
|
|
348
|
+
* Without that one line of native code, this function cannot track the event.
|
|
349
|
+
*
|
|
350
|
+
* On Android, this tracks the foreground push as a custom event.
|
|
352
351
|
*
|
|
353
352
|
* @param userInfo - The notification payload from the push notification
|
|
354
353
|
* @param authorizationStatus - Current push authorization status
|
|
@@ -371,17 +370,16 @@ function handleForegroundPush(userInfo, authorizationStatus) {
|
|
|
371
370
|
|
|
372
371
|
/**
|
|
373
372
|
* Handle when a push notification is opened by the user (app in background/inactive state).
|
|
374
|
-
* This is the React Native equivalent of the native iOS handlePushOpen method.
|
|
375
373
|
*
|
|
376
374
|
* Call this when you receive a notification response and the app state is 'background' or 'inactive'.
|
|
377
|
-
* This is part of implementing the native iOS pattern:
|
|
378
|
-
* ```swift
|
|
379
|
-
* case .background, .inactive:
|
|
380
|
-
* self.attentiveSdk?.handlePushOpen(response: response, authorizationStatus: authStatus)
|
|
381
|
-
* ```
|
|
382
375
|
*
|
|
383
|
-
*
|
|
384
|
-
*
|
|
376
|
+
* **iOS prerequisite:** Your AppDelegate's
|
|
377
|
+
* `userNotificationCenter(_:didReceive:withCompletionHandler:)` must call
|
|
378
|
+
* `AttentiveSDKManager.shared.handleNotificationResponse(response)` so that
|
|
379
|
+
* the SDK can cache the `UNNotificationResponse` required by the native iOS SDK.
|
|
380
|
+
* Without that one line of native code, this function cannot track the event.
|
|
381
|
+
*
|
|
382
|
+
* On Android, this tracks the push open as a custom event.
|
|
385
383
|
*
|
|
386
384
|
* @param userInfo - The notification payload from the push notification
|
|
387
385
|
* @param authorizationStatus - Current push authorization status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_NativeAttentiveReactNativeSdk","_interopRequireDefault","obj","__esModule","default","LINKING_ERROR","Platform","select","ios","AttentiveReactNativeSdk","NativeAttentiveReactNativeSdkModule","Proxy","get","Error","initialize","configuration","attentiveDomain","mode","skipFatigueOnCreatives","enableDebugger","triggerCreative","creativeId","destroyCreative","updateDomain","domain","identify","identifiers","phone","email","klaviyoId","shopifyId","clientUserId","customIdentifiers","clearUser","recordAddToCartEvent","attrs","items","deeplink","recordProductViewEvent","recordPurchaseEvent","orderId","cartId","cartCoupon","recordCustomEvent","type","properties","invokeAttentiveDebugHelper","exportDebugLogs","registerForPushNotifications","getPushAuthorizationStatus","registerDeviceToken","token","authorizationStatus","registerDeviceTokenWithCallback","callback","handleRegularOpen","console","log","handlePushOpened","userInfo","applicationState","handleForegroundNotification","handleForegroundPush","handlePushOpen","getInitialPushNotification","result"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAcA,IAAAC,8BAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEwC,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAExC,MAAMG,aAAa,GACjB,qFAAqF,GACrFC,qBAAQ,CAACC,MAAM,CAAC;EACdC,GAAG,EAAE,gCAAgC;EACrCJ,OAAO,EAAE;AACX,CAAC,CAAC,GACF,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMK,uBAAuB,GAC3BC,sCAAmC,GAC/BA,sCAAmC,GACnC,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACR,aAAa,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K,CAACE,QAAQ,CAAC;AAC7E;;AAEA;AACA;AACA;AACA;AACA,SAASE,mBAAmBA,CAACJ,KAAe,EAAE;EAC5C1B,uBAAuB,CAAC8B,mBAAmB,CACzCJ,KAAK,CAACC,KAAK,EACXD,KAAK,CAACK,OAAO,EACbL,KAAK,CAACM,MAAM,EACZN,KAAK,CAACO,UACR,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAACR,KAAkB,EAAE;EAC7C1B,uBAAuB,CAACkC,iBAAiB,CAACR,KAAK,CAACS,IAAI,EAAET,KAAK,CAACU,UAAU,CAAC;AACzE;;AAEA;AACA;AACA;AACA,SAASC,0BAA0BA,CAAA,EAAG;EACpCrC,uBAAuB,CAACqC,0BAA0B,CAAC,CAAC;AACtD;;AAEA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAAA,EAAoB;EAC1C,OAAOtC,uBAAuB,CAACsC,eAAe,CAAC,CAAC;AAClD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,4BAA4BA,CAAA,EAAS;EAC5CvC,uBAAuB,CAACuC,4BAA4B,CAAC,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,0BAA0BA,CAAA,EAAqC;EACtE,OAAOxC,uBAAuB,CAACwC,0BAA0B,CAAC,CAAC;AAC7D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,mBAAmBA,CAC1BC,KAAa,EACbC,mBAA4C,EACtC;EACN3C,uBAAuB,CAACyC,mBAAmB,CAACC,KAAK,EAAEC,mBAAmB,CAAC;AACzE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,+BAA+BA,CACtCF,KAAa,EACbC,mBAA4C,EAC5CE,QAKS,EACH;EACN7C,uBAAuB,CAAC4C,+BAA+B,CACrDF,KAAK,EACLC,mBAAmB,EACnBE,QACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAACH,mBAA4C,EAAQ;EAC7EI,OAAO,CAACC,GAAG,CAAC,6DAA6D,CAAC;EAC1ED,OAAO,CAACC,GAAG,CAAC,4BAA4BL,mBAAmB,EAAE,CAAC;EAC9DI,OAAO,CAACC,GAAG,CACT,mEACF,CAAC;EAEDhD,uBAAuB,CAAC8C,iBAAiB,CAACH,mBAAmB,CAAC;EAE9DI,OAAO,CAACC,GAAG,CAAC,mDAAmD,CAAC;AAClE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CACvBC,QAAkC,EAClCC,gBAAkC,EAClCR,mBAA4C,EACtC;EACN3C,uBAAuB,CAACiD,gBAAgB,CACtCC,QAAQ,EACRC,gBAAgB,EAChBR,mBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASS,4BAA4BA,CACnCF,QAAkC,EAC5B;EACNlD,uBAAuB,CAACoD,4BAA4B,CAACF,QAAkB,CAAC;AAC1E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_NativeAttentiveReactNativeSdk","_interopRequireDefault","obj","__esModule","default","LINKING_ERROR","Platform","select","ios","AttentiveReactNativeSdk","NativeAttentiveReactNativeSdkModule","Proxy","get","Error","initialize","configuration","attentiveDomain","mode","skipFatigueOnCreatives","enableDebugger","triggerCreative","creativeId","destroyCreative","updateDomain","domain","identify","identifiers","phone","email","klaviyoId","shopifyId","clientUserId","customIdentifiers","clearUser","recordAddToCartEvent","attrs","items","deeplink","recordProductViewEvent","recordPurchaseEvent","orderId","cartId","cartCoupon","recordCustomEvent","type","properties","invokeAttentiveDebugHelper","exportDebugLogs","registerForPushNotifications","getPushAuthorizationStatus","registerDeviceToken","token","authorizationStatus","registerDeviceTokenWithCallback","callback","handleRegularOpen","console","log","handlePushOpened","userInfo","applicationState","handleForegroundNotification","handleForegroundPush","handlePushOpen","getInitialPushNotification","result"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAcA,IAAAC,8BAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEwC,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAExC,MAAMG,aAAa,GACjB,qFAAqF,GACrFC,qBAAQ,CAACC,MAAM,CAAC;EACdC,GAAG,EAAE,gCAAgC;EACrCJ,OAAO,EAAE;AACX,CAAC,CAAC,GACF,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMK,uBAAuB,GAC3BC,sCAAmC,GAC/BA,sCAAmC,GACnC,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK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AK,EAAED,KAAK,CAACE,QAAQ,CAAC;AAC7E;;AAEA;AACA;AACA;AACA;AACA,SAASE,mBAAmBA,CAACJ,KAAe,EAAE;EAC5C1B,uBAAuB,CAAC8B,mBAAmB,CACzCJ,KAAK,CAACC,KAAK,EACXD,KAAK,CAACK,OAAO,EACbL,KAAK,CAACM,MAAM,EACZN,KAAK,CAACO,UACR,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAACR,KAAkB,EAAE;EAC7C1B,uBAAuB,CAACkC,iBAAiB,CAACR,KAAK,CAACS,IAAI,EAAET,KAAK,CAACU,UAAU,CAAC;AACzE;;AAEA;AACA;AACA;AACA,SAASC,0BAA0BA,CAAA,EAAG;EACpCrC,uBAAuB,CAACqC,0BAA0B,CAAC,CAAC;AACtD;;AAEA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAAA,EAAoB;EAC1C,OAAOtC,uBAAuB,CAACsC,eAAe,CAAC,CAAC;AAClD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,4BAA4BA,CAAA,EAAS;EAC5CvC,uBAAuB,CAACuC,4BAA4B,CAAC,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,0BAA0BA,CAAA,EAAqC;EACtE,OAAOxC,uBAAuB,CAACwC,0BAA0B,CAAC,CAAC;AAC7D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,mBAAmBA,CAC1BC,KAAa,EACbC,mBAA4C,EACtC;EACN3C,uBAAuB,CAACyC,mBAAmB,CAACC,KAAK,EAAEC,mBAAmB,CAAC;AACzE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,+BAA+BA,CACtCF,KAAa,EACbC,mBAA4C,EAC5CE,QAKS,EACH;EACN7C,uBAAuB,CAAC4C,+BAA+B,CACrDF,KAAK,EACLC,mBAAmB,EACnBE,QACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAACH,mBAA4C,EAAQ;EAC7EI,OAAO,CAACC,GAAG,CAAC,6DAA6D,CAAC;EAC1ED,OAAO,CAACC,GAAG,CAAC,4BAA4BL,mBAAmB,EAAE,CAAC;EAC9DI,OAAO,CAACC,GAAG,CACT,mEACF,CAAC;EAEDhD,uBAAuB,CAAC8C,iBAAiB,CAACH,mBAAmB,CAAC;EAE9DI,OAAO,CAACC,GAAG,CAAC,mDAAmD,CAAC;AAClE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CACvBC,QAAkC,EAClCC,gBAAkC,EAClCR,mBAA4C,EACtC;EACN3C,uBAAuB,CAACiD,gBAAgB,CACtCC,QAAQ,EACRC,gBAAgB,EAChBR,mBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASS,4BAA4BA,CACnCF,QAAkC,EAC5B;EACNlD,uBAAuB,CAACoD,4BAA4B,CAACF,QAAkB,CAAC;AAC1E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,oBAAoBA,CAC3BH,QAAkC,EAClCP,mBAA4C,EACtC;EACN3C,uBAAuB,CAACqD,oBAAoB,CAC1CH,QAAQ,EACRP,mBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASW,cAAcA,CACrBJ,QAAkC,EAClCP,mBAA4C,EACtC;EACN3C,uBAAuB,CAACsD,cAAc,CACpCJ,QAAQ,EACRP,mBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeY,0BAA0BA,CAAA,EAG/B;EACR,MAAMC,MAAM,GAAG,MAAMxD,uBAAuB,CAACuD,0BAA0B,CAAC,CAAC;EACzE,OAAOC,MAAM;AACf","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -310,17 +310,16 @@ function handleForegroundNotification(userInfo) {
|
|
|
310
310
|
|
|
311
311
|
/**
|
|
312
312
|
* Handle a push notification when the app is in the foreground (active state).
|
|
313
|
-
* This is the React Native equivalent of the native iOS handleForegroundPush method.
|
|
314
313
|
*
|
|
315
314
|
* Call this when you receive a notification response and the app state is 'active'.
|
|
316
|
-
* This is part of implementing the native iOS pattern:
|
|
317
|
-
* ```swift
|
|
318
|
-
* case .active:
|
|
319
|
-
* self.attentiveSdk?.handleForegroundPush(response: response, authorizationStatus: authStatus)
|
|
320
|
-
* ```
|
|
321
315
|
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
316
|
+
* **iOS prerequisite:** Your AppDelegate's
|
|
317
|
+
* `userNotificationCenter(_:didReceive:withCompletionHandler:)` must call
|
|
318
|
+
* `AttentiveSDKManager.shared.handleNotificationResponse(response)` so that
|
|
319
|
+
* the SDK can cache the `UNNotificationResponse` required by the native iOS SDK.
|
|
320
|
+
* Without that one line of native code, this function cannot track the event.
|
|
321
|
+
*
|
|
322
|
+
* On Android, this tracks the foreground push as a custom event.
|
|
324
323
|
*
|
|
325
324
|
* @param userInfo - The notification payload from the push notification
|
|
326
325
|
* @param authorizationStatus - Current push authorization status
|
|
@@ -343,17 +342,16 @@ function handleForegroundPush(userInfo, authorizationStatus) {
|
|
|
343
342
|
|
|
344
343
|
/**
|
|
345
344
|
* Handle when a push notification is opened by the user (app in background/inactive state).
|
|
346
|
-
* This is the React Native equivalent of the native iOS handlePushOpen method.
|
|
347
345
|
*
|
|
348
346
|
* Call this when you receive a notification response and the app state is 'background' or 'inactive'.
|
|
349
|
-
* This is part of implementing the native iOS pattern:
|
|
350
|
-
* ```swift
|
|
351
|
-
* case .background, .inactive:
|
|
352
|
-
* self.attentiveSdk?.handlePushOpen(response: response, authorizationStatus: authStatus)
|
|
353
|
-
* ```
|
|
354
347
|
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
348
|
+
* **iOS prerequisite:** Your AppDelegate's
|
|
349
|
+
* `userNotificationCenter(_:didReceive:withCompletionHandler:)` must call
|
|
350
|
+
* `AttentiveSDKManager.shared.handleNotificationResponse(response)` so that
|
|
351
|
+
* the SDK can cache the `UNNotificationResponse` required by the native iOS SDK.
|
|
352
|
+
* Without that one line of native code, this function cannot track the event.
|
|
353
|
+
*
|
|
354
|
+
* On Android, this tracks the push open as a custom event.
|
|
357
355
|
*
|
|
358
356
|
* @param userInfo - The notification payload from the push notification
|
|
359
357
|
* @param authorizationStatus - Current push authorization status
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","NativeAttentiveReactNativeSdkModule","LINKING_ERROR","select","ios","default","AttentiveReactNativeSdk","Proxy","get","Error","initialize","configuration","attentiveDomain","mode","skipFatigueOnCreatives","enableDebugger","triggerCreative","creativeId","destroyCreative","updateDomain","domain","identify","identifiers","phone","email","klaviyoId","shopifyId","clientUserId","customIdentifiers","clearUser","recordAddToCartEvent","attrs","items","deeplink","recordProductViewEvent","recordPurchaseEvent","orderId","cartId","cartCoupon","recordCustomEvent","type","properties","invokeAttentiveDebugHelper","exportDebugLogs","registerForPushNotifications","getPushAuthorizationStatus","registerDeviceToken","token","authorizationStatus","registerDeviceTokenWithCallback","callback","handleRegularOpen","console","log","handlePushOpened","userInfo","applicationState","handleForegroundNotification","handleForegroundPush","handlePushOpen","getInitialPushNotification","result"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAcvC,OAAOC,mCAAmC,MAEnC,iCAAiC;AAExC,MAAMC,aAAa,GACjB,qFAAqF,GACrFF,QAAQ,CAACG,MAAM,CAAC;EACdC,GAAG,EAAE,gCAAgC;EACrCC,OAAO,EAAE;AACX,CAAC,CAAC,GACF,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,uBAAuB,GAC3BL,mCAAmC,GAC/BA,mCAAmC,GACnC,IAAIM,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CACG;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASQ,UAAUA,CAACC,aAAwC,EAAE;EAC5DL,uBAAuB,CAACI,UAAU,CAChCC,aAAa,CAACC,eAAe,EAC7BD,aAAa,CAACE,IAAI,EAClBF,aAAa,CAACG,sBAAsB,IAAI,KAAK,EAC7CH,aAAa,CAACI,cAAc,IAAI,KAClC,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAACC,UAAmB,EAAE;EAC5CX,uBAAuB,CAACU,eAAe,CAACC,UAAU,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AC;AACzE;;AAEA;AACA;AACA;AACA,SAASC,0BAA0BA,CAAA,EAAG;EACpCpC,uBAAuB,CAACoC,0BAA0B,CAAC,CAAC;AACtD;;AAEA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAAA,EAAoB;EAC1C,OAAOrC,uBAAuB,CAACqC,eAAe,CAAC,CAAC;AAClD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,4BAA4BA,CAAA,EAAS;EAC5CtC,uBAAuB,CAACsC,4BAA4B,CAAC,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,0BAA0BA,CAAA,EAAqC;EACtE,OAAOvC,uBAAuB,CAACuC,0BAA0B,CAAC,CAAC;AAC7D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,mBAAmBA,CAC1BC,KAAa,EACbC,mBAA4C,EACtC;EACN1C,uBAAuB,CAACwC,mBAAmB,CAACC,KAAK,EAAEC,mBAAmB,CAAC;AACzE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,+BAA+BA,CACtCF,KAAa,EACbC,mBAA4C,EAC5CE,QAKS,EACH;EACN5C,uBAAuB,CAAC2C,+BAA+B,CACrDF,KAAK,EACLC,mBAAmB,EACnBE,QACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAACH,mBAA4C,EAAQ;EAC7EI,OAAO,CAACC,GAAG,CAAC,6DAA6D,CAAC;EAC1ED,OAAO,CAACC,GAAG,CAAC,4BAA4BL,mBAAmB,EAAE,CAAC;EAC9DI,OAAO,CAACC,GAAG,CACT,mEACF,CAAC;EAED/C,uBAAuB,CAAC6C,iBAAiB,CAACH,mBAAmB,CAAC;EAE9DI,OAAO,CAACC,GAAG,CAAC,mDAAmD,CAAC;AAClE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CACvBC,QAAkC,EAClCC,gBAAkC,EAClCR,mBAA4C,EACtC;EACN1C,uBAAuB,CAACgD,gBAAgB,CACtCC,QAAQ,EACRC,gBAAgB,EAChBR,mBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASS,4BAA4BA,CACnCF,QAAkC,EAC5B;EACNjD,uBAAuB,CAACmD,4BAA4B,CAACF,QAAkB,CAAC;AAC1E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA
|
|
1
|
+
{"version":3,"names":["Platform","NativeAttentiveReactNativeSdkModule","LINKING_ERROR","select","ios","default","AttentiveReactNativeSdk","Proxy","get","Error","initialize","configuration","attentiveDomain","mode","skipFatigueOnCreatives","enableDebugger","triggerCreative","creativeId","destroyCreative","updateDomain","domain","identify","identifiers","phone","email","klaviyoId","shopifyId","clientUserId","customIdentifiers","clearUser","recordAddToCartEvent","attrs","items","deeplink","recordProductViewEvent","recordPurchaseEvent","orderId","cartId","cartCoupon","recordCustomEvent","type","properties","invokeAttentiveDebugHelper","exportDebugLogs","registerForPushNotifications","getPushAuthorizationStatus","registerDeviceToken","token","authorizationStatus","registerDeviceTokenWithCallback","callback","handleRegularOpen","console","log","handlePushOpened","userInfo","applicationState","handleForegroundNotification","handleForegroundPush","handlePushOpen","getInitialPushNotification","result"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AAcvC,OAAOC,mCAAmC,MAEnC,iCAAiC;AAExC,MAAMC,aAAa,GACjB,qFAAqF,GACrFF,QAAQ,CAACG,MAAM,CAAC;EACdC,GAAG,EAAE,gCAAgC;EACrCC,OAAO,EAAE;AACX,CAAC,CAAC,GACF,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,uBAAuB,GAC3BL,mCAAmC,GAC/BA,mCAAmC,GACnC,IAAIM,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACP,aAAa,CAAC;EAChC;AACF,CACF,CACG;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASQ,UAAUA,CAACC,aAAwC,EAAE;EAC5DL,uBAAuB,CAACI,UAAU,CAChCC,aAAa,CAACC,eAAe,EAC7BD,aAAa,CAACE,IAAI,EAClBF,aAAa,CAACG,sBAAsB,IAAI,KAAK,EAC7CH,aAAa,CAACI,cAAc,IAAI,KAClC,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA,SAASC,eAAeA,CAACC,UAAmB,EAAE;EAC5CX,uBAAuB,CAACU,eAAe,CAACC,UAAU,CAAC;AACrD;;AAEA;AACA;AACA;AACA,SAASC,eAAeA,CAAA,EAAG;EACzBZ,uBAAuB,CAACY,eAAe,CAAC,CAAC;AAC3C;;AAEA;AACA;AACA;AACA;AACA,SAASC,YAAYA,CAACC,MAAc,EAAE;EACpCd,uBAAuB,CAACa,YAAY,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,eAAe,CAAC,CAAC;AAClD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,4BAA4BA,CAAA,EAAS;EAC5CtC,uBAAuB,CAACsC,4BAA4B,CAAC,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,0BAA0BA,CAAA,EAAqC;EACtE,OAAOvC,uBAAuB,CAACuC,0BAA0B,CAAC,CAAC;AAC7D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,mBAAmBA,CAC1BC,KAAa,EACbC,mBAA4C,EACtC;EACN1C,uBAAuB,CAACwC,mBAAmB,CAACC,KAAK,EAAEC,mBAAmB,CAAC;AACzE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,+BAA+BA,CACtCF,KAAa,EACbC,mBAA4C,EAC5CE,QAKS,EACH;EACN5C,uBAAuB,CAAC2C,+BAA+B,CACrDF,KAAK,EACLC,mBAAmB,EACnBE,QACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,iBAAiBA,CAACH,mBAA4C,EAAQ;EAC7EI,OAAO,CAACC,GAAG,CAAC,6DAA6D,CAAC;EAC1ED,OAAO,CAACC,GAAG,CAAC,4BAA4BL,mBAAmB,EAAE,CAAC;EAC9DI,OAAO,CAACC,GAAG,CACT,mEACF,CAAC;EAED/C,uBAAuB,CAAC6C,iBAAiB,CAACH,mBAAmB,CAAC;EAE9DI,OAAO,CAACC,GAAG,CAAC,mDAAmD,CAAC;AAClE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,gBAAgBA,CACvBC,QAAkC,EAClCC,gBAAkC,EAClCR,mBAA4C,EACtC;EACN1C,uBAAuB,CAACgD,gBAAgB,CACtCC,QAAQ,EACRC,gBAAgB,EAChBR,mBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASS,4BAA4BA,CACnCF,QAAkC,EAC5B;EACNjD,uBAAuB,CAACmD,4BAA4B,CAACF,QAAkB,CAAC;AAC1E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,oBAAoBA,CAC3BH,QAAkC,EAClCP,mBAA4C,EACtC;EACN1C,uBAAuB,CAACoD,oBAAoB,CAC1CH,QAAQ,EACRP,mBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASW,cAAcA,CACrBJ,QAAkC,EAClCP,mBAA4C,EACtC;EACN1C,uBAAuB,CAACqD,cAAc,CACpCJ,QAAQ,EACRP,mBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeY,0BAA0BA,CAAA,EAG/B;EACR,MAAMC,MAAM,GAAG,MAAMvD,uBAAuB,CAACsD,0BAA0B,CAAC,CAAC;EACzE,OAAOC,MAAM;AACf;AAEA,SACEnD,UAAU,EACVM,eAAe,EACfE,eAAe,EACfC,YAAY,EACZE,QAAQ,EACRQ,SAAS,EACTC,oBAAoB,EACpBI,sBAAsB,EACtBC,mBAAmB,EACnBI,iBAAiB,EACjBG,0BAA0B,EAC1BC,eAAe;AACf;AACAC,4BAA4B,EAC5BC,0BAA0B,EAC1BC,mBAAmB,EACnBG,+BAA+B,EAC/BE,iBAAiB,EACjBG,gBAAgB,EAChBG,4BAA4B,EAC5BC,oBAAoB,EACpBC,cAAc,EACdC,0BAA0B","ignoreList":[]}
|
|
@@ -234,17 +234,16 @@ declare function handlePushOpened(userInfo: PushNotificationUserInfo, applicatio
|
|
|
234
234
|
declare function handleForegroundNotification(userInfo: PushNotificationUserInfo): void;
|
|
235
235
|
/**
|
|
236
236
|
* Handle a push notification when the app is in the foreground (active state).
|
|
237
|
-
* This is the React Native equivalent of the native iOS handleForegroundPush method.
|
|
238
237
|
*
|
|
239
238
|
* Call this when you receive a notification response and the app state is 'active'.
|
|
240
|
-
* This is part of implementing the native iOS pattern:
|
|
241
|
-
* ```swift
|
|
242
|
-
* case .active:
|
|
243
|
-
* self.attentiveSdk?.handleForegroundPush(response: response, authorizationStatus: authStatus)
|
|
244
|
-
* ```
|
|
245
239
|
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
240
|
+
* **iOS prerequisite:** Your AppDelegate's
|
|
241
|
+
* `userNotificationCenter(_:didReceive:withCompletionHandler:)` must call
|
|
242
|
+
* `AttentiveSDKManager.shared.handleNotificationResponse(response)` so that
|
|
243
|
+
* the SDK can cache the `UNNotificationResponse` required by the native iOS SDK.
|
|
244
|
+
* Without that one line of native code, this function cannot track the event.
|
|
245
|
+
*
|
|
246
|
+
* On Android, this tracks the foreground push as a custom event.
|
|
248
247
|
*
|
|
249
248
|
* @param userInfo - The notification payload from the push notification
|
|
250
249
|
* @param authorizationStatus - Current push authorization status
|
|
@@ -264,17 +263,16 @@ declare function handleForegroundNotification(userInfo: PushNotificationUserInfo
|
|
|
264
263
|
declare function handleForegroundPush(userInfo: PushNotificationUserInfo, authorizationStatus: PushAuthorizationStatus): void;
|
|
265
264
|
/**
|
|
266
265
|
* Handle when a push notification is opened by the user (app in background/inactive state).
|
|
267
|
-
* This is the React Native equivalent of the native iOS handlePushOpen method.
|
|
268
266
|
*
|
|
269
267
|
* Call this when you receive a notification response and the app state is 'background' or 'inactive'.
|
|
270
|
-
* This is part of implementing the native iOS pattern:
|
|
271
|
-
* ```swift
|
|
272
|
-
* case .background, .inactive:
|
|
273
|
-
* self.attentiveSdk?.handlePushOpen(response: response, authorizationStatus: authStatus)
|
|
274
|
-
* ```
|
|
275
268
|
*
|
|
276
|
-
*
|
|
277
|
-
*
|
|
269
|
+
* **iOS prerequisite:** Your AppDelegate's
|
|
270
|
+
* `userNotificationCenter(_:didReceive:withCompletionHandler:)` must call
|
|
271
|
+
* `AttentiveSDKManager.shared.handleNotificationResponse(response)` so that
|
|
272
|
+
* the SDK can cache the `UNNotificationResponse` required by the native iOS SDK.
|
|
273
|
+
* Without that one line of native code, this function cannot track the event.
|
|
274
|
+
*
|
|
275
|
+
* On Android, this tracks the push open as a custom event.
|
|
278
276
|
*
|
|
279
277
|
* @param userInfo - The notification payload from the push notification
|
|
280
278
|
* @param authorizationStatus - Current push authorization status
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,yBAAyB,EACzB,WAAW,EACX,QAAQ,EACR,SAAS,EACT,WAAW,EACX,IAAI,EACJ,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACvB,MAAM,cAAc,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C,mBAAmB,EAAE,uBAAuB,GAC3C,IAAI,CAKN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,iBAAS,cAAc,CACrB,QAAQ,EAAE,wBAAwB,EAClC,mBAAmB,EAAE,uBAAuB,GAC3C,IAAI,CAKN;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,iBAAe,0BAA0B,IAAI,OAAO,CAAC,MAAM,CACzD,MAAM,EACN,MAAM,CACP,GAAG,IAAI,CAAC,CAGR;AAED,OAAO,EACL,UAAU,EACV,eAAe,EACf,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,0BAA0B,EAC1B,eAAe,EAEf,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,EACnB,+BAA+B,EAC/B,iBAAiB,EACjB,gBAAgB,EAChB,4BAA4B,EAC5B,oBAAoB,EACpB,cAAc,EACd,0BAA0B,GAC3B,CAAA;AAED,YAAY,EACV,eAAe,EACf,yBAAyB,EACzB,WAAW,EACX,QAAQ,EACR,SAAS,EACT,WAAW,EACX,IAAI,EAEJ,uBAAuB,EACvB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,GACvB,CAAA"}
|
package/package.json
CHANGED
package/src/index.tsx
CHANGED
|
@@ -385,17 +385,16 @@ function handleForegroundNotification(
|
|
|
385
385
|
|
|
386
386
|
/**
|
|
387
387
|
* Handle a push notification when the app is in the foreground (active state).
|
|
388
|
-
* This is the React Native equivalent of the native iOS handleForegroundPush method.
|
|
389
388
|
*
|
|
390
389
|
* Call this when you receive a notification response and the app state is 'active'.
|
|
391
|
-
* This is part of implementing the native iOS pattern:
|
|
392
|
-
* ```swift
|
|
393
|
-
* case .active:
|
|
394
|
-
* self.attentiveSdk?.handleForegroundPush(response: response, authorizationStatus: authStatus)
|
|
395
|
-
* ```
|
|
396
390
|
*
|
|
397
|
-
*
|
|
398
|
-
*
|
|
391
|
+
* **iOS prerequisite:** Your AppDelegate's
|
|
392
|
+
* `userNotificationCenter(_:didReceive:withCompletionHandler:)` must call
|
|
393
|
+
* `AttentiveSDKManager.shared.handleNotificationResponse(response)` so that
|
|
394
|
+
* the SDK can cache the `UNNotificationResponse` required by the native iOS SDK.
|
|
395
|
+
* Without that one line of native code, this function cannot track the event.
|
|
396
|
+
*
|
|
397
|
+
* On Android, this tracks the foreground push as a custom event.
|
|
399
398
|
*
|
|
400
399
|
* @param userInfo - The notification payload from the push notification
|
|
401
400
|
* @param authorizationStatus - Current push authorization status
|
|
@@ -424,17 +423,16 @@ function handleForegroundPush(
|
|
|
424
423
|
|
|
425
424
|
/**
|
|
426
425
|
* Handle when a push notification is opened by the user (app in background/inactive state).
|
|
427
|
-
* This is the React Native equivalent of the native iOS handlePushOpen method.
|
|
428
426
|
*
|
|
429
427
|
* Call this when you receive a notification response and the app state is 'background' or 'inactive'.
|
|
430
|
-
* This is part of implementing the native iOS pattern:
|
|
431
|
-
* ```swift
|
|
432
|
-
* case .background, .inactive:
|
|
433
|
-
* self.attentiveSdk?.handlePushOpen(response: response, authorizationStatus: authStatus)
|
|
434
|
-
* ```
|
|
435
428
|
*
|
|
436
|
-
*
|
|
437
|
-
*
|
|
429
|
+
* **iOS prerequisite:** Your AppDelegate's
|
|
430
|
+
* `userNotificationCenter(_:didReceive:withCompletionHandler:)` must call
|
|
431
|
+
* `AttentiveSDKManager.shared.handleNotificationResponse(response)` so that
|
|
432
|
+
* the SDK can cache the `UNNotificationResponse` required by the native iOS SDK.
|
|
433
|
+
* Without that one line of native code, this function cannot track the event.
|
|
434
|
+
*
|
|
435
|
+
* On Android, this tracks the push open as a custom event.
|
|
438
436
|
*
|
|
439
437
|
* @param userInfo - The notification payload from the push notification
|
|
440
438
|
* @param authorizationStatus - Current push authorization status
|
|
@@ -485,7 +483,10 @@ function handlePushOpen(
|
|
|
485
483
|
* @returns A promise that resolves to the notification data object, or `null` if the
|
|
486
484
|
* app was not launched via a push notification tap.
|
|
487
485
|
*/
|
|
488
|
-
async function getInitialPushNotification(): Promise<Record<
|
|
486
|
+
async function getInitialPushNotification(): Promise<Record<
|
|
487
|
+
string,
|
|
488
|
+
string
|
|
489
|
+
> | null> {
|
|
489
490
|
const result = await AttentiveReactNativeSdk.getInitialPushNotification()
|
|
490
491
|
return result as Record<string, string> | null
|
|
491
492
|
}
|
|
Binary file
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
-
<plist version="1.0">
|
|
4
|
-
<dict>
|
|
5
|
-
<key>SchemeUserState</key>
|
|
6
|
-
<dict>
|
|
7
|
-
<key>AttentiveReactNativeSdk.xcscheme_^#shared#^_</key>
|
|
8
|
-
<dict>
|
|
9
|
-
<key>orderHint</key>
|
|
10
|
-
<integer>0</integer>
|
|
11
|
-
</dict>
|
|
12
|
-
</dict>
|
|
13
|
-
</dict>
|
|
14
|
-
</plist>
|