The fantastic of us at Alby helped resolve this ->
First, add question intent to manifest:
<queries>
<intent>
<motion android:title="android.intent.motion.VIEW" />
<knowledge android:scheme="lightning" />
</intent>
</queries>
Second, question getalby.com for encoded lnurl:
val requestUrl = "https://getalby.com/lnurlp/bitanon/callback?quantity=1000000&remark=good day" // quantity is in millisats
val consumer = OkHttpClient()
val request = Request.Builder().url(requestUrl).construct()
val response = consumer.newCall(request).await()
Third, parse json response for ‘pr’ which comprises encoded lnurl.
Fourth, ship Lightning PayRequest Android Intent, which can open with machine lightning pockets of your alternative:
val intent = Intent(Intent.ACTION_VIEW).apply {
knowledge = Uri.parse("lightning:$lnurl")
}
if (intent.resolveActivity(packageManager) != null) {
startActivity(intent)
}
Fifth, parse and deal with extra response information, similar to transaction verification url and so on.
