mirror of
https://github.com/nostr-protocol/nips.git
synced 2025-12-09 08:38:50 +00:00
Compare commits
4 Commits
10002-on-n
...
alexgleaso
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50f649652c | ||
|
|
ebe5ec3b38 | ||
|
|
330de34c7c | ||
|
|
8e6f2c06c3 |
6
05.md
6
05.md
@@ -101,3 +101,9 @@ Users should ensure that their `/.well-known/nostr.json` is served with the HTTP
|
|||||||
The `/.well-known/nostr.json` endpoint MUST NOT return any HTTP redirects.
|
The `/.well-known/nostr.json` endpoint MUST NOT return any HTTP redirects.
|
||||||
|
|
||||||
Fetchers MUST ignore any HTTP redirects given by the `/.well-known/nostr.json` endpoint.
|
Fetchers MUST ignore any HTTP redirects given by the `/.well-known/nostr.json` endpoint.
|
||||||
|
|
||||||
|
### Implementing a NIP-05 server
|
||||||
|
|
||||||
|
NIP-05 is designed so that `nostr.json` can be hosted as a static file. But some services may allow users to sign up and be granted a NIP-05. The `nostr.json` is then served dynamically, depending on the `name` query parameter.
|
||||||
|
|
||||||
|
For these servers, the **case** of the localpart should be considered. It is recommended to make the lowercase representation unique in the database, so that two people cannot reserve the same name in different cases (eg `chad` vs `Chad`). Servers may then serve any case variation of the name, allowing users to freely change the case of their name. However, the name in the server's response MUST match the case provided by the `name` query parameter.
|
||||||
|
|||||||
7
55.md
7
55.md
@@ -10,7 +10,7 @@ This NIP describes a method for 2-way communication between an Android signer an
|
|||||||
|
|
||||||
# Usage for Android applications
|
# Usage for Android applications
|
||||||
|
|
||||||
The Android signer uses Intents and Content Resolvers 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.
|
||||||
|
|
||||||
To be able to use the Android signer in your application you should add this to your AndroidManifest.xml:
|
To be able to use the Android signer in your application you should add this to your AndroidManifest.xml:
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ Create the Intent using the **nostrsigner** scheme:
|
|||||||
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:$content"))
|
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:$content"))
|
||||||
```
|
```
|
||||||
|
|
||||||
Set the Signer package name:
|
Set the Signer package name after you receive the response from **get_public_key** method:
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
intent.`package` = "com.example.signer"
|
intent.`package` = "com.example.signer"
|
||||||
@@ -114,7 +114,6 @@ launcher.launch(intent)
|
|||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:"))
|
val intent = Intent(Intent.ACTION_VIEW, Uri.parse("nostrsigner:"))
|
||||||
intent.`package` = "com.example.signer"
|
|
||||||
intent.putExtra("type", "get_public_key")
|
intent.putExtra("type", "get_public_key")
|
||||||
// You can send some default permissions for the user to authorize for ever
|
// You can send some default permissions for the user to authorize for ever
|
||||||
val permissions = listOf(
|
val permissions = listOf(
|
||||||
@@ -130,7 +129,7 @@ launcher.launch(intent)
|
|||||||
context.startActivity(intent)
|
context.startActivity(intent)
|
||||||
```
|
```
|
||||||
- result:
|
- result:
|
||||||
- If the user approved intent it will return the **pubkey** in the result field
|
- If the user approved the intent it will return the **pubkey** in the result field and the signer packageName in the **package** field
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
val pubkey = intent.data?.getStringExtra("result")
|
val pubkey = intent.data?.getStringExtra("result")
|
||||||
|
|||||||
Reference in New Issue
Block a user