From 330de34c7cc8fc6f34e3dec076f20ceb1af94927 Mon Sep 17 00:00:00 2001 From: greenart7c3 <115044884+greenart7c3@users.noreply.github.com> Date: Mon, 17 Feb 2025 15:09:37 -0300 Subject: [PATCH] [NIP-55] Make it clear how to use the package name and what is the purpose of the intents and content resolvers (#1791) --- 55.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/55.md b/55.md index 2b79f798..4adc6b74 100644 --- a/55.md +++ b/55.md @@ -10,7 +10,7 @@ This NIP describes a method for 2-way communication between an Android signer an # Usage for Android applications -The Android signer uses Intents and Content Resolvers to communicate between applications. +The Android signer uses Intents (to accept/reject permissions manually) and Content Resolvers (to accept/reject permissions automatically in background if the user allowed it) to communicate between applications. To be able to use the Android signer in your application you should add this to your AndroidManifest.xml: @@ -66,7 +66,7 @@ Create the Intent using the **nostrsigner** scheme: val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:$content")) ``` -Set the Signer package name: +Set the Signer package name after you receive the response from **get_public_key** method: ```kotlin intent.`package` = "com.example.signer" @@ -114,7 +114,6 @@ launcher.launch(intent) ```kotlin val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:")) - intent.`package` = "com.example.signer" intent.putExtra("type", "get_public_key") // You can send some default permissions for the user to authorize for ever val permissions = listOf( @@ -130,7 +129,7 @@ launcher.launch(intent) context.startActivity(intent) ``` - result: - - If the user approved intent it will return the **pubkey** in the result field + - If the user approved the intent it will return the **pubkey** in the result field and the signer packageName in the **package** field ```kotlin val pubkey = intent.data?.getStringExtra("result")