upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--55.md16
1 files changed, 8 insertions, 8 deletions
diff --git a/55.md b/55.md
index abc316e..c828768 100644
--- a/55.md
+++ b/55.md
@@ -8,7 +8,7 @@ Android Signer Application
8 8
9This NIP describes a method for 2-way communication between an Android signer and any Nostr client on Android. The Android signer is an Android Application and the client can be a web client or an Android application. 9This NIP describes a method for 2-way communication between an Android signer and any Nostr client on Android. The Android signer is an Android Application and the client can be a web client or an Android application.
10 10
11# Usage for Android applications 11## Usage for Android applications
12 12
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. 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
@@ -38,7 +38,7 @@ fun isExternalSignerInstalled(context: Context): Boolean {
38} 38}
39``` 39```
40 40
41## Using Intents 41### Using Intents
42 42
43To get the result back from the Signer Application 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. 43To get the result back from the Signer Application 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.
44 44
@@ -107,7 +107,7 @@ Send the Intent:
107launcher.launch(intent) 107launcher.launch(intent)
108``` 108```
109 109
110### Methods 110#### Methods
111 111
112- **get_public_key** 112- **get_public_key**
113 - params: 113 - params:
@@ -283,7 +283,7 @@ launcher.launch(intent)
283 val id = intent.data?.getStringExtra("id") 283 val id = intent.data?.getStringExtra("id")
284 ``` 284 ```
285 285
286## Using Content Resolver 286### Using Content Resolver
287 287
288To get the result back from Signer Application you should use contentResolver.query in Kotlin. If you are using another framework check the documentation of your framework or a third party library to get the result. 288To get the result back from Signer Application you should use contentResolver.query in Kotlin. If you are using another framework check the documentation of your framework or a third party library to get the result.
289 289
@@ -295,7 +295,7 @@ For the other types Signer Application returns the column "result"
295 295
296If the user chose to always reject the event, signer application will return the column "rejected" and you should not open signer application 296If the user chose to always reject the event, signer application will return the column "rejected" and you should not open signer application
297 297
298### Methods 298#### Methods
299 299
300- **get_public_key** 300- **get_public_key**
301 - params: 301 - params:
@@ -482,7 +482,7 @@ If the user chose to always reject the event, signer application will return the
482 } 482 }
483 ``` 483 ```
484 484
485# Usage for Web Applications 485## Usage for Web Applications
486 486
487You should consider using [NIP-46: Nostr Connect](46.md) for a better experience for web applications. When using this approach, the web app can't call the signer in the background, so the user will see a popup for every event you try to sign. 487You should consider using [NIP-46: Nostr Connect](46.md) for a better experience for web applications. When using this approach, the web app can't call the signer in the background, so the user will see a popup for every event you try to sign.
488 488
@@ -496,7 +496,7 @@ You can configure the `returnType` to be **signature** or **event**.
496 496
497Android intents and browser urls have limitations, so if you are using the `returnType` of **event** consider using the parameter **compressionType=gzip** that will return "Signer1" + Base64 gzip encoded event json 497Android intents and browser urls have limitations, so if you are using the `returnType` of **event** consider using the parameter **compressionType=gzip** that will return "Signer1" + Base64 gzip encoded event json
498 498
499## Methods 499### Methods
500 500
501- **get_public_key** 501- **get_public_key**
502 - params: 502 - params:
@@ -547,7 +547,7 @@ Android intents and browser urls have limitations, so if you are using the `retu
547 window.href = `nostrsigner:${eventJson}?compressionType=none&returnType=signature&type=decrypt_zap_event&callbackUrl=https://example.com/?event=`; 547 window.href = `nostrsigner:${eventJson}?compressionType=none&returnType=signature&type=decrypt_zap_event&callbackUrl=https://example.com/?event=`;
548 ``` 548 ```
549 549
550## Example 550### Example
551 551
552```js 552```js
553<!DOCTYPE html> 553<!DOCTYPE html>