Did you grant permissions to Pokey?
The latest version of #Pokey is using Amber, presumably for auth to DM inboxes. It correctly calls Amber, and starts the service after I've authenticated, but it's also throwing up a toast message saying "Amber not installed". nostr:nprofile1qqsxg45ph8gx0vdrvtzta6xal7v86frx6jvstsnvhrlvtehmwwh4epqpzamhxue69uhhyetvv9ujuvrcvd5xzapwvdhk6tcpz4mhxue69uhhyetvv9ujuerpd46hxtnfduhsz9nhwden5te0v4jx2m3wdehhxarj9ekxzmny9ua2vh28 any idea of what this problem is? It just an errant toast message? Or do you think there's something actually going wrong?

Discussion
Yes, I approve the request like normal, and it starts the service normally. I haven't received an DM yet so I'm not sure if DM notifications are working, but non-auth notifications are fine. It just keeps putting up that toast message.
I just tested it on my second device and the same thing is happening. I authenticate with Amber, and the Pokey service starts but puts up that toast notification.
Ok, so I'm not getting notifications on DMs. I've tried removing my Pokey permissions from Amber and starting fresh, but no matter what I do I'm unable to get DM notifications.
Maybe nostr:nprofile1qqs827g8dkd07zjvlhh60csytujgd3l9mz7x807xk3fewge7rwlukxgpz4mhxue69uhhyetvv9ujuerpd46hxtnfduhszrnhwden5te0dehhxtnvdakz7qgswaehxw309ahx7um5wghx6mmd9usjfpck can help us here. Any idea why the code is reaching this point? https://github.com/KoalaSat/pokey/blob/5c746991be6152c09909e901a5ec31ba79ea34a1/app/src/main/java/com/koalasat/pokey/models/ExternalSigner.kt#L28
If it matters, I'm using Amber v2.0.8-free
Its supposed to only reach this code of he rejects the permission or the app is not installed. Maybe force closing amber and them opening it again fixes it
I tried reinstalling Amber, and reinstalling Pokey. I've tried force-closing and restarting both apps. No matter what I do I get that fail toast.
And this is happening on two separate devices.
Also, I checked in Amber, and my Pokey entry has a full set of approved permissions, so I'm thinking the problem is either with Pokey, or maybe some FUBAR communication problem between Amber and Pokey. Because I wouldn't be seeing all these permissions in Amber if it didn't authenticate properly.

Im trying to reproduce here but no luck yet
It's so weird. Not sure how the problem could be present on both of my devices, but not able to reproduce on another device. The only things my two devices have in common are they're both Samsungs, and they're on the same network 🤔
Do you think it's worth trying a different variation of Amber, such as the offline version?
Sure
No joy. Using the offline version produces the same problem. I get that "Amber not Installed" toast.
I really don't think the problem is with Amber because Amber works just fine with literally every other app. The only other issue I had with Amber was with using bunker with Ditto. And you helped me resolve that. I strongly suspect the problem lies with Pokey, or with the communication between Amber and Pokey.
Just doing some quick debugging and I think it's related to relay authorization/subscribing, when I add a key that has some dud relays on its relay list I get the following errors in Logcat (the same number as dud relays):
```
ActivityThread com.koalasat.pokey.debug E Failed to find provider info for .SIGN_EVENT
ActivityThread com.koalasat.pokey.debug E Failed to find provider info for .SIGN_EVENT
ActivityThread com.koalasat.pokey.debug E Failed to find provider info for .SIGN_EVENT
```
When I add a key with good relays, I don't get this error
I'll dig a little more and see if there's an issue/PR to file
Digging deeper, it seems to be related to the npub being sent by Pokey to Amber in the "current_user" Intent field for Relay auth. Pokey is sending an empty string which Amber is converting to a hex string and signing the Auth event with, which in turn is being rejected by the Relay, which causes the error. At least *I think so* - because debugging IPC is complicated! When I change the null check in Amber to be isNullOrEmpty() then the error goes away.

That's really interesting, thanks is for you work!! But what I am supposed to send if I'm actually using that request to get the npub?
You're welcome, I've been working on NIP-55 integration for a while so I'm always interested in these edge cases. I think the issue lies in the bogus hex key that Amber generates from the empty npub string. It needs more testing with various pubkeys combinations, but changing the null check in Amber fixes the problem for me. I'm happy to raise an issue, the bug is easily reproducible with the right test keys, the only question is which repo - Pokey, Amber or both?
The issue is in the get public key method pr when hes trying to auth to a relay?
Can you send a pull request to fix the null check?
Let me know if you'd like me confirm that this fix resolves the original problem of auth failing and that "Amber not installed" toast being generated before you publish an updated Amber release.
nostr:nprofile1qqs827g8dkd07zjvlhh60csytujgd3l9mz7x807xk3fewge7rwlukxgpz4mhxue69uhhyetvv9ujuerpd46hxtnfduhszrnhwden5te0dehhxtnvdakz7qgswaehxw309ahx7um5wghx6mmd9usjfpck is tagged in this thread, so let's see what he has to say about it. Awesome debugging work! Nothing gives me the tingles like collaboration! When you say "dud relay" does that mean that the issue ultimately stems from a bad relay defined in Amber?
By "dud relay" I meant a relay specified in the key's relay list which isn't accepting notes, either because the key isn't authorized or there's something wrong with the relay and it's rejecting all messages. Looking at it more deeply, it's possible it's just any relay that requires authorization, so if you have one or more of them on your relay list than that might be what's causing the Amber not found message.
Oh I see. Could it be that one or more of the relays is paid? Because I have two paid relays defined as my outbox relays, and one paid relay defined as my DM Inbox relay.
I'll test it out, I think that updating ExternalSignerLauncher with the pubkey once I got it might solve the thing
I all, I just released a new version, can somebody test it out?
If it's still happening I believe the only option is to apply that change on Amber
I'm not getting the error with the latest build. Passing the pubkey seems to have fixed the issue but I'll still make a PR on the empty string pubkey since Amber should (imho) probably treat it the same as a null value
I just sent a new pull request. It wasnt calling amber with content resolver and it wasnt replying the auth event to the relay
Thanks!
I'm no longer getting the "Amber not installed" error, and looking at my Pokey entry in Amber, a full suite of permissions is now associated. It's looking real good!