Skip to content

Commit

Permalink
Release 19.3.0 (#586)
Browse files Browse the repository at this point in the history
* Release 19.3.0

* Format
  • Loading branch information
rlepinski authored Aug 30, 2024
1 parent 96499da commit 84bc7c5
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# React Native Module Changelog

## Version 19.3.0 - August 30, 2024
Minor release that adds early access support for Embedded Content.

### Changes
- Adds AirshipEmbeddedView and listener methods to Airship.inApp for Embedded Content.
- Exposes the Airship session ID on Airship.analytics.


## Version 19.2.1 - August 23, 2024
Patch release that fixes an issue with extras parsing on notifications

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,15 @@ class AirshipModule internal constructor(val context: ReactApplicationContext) :
}
}

@ReactMethod
override fun analyticsGetSessionId(
promise: Promise
) {
promise.resolveResult {
proxy.analytics.getSessionId()
}
}

@ReactMethod
override fun actionRun(action: ReadableMap, promise: Promise) {
promise.resolveDeferred<ActionValue> { callback ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ abstract class AirshipSpec internal constructor(context: ReactApplicationContext
promise: Promise
)

@ReactMethod
@com.facebook.proguard.annotations.DoNotStrip
abstract fun analyticsGetSessionId(
promise: Promise
)

@ReactMethod
@com.facebook.proguard.annotations.DoNotStrip
abstract fun addCustomEvent(
Expand Down
8 changes: 7 additions & 1 deletion ios/AirshipReactNative.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class AirshipReactNative: NSObject {
AirshipProxy.shared
}

public static let version: String = "19.2.1"
public static let version: String = "19.3.0"

private let eventNotifier = EventNotifier()

Expand Down Expand Up @@ -362,6 +362,12 @@ public extension AirshipReactNative {
func addCustomEvent(_ json: Any) throws {
try AirshipProxy.shared.analytics.addEvent(json)
}

@objc
@MainActor
func analyticsGetSessionId() throws -> String {
try AirshipProxy.shared.analytics.getSessionID().lowercased()
}
}

// Contact
Expand Down
13 changes: 13 additions & 0 deletions ios/RTNAirship.mm
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,19 @@ + (BOOL)requiresMainQueueSetup {
[self handleResult:nil error:error resolve:resolve reject:reject];
}

RCT_REMAP_METHOD(analyticsGetSessionId,
analyticsGetSessionId:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject) {
NSError *error;
NSString *result = [AirshipReactNative.shared analyticsGetSessionIdAndReturnError:&error];

[self handleResult:result
error:error
resolve:resolve
reject:reject];
}


RCT_REMAP_METHOD(contactEditAttributes,
contactEditAttributes:(NSArray *)operations
resolve:(RCTPromiseResolveBlock)resolve
Expand Down
8 changes: 8 additions & 0 deletions src/AirshipAnalytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,12 @@ export class AirshipAnalytics {
public addCustomEvent(event: CustomEvent): Promise<void> {
return this.module.addCustomEvent(event);
}

/**
* Gets the Airship session ID. The session ID is a UUID that updates on foreground and background.
* @returns A promise.
*/
public getSessionId(): Promise<string> {
return this.module.analyticsGetSessionId();
}
}
2 changes: 2 additions & 0 deletions src/NativeRTNAirship.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export interface Spec extends TurboModule {
analyticsTrackScreen(screen?: string): Promise<void>;
analyticsAssociateIdentifier(key: string, identifier?: string): Promise<void>;
addCustomEvent(event: Object): Promise<void>;
analyticsGetSessionId(): Promise<string>;


// Action
actionRun(action: Object): Promise<Object | Error>;
Expand Down

0 comments on commit 84bc7c5

Please sign in to comment.