kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
register our app to handle meshtastic urls
rodzic
44ebac1758
commit
e43e687766
app/src/main
java/com/geeksville/mesh
|
@ -100,7 +100,7 @@
|
|||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
<data
|
||||
android:scheme="http"
|
||||
android:scheme="https"
|
||||
android:host="www.meshtastic.org"
|
||||
android:pathPrefix="/c/" />
|
||||
</intent-filter>
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.Menu
|
||||
|
@ -215,6 +216,25 @@ class MainActivity : AppCompatActivity(), Logging,
|
|||
UIState.googleSignInClient = GoogleSignIn.getClient(this, gso);
|
||||
|
||||
*/
|
||||
|
||||
// Handle any intent
|
||||
handleIntent(intent)
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
handleIntent(intent)
|
||||
}
|
||||
|
||||
/// Handle any itents that were passed into us
|
||||
private fun handleIntent(intent: Intent) {
|
||||
val appLinkAction = intent.action
|
||||
val appLinkData: Uri? = intent.data
|
||||
|
||||
// Were we asked to open one our channel URLs?
|
||||
if (Intent.ACTION_VIEW == appLinkAction && appLinkData != null) {
|
||||
debug("Asked to open a channel URL")
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
|
Ładowanie…
Reference in New Issue