upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgreenart7c3 <115044884+greenart7c3@users.noreply.github.com>2025-02-17 15:09:37 -0300
committerGitHub <noreply@github.com>2025-02-17 13:09:37 -0500
commit330de34c7cc8fc6f34e3dec076f20ceb1af94927 (patch)
treef98f7d60c01eaab7ddfe00508132bd9a063bfb54
parent8e6f2c06c3ec88a6c478a783825ff1b07e1972fa (diff)
[NIP-55] Make it clear how to use the package name and what is the purpose of the intents and content resolvers (#1791)
-rw-r--r--55.md7
1 files changed, 3 insertions, 4 deletions
diff --git a/55.md b/55.md
index 2b79f79..4adc6b7 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
10 10
11# Usage for Android applications 11# Usage for Android applications
12 12
13The Android signer uses Intents and Content Resolvers to communicate between applications. 13The 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.
14 14
15To be able to use the Android signer in your application you should add this to your AndroidManifest.xml: 15To be able to use the Android signer in your application you should add this to your AndroidManifest.xml:
16 16
@@ -66,7 +66,7 @@ Create the Intent using the **nostrsigner** scheme:
66val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:$content")) 66val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:$content"))
67``` 67```
68 68
69Set the Signer package name: 69Set the Signer package name after you receive the response from **get_public_key** method:
70 70
71```kotlin 71```kotlin
72intent.`package` = "com.example.signer" 72intent.`package` = "com.example.signer"
@@ -114,7 +114,6 @@ launcher.launch(intent)
114 114
115 ```kotlin 115 ```kotlin
116 val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:")) 116 val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:"))
117 intent.`package` = "com.example.signer"
118 intent.putExtra("type", "get_public_key") 117 intent.putExtra("type", "get_public_key")
119 // You can send some default permissions for the user to authorize for ever 118 // You can send some default permissions for the user to authorize for ever
120 val permissions = listOf( 119 val permissions = listOf(
@@ -130,7 +129,7 @@ launcher.launch(intent)
130 context.startActivity(intent) 129 context.startActivity(intent)
131 ``` 130 ```
132 - result: 131 - result:
133 - If the user approved intent it will return the **pubkey** in the result field 132 - If the user approved the intent it will return the **pubkey** in the result field and the signer packageName in the **package** field
134 133
135 ```kotlin 134 ```kotlin
136 val pubkey = intent.data?.getStringExtra("result") 135 val pubkey = intent.data?.getStringExtra("result")