Skip to content

Commit

Permalink
Add a appName parameter for web apps
Browse files Browse the repository at this point in the history
greenart7c3 committed Dec 18, 2024
1 parent d1e1034 commit 6c1c733
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -133,6 +133,7 @@ object IntentUtils {
var compressionType = CompressionType.NONE
var callbackUrl: String? = null
var returnType = ReturnType.SIGNATURE
var appName = ""
parameters.joinToString("?").split("&").forEach {
val params = it.split("=").toMutableList()
val parameter = params.removeAt(0)
@@ -166,6 +167,9 @@ object IntentUtils {
returnType = ReturnType.EVENT
}
}
if (parameter == "appName") {
appName = parameterData
}
}

when (type) {
@@ -186,7 +190,7 @@ object IntentUtils {
onReady(
IntentData(
localData,
"",
appName,
type,
pubKey,
"",
@@ -221,7 +225,7 @@ object IntentUtils {
onReady(
IntentData(
localData,
"",
appName,
type,
pubKey,
"",
@@ -243,7 +247,7 @@ object IntentUtils {
onReady(
IntentData(
localData,
"",
appName,
type,
pubKey,
"",
@@ -265,7 +269,7 @@ object IntentUtils {
onReady(
IntentData(
localData,
"",
appName,
type,
pubKey,
"",
@@ -624,7 +628,10 @@ object IntentUtils {
}

val callbackUrl = intent.extras?.getString("callbackUrl") ?: ""
val name = if (callbackUrl.isNotBlank()) Uri.parse(callbackUrl).host ?: "" else ""
var name = if (callbackUrl.isNotBlank()) Uri.parse(callbackUrl).host ?: "" else ""
if (name.isBlank()) {
name = intent.extras?.getString("appName") ?: ""
}
val pubKey = intent.extras?.getString("pubKey") ?: intent.extras?.getString("pubkey") ?: ""
val id = intent.extras?.getString("id") ?: ""

0 comments on commit 6c1c733

Please sign in to comment.