upleb.uk

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

summaryrefslogtreecommitdiff
path: root/55.md
diff options
context:
space:
mode:
authorVitor Pamplona <vitor@vitorpamplona.com>2024-11-01 08:54:46 -0400
committerGitHub <noreply@github.com>2024-11-01 08:54:46 -0400
commitc275ae74eb0070ad7ac5fe2482fdfb91fc99f4ff (patch)
tree8e65a01092b214c63a8e7653d590f9e976bf95f8 /55.md
parent5bcb2d834a8533ae657606a42d91169661e06369 (diff)
parent03a555beb58296bef326f6469bbcf2b73ea144f6 (diff)
Merge pull request #1367 from greenart7c3/nip_55_flags
NIP-55: Add intent flags to open the signer once when sending multiple events
Diffstat (limited to '55.md')
-rw-r--r--55.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/55.md b/55.md
index 54dc44a..afca0aa 100644
--- a/55.md
+++ b/55.md
@@ -72,6 +72,35 @@ Set the Signer package name:
72intent.`package` = "com.example.signer" 72intent.`package` = "com.example.signer"
73``` 73```
74 74
75If you are sending multiple intents without awaiting you can add some intent flags to sign all events without opening multiple times the signer
76
77```kotlin
78intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP)
79```
80
81If you are developing a signer application them you need to add this to your AndroidManifest.xml so clients can use the intent flags above
82
83```kotlin
84android:launchMode="singleTop"
85```
86
87Signer MUST answer multiple permissions with an array of results
88
89```kotlin
90
91val results = listOf(
92 Result(
93 package = signerPackageName,
94 result = eventSignture,
95 id = intentId
96 )
97)
98
99val json = results.toJson()
100
101intent.putExtra("results", json)
102```
103
75Send the Intent: 104Send the Intent:
76 105
77```kotlin 106```kotlin