From c55678b30740c1aa4aa968239fb21fb05c38a92c Mon Sep 17 00:00:00 2001 From: greenart7c3 Date: Mon, 22 Jan 2024 11:25:25 -0300 Subject: [PATCH] change androidmanifest.xml, add rejected collumn if user chose to always reject some event kind --- 100.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/100.md b/100.md index 2c7b8f9..cddb806 100644 --- a/100.md +++ b/100.md @@ -10,14 +10,32 @@ This NIP describes a method for 2-way communication between a android signer and The Android signer uses Intents and Content Resolvers to communicate between applications. -To be able to use The Android signer in your application you should add the package name of the signer to your AndroidManifest.xml: +To be able to use The Android signer in your application you should this to your AndroidManifest.xml: ```xml - + + + + + ``` +Then you can use this function to check if there's a signer application installed: + +```kotlin +fun isExternalSignerInstalled(context: Context): Boolean { + val intent = + Intent().apply { + action = Intent.ACTION_VIEW + data = Uri.parse("nostrsigner:") + } + val infos = context.packageManager.queryIntentActivities(intent, 0) + return infos.size > 0 +} +``` + ## Using Intents To get the result back from the Signer Appication you should use registerForActivityResult or rememberLauncherForActivityResult in Kotlin. If you are using another framework check the documentation of your framework or a third party library to get the result. @@ -221,6 +239,8 @@ For the SIGN_EVENT type Signer Application returns two columns "signature" and " For the other types Signer Application returns the column "signature" +If the user chose to always reject the event signer application will return the column "rejected" and you should not open signer application + ### Methods - **get_public_key**