mirror of
https://github.com/greenart7c3/Amber.git
synced 2026-10-05 19:08:23 +00:00
add example of multiple return when using intents
This commit is contained in:
@@ -106,6 +106,14 @@ intent.`package` = "com.greenart7c3.nostrsigner"
|
||||
- If the user approved intent it will return the **signature**, **id** and **event** fields
|
||||
|
||||
```kotlin
|
||||
// if you used the flags (Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP) when sending the intent and there's more than 1 event amber will return an array with the results
|
||||
[
|
||||
{"package":null,"signature":"event_signature","id":"event_id"},
|
||||
{"package":null,"signature":"event_signature","id":"event_id"},
|
||||
{"package":null,"signature":"event_signature","id":"event_id"}
|
||||
]
|
||||
|
||||
// if you sent only 1 event or did not used the flags (Intent.FLAG_ACTIVITY_SINGLE_TOP or Intent.FLAG_ACTIVITY_CLEAR_TOP) Amber will return the fields signature, id and event
|
||||
val signature = intent.data?.getStringExtra("signature")
|
||||
// the id you sent
|
||||
val id = intent.data?.getStringExtra("id")
|
||||
|
||||
Reference in New Issue
Block a user