mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-10-09 20:33:00 +02:00
NIP-55: Fix heading levels (#2022)
This commit is contained in:
16
55.md
16
55.md
@@ -8,7 +8,7 @@ Android Signer Application
|
|||||||
|
|
||||||
This 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.
|
This 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.
|
||||||
|
|
||||||
# Usage for Android applications
|
## Usage for Android applications
|
||||||
|
|
||||||
The 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.
|
The 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.
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ fun isExternalSignerInstalled(context: Context): Boolean {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using Intents
|
### Using Intents
|
||||||
|
|
||||||
To 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.
|
To 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.
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ Send the Intent:
|
|||||||
launcher.launch(intent)
|
launcher.launch(intent)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Methods
|
#### Methods
|
||||||
|
|
||||||
- **get_public_key**
|
- **get_public_key**
|
||||||
- params:
|
- params:
|
||||||
@@ -283,7 +283,7 @@ launcher.launch(intent)
|
|||||||
val id = intent.data?.getStringExtra("id")
|
val id = intent.data?.getStringExtra("id")
|
||||||
```
|
```
|
||||||
|
|
||||||
## Using Content Resolver
|
### Using Content Resolver
|
||||||
|
|
||||||
To 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.
|
To 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.
|
||||||
|
|
||||||
@@ -295,7 +295,7 @@ For the other types Signer Application returns the column "result"
|
|||||||
|
|
||||||
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" and you should not open signer application
|
||||||
|
|
||||||
### Methods
|
#### Methods
|
||||||
|
|
||||||
- **get_public_key**
|
- **get_public_key**
|
||||||
- params:
|
- params:
|
||||||
@@ -482,7 +482,7 @@ If the user chose to always reject the event, signer application will return the
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
# Usage for Web Applications
|
## Usage for Web Applications
|
||||||
|
|
||||||
You 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.
|
You 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.
|
||||||
|
|
||||||
@@ -496,7 +496,7 @@ You can configure the `returnType` to be **signature** or **event**.
|
|||||||
|
|
||||||
Android 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
|
Android 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
|
||||||
|
|
||||||
## Methods
|
### Methods
|
||||||
|
|
||||||
- **get_public_key**
|
- **get_public_key**
|
||||||
- params:
|
- params:
|
||||||
@@ -547,7 +547,7 @@ Android intents and browser urls have limitations, so if you are using the `retu
|
|||||||
window.href = `nostrsigner:${eventJson}?compressionType=none&returnType=signature&type=decrypt_zap_event&callbackUrl=https://example.com/?event=`;
|
window.href = `nostrsigner:${eventJson}?compressionType=none&returnType=signature&type=decrypt_zap_event&callbackUrl=https://example.com/?event=`;
|
||||||
```
|
```
|
||||||
|
|
||||||
## Example
|
### Example
|
||||||
|
|
||||||
```js
|
```js
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
Reference in New Issue
Block a user