Skip to content

Commit cd12763

Browse files
authored
feat: send the WrapperSdk type to the kit (#229)
1 parent cc2f40a commit cd12763

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

android/src/main/java/com/mparticle/react/rokt/MPRoktModuleImpl.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import com.mparticle.MParticle
1515
import com.mparticle.MpRoktEventCallback
1616
import com.mparticle.RoktEvent
1717
import com.mparticle.UnloadReasons
18+
import com.mparticle.WrapperSdk
1819
import com.mparticle.rokt.CacheConfig
1920
import com.mparticle.rokt.RoktConfig
2021
import kotlinx.coroutines.Job
@@ -24,6 +25,10 @@ import kotlinx.coroutines.launch
2425
class MPRoktModuleImpl(
2526
private val reactContext: ReactApplicationContext,
2627
) {
28+
init {
29+
MParticle.getInstance()?.setWrapperSdk(WrapperSdk.WrapperSdkReactNative, "")
30+
}
31+
2732
private var roktEventHandler: MpRoktEventCallback? = null
2833

2934
private val eventSubscriptions = mutableMapOf<String, Job?>()

android/src/newarch/java/com/mparticle/react/rokt/MPRoktModule.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ import java.util.concurrent.CountDownLatch
1717
class MPRoktModule(
1818
private val reactContext: ReactApplicationContext,
1919
) : NativeMPRoktSpec(reactContext) {
20-
init {
21-
MParticle.getInstance()?.setWrapperSdk(WrapperSdk.WrapperSdkReactNative, "")
22-
}
2320

2421
private val impl = MPRoktModuleImpl(reactContext)
2522

android/src/oldarch/java/com/mparticle/react/rokt/MPRoktModule.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import com.facebook.react.bridge.ReadableMap
66
import com.facebook.react.uimanager.NativeViewHierarchyManager
77
import com.facebook.react.uimanager.UIManagerModule
88
import com.mparticle.MParticle
9-
import com.mparticle.WrapperSdk
109
import com.mparticle.internal.Logger
1110
import com.mparticle.react.NativeMPRoktSpec
1211
import com.mparticle.rokt.RoktEmbeddedView
@@ -15,10 +14,6 @@ import java.lang.ref.WeakReference
1514
class MPRoktModule(
1615
private val reactContext: ReactApplicationContext,
1716
) : NativeMPRoktSpec(reactContext) {
18-
init {
19-
MParticle.getInstance()?.setWrapperSdk(WrapperSdk.WrapperSdkReactNative, "")
20-
}
21-
2217
private val impl = MPRoktModuleImpl(reactContext)
2318

2419
override fun getName(): String = impl.getName()

ios/RNMParticle/RNMPRokt.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ - (void)selectPlacements:(NSString *)identifer
9090
MPRoktConfig *config = [self buildRoktConfigFromDict:roktConfig];
9191
#endif
9292

93+
[MParticle _setWrapperSdk_internal:MPWrapperSdkReactNative version:@""];
9394
// Create callback implementation
9495
MPRoktEventCallback *callbacks = [[MPRoktEventCallback alloc] init];
9596

0 commit comments

Comments
 (0)