diff --git a/100.md b/100.md index 2c7b8f96..cddb8066 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**