upleb.uk

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

summaryrefslogtreecommitdiff
path: root/100.md
diff options
context:
space:
mode:
authorgreenart7c3 <greenart7c3@proton.me>2024-01-22 11:25:25 -0300
committergreenart7c3 <greenart7c3@proton.me>2024-01-22 11:25:25 -0300
commitc55678b30740c1aa4aa968239fb21fb05c38a92c (patch)
tree92ca1916378e56186e965d1c81029fa8f8c03c1d /100.md
parente050386b849d0d293903a46646c89233bf19f489 (diff)
change androidmanifest.xml, add rejected collumn if user chose to always reject some event kind
Diffstat (limited to '100.md')
-rw-r--r--100.md24
1 files 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
10 10
11The Android signer uses Intents and Content Resolvers to communicate between applications. 11The Android signer uses Intents and Content Resolvers to communicate between applications.
12 12
13To be able to use The Android signer in your application you should add the package name of the signer to your AndroidManifest.xml: 13To be able to use The Android signer in your application you should this to your AndroidManifest.xml:
14 14
15```xml 15```xml
16<queries> 16<queries>
17 <package android:name="com.example.signer"/> 17 <intent>
18 <action android:name="android.intent.action.VIEW" />
19 <category android:name="android.intent.category.BROWSABLE" />
20 <data android:scheme="nostrsigner" />
21 </intent>
18</queries> 22</queries>
19``` 23```
20 24
25Then you can use this function to check if there's a signer application installed:
26
27```kotlin
28fun isExternalSignerInstalled(context: Context): Boolean {
29 val intent =
30 Intent().apply {
31 action = Intent.ACTION_VIEW
32 data = Uri.parse("nostrsigner:")
33 }
34 val infos = context.packageManager.queryIntentActivities(intent, 0)
35 return infos.size > 0
36}
37```
38
21## Using Intents 39## Using Intents
22 40
23To 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. 41To 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 "
221 239
222For the other types Signer Application returns the column "signature" 240For the other types Signer Application returns the column "signature"
223 241
242If the user chose to always reject the event signer application will return the column "rejected" and you should not open signer application
243
224### Methods 244### Methods
225 245
226- **get_public_key** 246- **get_public_key**