register our app to handle meshtastic urls

This commit is contained in:
Kevin Hester
2020-03-02 08:54:57 -08:00
parent 44ebac1758
commit e43e687766
2 changed files with 21 additions and 1 deletions

View File

@@ -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() {