Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Show notification shelf with notification_referrer_id #268

Open
danopia opened this issue May 18, 2022 · 2 comments
Open

Show notification shelf with notification_referrer_id #268

danopia opened this issue May 18, 2022 · 2 comments

Comments

@danopia
Copy link

danopia commented May 18, 2022

Hi, reviving #237 because it seems possible to generate the ID which makes notification deeplinks easier to 'action' after opening.

gitify-app/gitify#519 shows another project implementing the token as effectively:

btoa(`018:NotificationThread${notificationId}:${userId}`)

I've noticed that the notifications page is using a different format now, and I built this expression for it, though I'm not sure what the 6 leading bytes represent:

'NT_'+btoa(`\x93\x00\xCD\x9E\xB4\xB0${notificationId}:${userId}`).replace(/=+$/, '')

Both of these expressions create working tokens for me. I'd like to confer with another user about the binary in the newer tokens to see if it's the same for everyone. But the old tokens seem pretty straightforward to try out too!

Of course, it's possible that the tokens will change / stop working someday, and it should leave the tool back at the current functionality. So it seems reasonable to try.
The only other complication is getting user id. Either letting the user opt-in to the feature by adding a User ID box in settings, or asking for a scope that will include the user endpoint.

If this feature is still considered out of scope for the project, I apologize for the noise! I installed this tool a couple days ago and have been really enjoying the UX of the desktop notifications. Being able to hit 'done' too would make it that much better.

@Nadrieril
Copy link

Nadrieril commented Apr 17, 2024

Tried this today (2 years later), and you approach seems to work, except the magic bits I needed were '\x93\x00\xCE\x00\x67\x82\xa6\xb2'. I don't know if it's because GitHub has changed since or if these bits are user-specific in some way.

PS: tysm for figuring this out, I've now got notification shelf working for a small cli tool I'm building!

@danopia
Copy link
Author

danopia commented Apr 18, 2024

Thanks for the extra info. I just clicked an arbitrary notification and got the magic bytes \x93\x00\xCD\x9E\xB4\xB1 which is only one bit off from the sample in my 2022 comment. And I checked with a second Github user which has yet another string of arbitrary bytes. So there's definitely some extra user-specific magic to this value, rather unfortunate. (I tried finding more independent research on Google and landed back at this thread. 😄)

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants