clarify var names
This commit is contained in:
+5
-5
@@ -11,14 +11,14 @@ import expo.modules.kotlin.Promise
|
|||||||
|
|
||||||
class ExpoGetReferrerModule : Module() {
|
class ExpoGetReferrerModule : Module() {
|
||||||
private var intent: Intent? = null
|
private var intent: Intent? = null
|
||||||
private var referrer: Uri? = null
|
private var activityReferrer: Uri? = null
|
||||||
|
|
||||||
override fun definition() = ModuleDefinition {
|
override fun definition() = ModuleDefinition {
|
||||||
Name("ExpoGetReferrer")
|
Name("ExpoGetReferrer")
|
||||||
|
|
||||||
OnNewIntent {
|
OnNewIntent {
|
||||||
intent = it
|
intent = it
|
||||||
referrer = appContext.currentActivity?.referrer
|
activityReferrer = appContext.currentActivity?.referrer
|
||||||
}
|
}
|
||||||
|
|
||||||
AsyncFunction("getReferrerInfoAsync") {
|
AsyncFunction("getReferrerInfoAsync") {
|
||||||
@@ -38,11 +38,11 @@ class ExpoGetReferrerModule : Module() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// In all other cases, we'll just record the app that sent the intent.
|
// In all other cases, we'll just record the app that sent the intent.
|
||||||
if (referrer != null) {
|
if (activityReferrer != null) {
|
||||||
// referrer could become null here. `.toString()` though can be called on null
|
// referrer could become null here. `.toString()` though can be called on null
|
||||||
return@AsyncFunction mapOf(
|
return@AsyncFunction mapOf(
|
||||||
"referrer" to referrer.toString(),
|
"referrer" to activityReferrer.toString(),
|
||||||
"hostname" to (referrer?.host ?: ""),
|
"hostname" to (activityReferrer?.host ?: ""),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user