@@ -189,12 +189,12 @@ class AnalyticsReactNativeModule : ReactContextBaseJavaModule, ActivityEventList
189189
190190 val properties = Hashtable <String , String >()
191191
192- if (currentActivity == null ) {
192+ if (reactApplicationContext. currentActivity == null ) {
193193 Log .d(name, " No activity found" )
194194 return
195195 }
196196
197- val referrer = getReferrer(currentActivity!! )
197+ val referrer = getReferrer(reactApplicationContext. currentActivity!! )
198198
199199 if (referrer != null ) {
200200 val referringApplication = referrer.toString()
@@ -217,14 +217,14 @@ class AnalyticsReactNativeModule : ReactContextBaseJavaModule, ActivityEventList
217217 }
218218
219219 Log .d(name, " Sending Deeplink data to store: uri=${uri} , referrer=${referrer} " )
220- val sovran = (currentActivity?.application as ReactApplication )
220+ val sovran = (reactApplicationContext. currentActivity?.application as ReactApplication )
221221 ?.reactNativeHost
222222 ?.reactInstanceManager
223223 ?.currentReactContext
224224 ?.getNativeModule(SovranModule ::class .java)
225225 sovran?.dispatch(" add-deepLink-data" , properties)
226226
227-
227+
228228 }
229229
230230 fun setAnonymousId (anonymousId : String ) {
@@ -249,10 +249,10 @@ class AnalyticsReactNativeModule : ReactContextBaseJavaModule, ActivityEventList
249249 }
250250
251251 override fun onHostResume () {
252- if (currentActivity != null && isColdLaunch) {
252+ if (reactApplicationContext. currentActivity != null && isColdLaunch) {
253253 isColdLaunch = false
254- Log .d(name, " onHostResume = ${currentActivity!! .intent} " )
255- trackDeepLinks(currentActivity!! .intent)
254+ Log .d(name, " onHostResume = ${reactApplicationContext. currentActivity!! .intent} " )
255+ trackDeepLinks(reactApplicationContext. currentActivity!! .intent)
256256 }
257257 }
258258
0 commit comments