Commit 84bc7c5 1 parent 96499da commit 84bc7c5 Copy full SHA for 84bc7c5
File tree 7 files changed +53
-1
lines changed
main/java/com/urbanairship/reactnative
oldarch/java/com/urbanairship/reactnative
7 files changed +53
-1
lines changed Original file line number Diff line number Diff line change 1
1
# React Native Module Changelog
2
2
3
+ ## Version 19.3.0 - August 30, 2024
4
+ Minor release that adds early access support for Embedded Content.
5
+
6
+ ### Changes
7
+ - Adds AirshipEmbeddedView and listener methods to Airship.inApp for Embedded Content.
8
+ - Exposes the Airship session ID on Airship.analytics.
9
+
10
+
3
11
## Version 19.2.1 - August 23, 2024
4
12
Patch release that fixes an issue with extras parsing on notifications
5
13
Original file line number Diff line number Diff line change @@ -461,6 +461,15 @@ class AirshipModule internal constructor(val context: ReactApplicationContext) :
461
461
}
462
462
}
463
463
464
+ @ReactMethod
465
+ override fun analyticsGetSessionId (
466
+ promise : Promise
467
+ ) {
468
+ promise.resolveResult {
469
+ proxy.analytics.getSessionId()
470
+ }
471
+ }
472
+
464
473
@ReactMethod
465
474
override fun actionRun (action : ReadableMap , promise : Promise ) {
466
475
promise.resolveDeferred<ActionValue > { callback ->
Original file line number Diff line number Diff line change @@ -237,6 +237,12 @@ abstract class AirshipSpec internal constructor(context: ReactApplicationContext
237
237
promise : Promise
238
238
)
239
239
240
+ @ReactMethod
241
+ @com.facebook.proguard.annotations.DoNotStrip
242
+ abstract fun analyticsGetSessionId (
243
+ promise : Promise
244
+ )
245
+
240
246
@ReactMethod
241
247
@com.facebook.proguard.annotations.DoNotStrip
242
248
abstract fun addCustomEvent (
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ public class AirshipReactNative: NSObject {
38
38
AirshipProxy . shared
39
39
}
40
40
41
- public static let version : String = " 19.2.1 "
41
+ public static let version : String = " 19.3.0 "
42
42
43
43
private let eventNotifier = EventNotifier ( )
44
44
@@ -362,6 +362,12 @@ public extension AirshipReactNative {
362
362
func addCustomEvent( _ json: Any ) throws {
363
363
try AirshipProxy . shared. analytics. addEvent ( json)
364
364
}
365
+
366
+ @objc
367
+ @MainActor
368
+ func analyticsGetSessionId( ) throws -> String {
369
+ try AirshipProxy . shared. analytics. getSessionID ( ) . lowercased ( )
370
+ }
365
371
}
366
372
367
373
// Contact
Original file line number Diff line number Diff line change @@ -390,6 +390,19 @@ + (BOOL)requiresMainQueueSetup {
390
390
[self handleResult: nil error: error resolve: resolve reject: reject];
391
391
}
392
392
393
+ RCT_REMAP_METHOD (analyticsGetSessionId,
394
+ analyticsGetSessionId:(RCTPromiseResolveBlock)resolve
395
+ reject:(RCTPromiseRejectBlock)reject) {
396
+ NSError *error;
397
+ NSString *result = [AirshipReactNative.shared analyticsGetSessionIdAndReturnError: &error];
398
+
399
+ [self handleResult: result
400
+ error: error
401
+ resolve: resolve
402
+ reject: reject];
403
+ }
404
+
405
+
393
406
RCT_REMAP_METHOD (contactEditAttributes,
394
407
contactEditAttributes:(NSArray *)operations
395
408
resolve:(RCTPromiseResolveBlock)resolve
Original file line number Diff line number Diff line change @@ -35,4 +35,12 @@ export class AirshipAnalytics {
35
35
public addCustomEvent ( event : CustomEvent ) : Promise < void > {
36
36
return this . module . addCustomEvent ( event ) ;
37
37
}
38
+
39
+ /**
40
+ * Gets the Airship session ID. The session ID is a UUID that updates on foreground and background.
41
+ * @returns A promise.
42
+ */
43
+ public getSessionId ( ) : Promise < string > {
44
+ return this . module . analyticsGetSessionId ( ) ;
45
+ }
38
46
}
Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ export interface Spec extends TurboModule {
67
67
analyticsTrackScreen ( screen ?: string ) : Promise < void > ;
68
68
analyticsAssociateIdentifier ( key : string , identifier ?: string ) : Promise < void > ;
69
69
addCustomEvent ( event : Object ) : Promise < void > ;
70
+ analyticsGetSessionId ( ) : Promise < string > ;
71
+
70
72
71
73
// Action
72
74
actionRun ( action : Object ) : Promise < Object | Error > ;
You can’t perform that action at this time.
0 commit comments