From f9cafd2a38274a70891bc569e8a49d3f2fe757e7 Mon Sep 17 00:00:00 2001 From: greenart7c3 Date: Wed, 17 Jul 2024 08:08:22 -0300 Subject: [PATCH] Fix missing info when sending multiple requests to the signer and a missing option when the user reject an event forever --- 55.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/55.md b/55.md index 4565e8c3..7ea49408 100644 --- a/55.md +++ b/55.md @@ -70,6 +70,12 @@ Set the Signer package name: intent.`package` = "com.example.signer" ``` +If you are sending multiple intents without awaiting you can add some intent flags to sign all events without opening multiple times the signer + +```kotlin +intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP) +``` + Send the Intent: ```kotlin @@ -263,7 +269,7 @@ For the SIGN_EVENT type Signer Application returns two columns "signature" and " For the other types Signer Application returns the column "signature" -If the user chose to always reject the event, signer application will return the column "rejected" and you should not open signer application +If the user chose to always reject the event, signer application will return the column "rejected" when you send "1" as the third parameter in `contentResolver.query` and you should not open signer application ### Methods @@ -274,7 +280,7 @@ If the user chose to always reject the event, signer application will return the val result = context.contentResolver.query( Uri.parse("content://com.example.signer.GET_PUBLIC_KEY"), listOf("login"), - null, + "1", null, null ) @@ -299,7 +305,7 @@ If the user chose to always reject the event, signer application will return the val result = context.contentResolver.query( Uri.parse("content://com.example.signer.SIGN_EVENT"), listOf("$eventJson", "", "${logged_in_user_npub}"), - null, + "1", null, null ) @@ -325,7 +331,7 @@ If the user chose to always reject the event, signer application will return the val result = context.contentResolver.query( Uri.parse("content://com.example.signer.NIP04_ENCRYPT"), listOf("$plainText", "${hex_pub_key}", "${logged_in_user_npub}"), - null, + "1", null, null ) @@ -349,7 +355,7 @@ If the user chose to always reject the event, signer application will return the val result = context.contentResolver.query( Uri.parse("content://com.example.signer.NIP44_ENCRYPT"), listOf("$plainText", "${hex_pub_key}", "${logged_in_user_npub}"), - null, + "1", null, null ) @@ -373,7 +379,7 @@ If the user chose to always reject the event, signer application will return the val result = context.contentResolver.query( Uri.parse("content://com.example.signer.NIP04_DECRYPT"), listOf("$encryptedText", "${hex_pub_key}", "${logged_in_user_npub}"), - null, + "1", null, null ) @@ -397,7 +403,7 @@ If the user chose to always reject the event, signer application will return the val result = context.contentResolver.query( Uri.parse("content://com.example.signer.NIP44_DECRYPT"), listOf("$encryptedText", "${hex_pub_key}", "${logged_in_user_npub}"), - null, + "1", null, null ) @@ -421,7 +427,7 @@ If the user chose to always reject the event, signer application will return the val result = context.contentResolver.query( Uri.parse("content://com.example.signer.DECRYPT_ZAP_EVENT"), listOf("$eventJson", "", "${logged_in_user_npub}"), - null, + "1", null, null )