Skip to content

Commit

Permalink
Android update: Add check for multiple Tealium instances during initi…
Browse files Browse the repository at this point in the history
…alization (#177)

* Android update: Add check for multiple Tealium instances during initialization
  • Loading branch information
tamayok authored Aug 21, 2024
1 parent f8f0d2e commit 99d9f56
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

[Full documentation](https://docs.tealium.com/platforms/react-native/install/)

- 2.4.2
- Android fix: added check during initialization to ensure only a single instance of Tealium is running. Pre-existing instances are shutdown.

- 2.4.1
- Update Tealium dependencies to the latest on both platforms
- Android-Kotlin: Core 1.6.0, Tag Management 1.2.3, Remote Commands 1.4.0
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ PODS:
- tealium-react-native-swift (~> 2.4)
- tealium-swift/Core (~> 2.12)
- TealiumFirebase (~> 3.2)
- tealium-react-native (2.4.1):
- tealium-react-native (2.4.2):
- React-Core
- tealium-swift/Collect (~> 2.13)
- tealium-swift/Core (~> 2.13)
Expand All @@ -512,7 +512,7 @@ PODS:
- tealium-react-native-swift (~> 2.4)
- tealium-swift/Core (~> 2.12)
- tealium-swift/Location (~> 2.12)
- tealium-react-native-swift (2.4.1):
- tealium-react-native-swift (2.4.2):
- React-Core
- tealium-react-native
- tealium-swift/Collect (~> 2.13)
Expand Down Expand Up @@ -796,10 +796,10 @@ SPEC CHECKSUMS:
tealium-react-attribution: 5db8c4ccf60c0fea4790afc5a47537d4a198592c
tealium-react-braze: f72256073bf99902dbfbfcd875399cd0fac61796
tealium-react-firebase: 44bc3f5f8294a0f9fc2fba5ebd109bde31a141e5
tealium-react-native: c3cc2065e6fc6f16be13e02a50726a56db3fb8cf
tealium-react-native: c28c9edf54a59a261d910de52923cac338299d9a
tealium-react-native-crash-reporter: b6bbb018f2d3fc1c27a0423aca58c33820395d41
tealium-react-native-location: 7f275669c9434c0877e8ba20af06ac37c003657f
tealium-react-native-swift: 6b483c1f6fc082e23384ec4d36f0fbb05f5b3dd2
tealium-react-native-swift: a846102e391e9ae6fa3bd87331c078acf9d306d8
tealium-swift: f2a1d022bae58151c7ff31d2a063008cfe6463d8
TealiumAdjust: 7a8c033c93f5aaf306ebecaa2e575a5958e55e87
TealiumAdobeVisitorAPI: dd487f3e130829a15b9cdc7de7b2841a200214e2
Expand Down
2 changes: 1 addition & 1 deletion npm-package/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ buildscript {
}
}

version = "2.4.1"
version = "2.4.2"
android {
compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ class TealiumReact(private val reactContext: ReactApplicationContext) : ReactCon
@ReactMethod
fun initialize(configMap: ReadableMap, callback: Callback?) {
getApplication()?.let { app ->
if (tealium != null) {
terminateInstance()
}

configMap.toTealiumConfig(app)?.let { config ->
optionalModules.forEach { module ->
try {
Expand Down Expand Up @@ -100,7 +104,7 @@ class TealiumReact(private val reactContext: ReactApplicationContext) : ReactCon
return app
}

private fun createRemoteCommands(commands: ReadableArray) {
internal fun createRemoteCommands(commands: ReadableArray) {
for (i in 0 until commands.size()) {
val cmd = commands.getMap(i)
if (cmd is ReadableMap) {
Expand Down
Loading

0 comments on commit 99d9f56

Please sign in to comment.