Skip to content

Commit 84bc7c5

Browse files
authored
Release 19.3.0 (#586)
* Release 19.3.0 * Format
1 parent 96499da commit 84bc7c5

File tree

7 files changed

+53
-1
lines changed

7 files changed

+53
-1
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# React Native Module Changelog
22

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+
311
## Version 19.2.1 - August 23, 2024
412
Patch release that fixes an issue with extras parsing on notifications
513

android/src/main/java/com/urbanairship/reactnative/AirshipModule.kt

+9
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,15 @@ class AirshipModule internal constructor(val context: ReactApplicationContext) :
461461
}
462462
}
463463

464+
@ReactMethod
465+
override fun analyticsGetSessionId(
466+
promise: Promise
467+
) {
468+
promise.resolveResult {
469+
proxy.analytics.getSessionId()
470+
}
471+
}
472+
464473
@ReactMethod
465474
override fun actionRun(action: ReadableMap, promise: Promise) {
466475
promise.resolveDeferred<ActionValue> { callback ->

android/src/oldarch/java/com/urbanairship/reactnative/AirshipSpec.kt

+6
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ abstract class AirshipSpec internal constructor(context: ReactApplicationContext
237237
promise: Promise
238238
)
239239

240+
@ReactMethod
241+
@com.facebook.proguard.annotations.DoNotStrip
242+
abstract fun analyticsGetSessionId(
243+
promise: Promise
244+
)
245+
240246
@ReactMethod
241247
@com.facebook.proguard.annotations.DoNotStrip
242248
abstract fun addCustomEvent(

ios/AirshipReactNative.swift

+7-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public class AirshipReactNative: NSObject {
3838
AirshipProxy.shared
3939
}
4040

41-
public static let version: String = "19.2.1"
41+
public static let version: String = "19.3.0"
4242

4343
private let eventNotifier = EventNotifier()
4444

@@ -362,6 +362,12 @@ public extension AirshipReactNative {
362362
func addCustomEvent(_ json: Any) throws {
363363
try AirshipProxy.shared.analytics.addEvent(json)
364364
}
365+
366+
@objc
367+
@MainActor
368+
func analyticsGetSessionId() throws -> String {
369+
try AirshipProxy.shared.analytics.getSessionID().lowercased()
370+
}
365371
}
366372

367373
// Contact

ios/RTNAirship.mm

+13
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,19 @@ + (BOOL)requiresMainQueueSetup {
390390
[self handleResult:nil error:error resolve:resolve reject:reject];
391391
}
392392

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+
393406
RCT_REMAP_METHOD(contactEditAttributes,
394407
contactEditAttributes:(NSArray *)operations
395408
resolve:(RCTPromiseResolveBlock)resolve

src/AirshipAnalytics.ts

+8
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,12 @@ export class AirshipAnalytics {
3535
public addCustomEvent(event: CustomEvent): Promise<void> {
3636
return this.module.addCustomEvent(event);
3737
}
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+
}
3846
}

src/NativeRTNAirship.ts

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ export interface Spec extends TurboModule {
6767
analyticsTrackScreen(screen?: string): Promise<void>;
6868
analyticsAssociateIdentifier(key: string, identifier?: string): Promise<void>;
6969
addCustomEvent(event: Object): Promise<void>;
70+
analyticsGetSessionId(): Promise<string>;
71+
7072

7173
// Action
7274
actionRun(action: Object): Promise<Object | Error>;

0 commit comments

Comments
 (0)