Skip to content

Commit

Permalink
fix: identifyJwt implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jan 29, 2024
1 parent 7c56d7d commit c65127f
Show file tree
Hide file tree
Showing 12 changed files with 3,876 additions and 4,237 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.44'
implementation 'com.extole.mobile:android-sdk:1.0.49'
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
// From node_modules
}
Expand Down
17 changes: 16 additions & 1 deletion android/src/main/java/com/extole/android/sdk/RNExtole.kt
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ class RNExtole(reactContext: ReactApplicationContext?) :
val identifyData =
(recursivelyDeconstructReadableMap(data)?.mapValues { it.value.toString() }
?: emptyMap())
Log.e("Extole", "Identify executed 2 :" + identifyData)
return@executeWithPromise extole?.identify(
email,
identifyData
Expand All @@ -157,6 +156,22 @@ class RNExtole(reactContext: ReactApplicationContext?) :
}
}

@ReactMethod
fun identifyJwt(jwt: String, data: ReadableMap, promise: Promise) {
executeWithPromise(promise) {
if (extole != null) {
val identifyData =
(recursivelyDeconstructReadableMap(data)?.mapValues { it.value.toString() }
?: emptyMap())
return@executeWithPromise extole?.identifyJwt(
jwt,
identifyData
)?.id
}
throw Exception("Extole is not initialized")
}
}

@ReactMethod
fun getJsonConfiguration(promise: Promise) {
promise.resolve(JSONArray(extole?.getJsonConfiguration()).toString())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1210"
version = "1.3">
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
Expand All @@ -22,6 +22,13 @@
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
Expand Down
18 changes: 9 additions & 9 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.43)
- ExtoleMobileSDK (~> 0.0.45)
- React-Core
- ExtoleConsumerAPI (0.0.17):
- Alamofire (~> 5.1.0)
- ExtoleMobileSDK (0.0.43):
- ExtoleMobileSDK (0.0.45):
- ExtoleConsumerAPI (~> 0.0.17)
- Logging (~> 1.4)
- ObjectMapper (~> 4.1.0)
Expand Down Expand Up @@ -386,12 +386,12 @@ PODS:
- React-jsi (= 0.68.2)
- React-logger (= 0.68.2)
- React-perflogger (= 0.68.2)
- RNGestureHandler (2.6.2):
- RNGestureHandler (2.14.1):
- React-Core
- RNScreens (3.18.2):
- React-Core
- React-RCTImage
- SocketRocket (0.6.0)
- SocketRocket (0.6.1)
- SwiftEventBus (5.0.0)
- Yoga (1.14.0)
- YogaKit (1.18.1):
Expand Down Expand Up @@ -568,9 +568,9 @@ SPEC CHECKSUMS:
boost: a7c83b31436843459a1961bfd74b96033dc77234
CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99
DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662
extole-mobile-sdk: b99ec2ae2549f5d5dd70d6cb6c9502acda98e619
extole-mobile-sdk: 895541d50ae06f513a5737dbfc954880cfe97eba
ExtoleConsumerAPI: 4e512cfee398d5fba446ca04076ee382cbf0979b
ExtoleMobileSDK: 0616225e29a6b3dc54bfef761f8e7086952b8e76
ExtoleMobileSDK: 3531494fe1a494ceb6cfcd40979200145bdb48b6
FBLazyVector: a7a655862f6b09625d11c772296b01cd5164b648
FBReactNativeSpec: 81ce99032d5b586fddd6a38d450f8595f7e04be4
Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0
Expand Down Expand Up @@ -617,13 +617,13 @@ SPEC CHECKSUMS:
React-RCTVibration: 79040b92bfa9c3c2d2cb4f57e981164ec7ab9374
React-runtimeexecutor: b960b687d2dfef0d3761fbb187e01812ebab8b23
ReactCommon: 095366164a276d91ea704ce53cb03825c487a3f2
RNGestureHandler: 4defbd70b2faf3d6761b82fa7880285241762cb0
RNGestureHandler: e98441928705d9d1184b599d7c1c6df2dd4f7724
RNScreens: 34cc502acf1b916c582c60003dc3089fa01dc66d
SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
SwiftEventBus: b30f617a6aca5a9336464b4d3f5931034762f2d5
Yoga: 99652481fcd320aefa4a7ef90095b95acd181952
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 86ca3b8e1feab2ffdb9274af4d7d59a954234d83

COCOAPODS: 1.11.3
COCOAPODS: 1.14.2
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@react-navigation/stack": "^6.3.1",
"react": "17.0.2",
"react-native": "0.68.2",
"react-native-gesture-handler": "^2.6.2",
"react-native-gesture-handler": "^2.14.1",
"react-native-safe-area-context": "^4.4.1",
"react-native-safe-area-view": "^1.1.1",
"react-native-screens": "^3.18.2",
Expand Down
12 changes: 11 additions & 1 deletion example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import { NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';

const extole = new Extole('mobile-monitor.extole.io', 'react-native');
const jwt = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiIsImtpZCI6IjUzNmQwNWE2LTMzZWUtNDI2NC04ODI2LW" +
"JhZDRjOTAyMWZhZiJ9.eyJpc3MiOiJtb2JpbGUtc2RrLmV4dG9sZS5jb20iLCJhdWQiOlsiZXh0b2xlLmNvbSJ" +
"dLCJlbWFpbCI6InNka3BlcnNvbi1lbWFpbEBtYWlsb3NhdXIuY29tIiwiaWF0IjoxNzA1NTg0Mjg0LCJleHAiO" +
"jI0ODMxODQyODR9.XdB5-j58GcEeKqKkCLd5f_G78CLLJIHCmsfcOpH-n3o"
extole.identifyJwt(jwt, {})
const Stack = createStackNavigator();
export default function App() {
return (
Expand Down Expand Up @@ -40,8 +45,13 @@ function HomeScreen({ navigation }: { navigation: any }) {
.then(([zone, _campaign]) => {
setZone(zone);
}).catch((exception: any) => {
console.log('Unable to fetch zone', exception);
console.error('Unable to fetch zone', exception);
});
extole
.fetchZone('mobile_cta_timestamp')
.then(([zone, _campaign]) => {
console.log("Timestamp zone data", zone.getData())
});
}, []);

const onCtaButtonPress = () => {
Expand Down
Loading

0 comments on commit c65127f

Please sign in to comment.