Skip to content

Commit

Permalink
fix: iOS/Android uses latest native libraries + iOS identify improvenets
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Apr 8, 2023
1 parent aa0117c commit 8b4e188
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.extole.mobile:android-sdk:1.0.39'
implementation 'com.extole.mobile:android-sdk:1.0.44'
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
// From node_modules
}
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ PODS:
- CocoaAsyncSocket (7.6.5)
- DoubleConversion (1.1.6)
- extole-mobile-sdk (0.0.2):
- ExtoleMobileSDK (~> 0.0.38)
- ExtoleMobileSDK (~> 0.0.42)
- React-Core
- ExtoleConsumerAPI (0.0.17):
- Alamofire (~> 5.1.0)
- ExtoleMobileSDK (0.0.40):
- ExtoleMobileSDK (0.0.42):
- ExtoleConsumerAPI (~> 0.0.17)
- Logging (~> 1.4)
- ObjectMapper (~> 4.1.0)
Expand Down Expand Up @@ -568,9 +568,9 @@ SPEC CHECKSUMS:
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
extole-mobile-sdk: d7fea7f913a83d40af6ce497d01f836f9bc31f36
extole-mobile-sdk: 3b5e13fe33f4334064b025b28507745e551c0b46
ExtoleConsumerAPI: 4e512cfee398d5fba446ca04076ee382cbf0979b
ExtoleMobileSDK: 616055899db4c427eae135d99b9f1f54d6c1eb39
ExtoleMobileSDK: a8f9dda3f9ffa42e67a603a6e95cae16b90c48d5
FBLazyVector: a7a655862f6b09625d11c772296b01cd5164b648
FBReactNativeSpec: 81ce99032d5b586fddd6a38d450f8595f7e04be4
Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0
Expand Down
2 changes: 1 addition & 1 deletion extole-mobile-sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|
s.source_files = "ios/**/*.{h,m,mm,swift}"

s.dependency "React-Core"
s.dependency "ExtoleMobileSDK", '~> 0.0.38'
s.dependency "ExtoleMobileSDK", '~> 0.0.42'

# Don't install the dependencies when we run `pod install` in the old architecture.
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
Expand Down
4 changes: 4 additions & 0 deletions ios/ExtoleMobileSdk.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ @interface RCT_EXTERN_MODULE(ExtoleMobileSdk, NSObject)
withResolver:(RCTPromiseResolveBlock)resolve
withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(identify:(NSString *)email withData:(NSDictionary *)data
withResolver:(RCTPromiseResolveBlock)resolve
withRejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(fetchZone:(NSString *)zoneName withData:(NSDictionary *)data
withResolver:(RCTPromiseResolveBlock)resolve
withRejecter:(RCTPromiseRejectBlock)reject)
Expand Down
12 changes: 12 additions & 0 deletions ios/ExtoleMobileSdk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ class ExtoleMobileSdk: NSObject {
}
}

@objc(identify:withData:withResolver:withRejecter:)
func identify(email: NSString, data: NSDictionary, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
extole?.identify(email as String, (data as! [String: String]?) ?? [:]) { [self] (idEvent, error) in
if error != nil {
self.extole?.getLogger().error(error?.localizedDescription ?? "Unable to send identify event")
reject("identify_failed", error?.localizedDescription ?? "Unable to send identify event", error)
} else {
resolve(idEvent?.getValue())
}
}
}

@objc(fetchZone:withData:withResolver:withRejecter:)
func fetchZone(zoneName: NSString, data: NSDictionary, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
extole?.fetchZone(zoneName as String, (data as! [String: String]?) ?? [:]) { (zone: Zone?, campaign: Campaign?, error: Error?) in
Expand Down

0 comments on commit 8b4e188

Please sign in to comment.