Samuel
However I do have a backend set up so if I had to that it wouldn’t be the end of the world
1 1
Skeets App
Am looking into that as well. What endpoint are you registering device tokens against? At least on iOS you cannot register decices against the official bsky backend because of differing signing keys (app, backend).
1 1
Skeets App
Even if you connect your FCM to your APNS account (which is possible), how are you getting the notifications from Bluesky to YOUR FCM instance?
2 2
Skeets App
As far as I understand the library it only handles the client-side of push notifications. The issue I have is that i don’t see a way to enable bsky to push notifications to firebase/apns that then get delivered to 3rd party apps. For that to work bsky would need the 3rd party‘s push certificate.
1
Samuel
Hmm not sure. The way the official app works is that it gets the device push token and sends it to bsky
2 1
Skeets App
Yeah and then bsky sends the push notifications using that token and a shared certificate (shared btw app and backend). APNS checks if the app it sends the notifications to has a matching certificate. That’s the problem I see. 3rd party apps have their own push credentials.
1 2
Ansh
Check the official app. You can register a push token for users with your particular push endpoint and it should work for Graysky. Email me if you have issues at ansh [at] blueskyweb [dot] xyz
3 4
Ansh
It’s under notifications lexicon. Docs aren’t there yet unfortunately :/
1 2
Samuel
You give the api a token, an appId, and a serviceDid. The service DID tells bsky where to send notifications, which you then send to devices using APN/FCM
1 1 2
shreyan (wise)
ah, so you run your own server, and it receives a webhook-shaped thing and then can decide how to forward to devices. makes sense, i think
1 3
Samuel
My plan is to send it to a nextjs edge function and then onto firebase/apn. although the js push notification ecosystem seems terrible so I might have to choose between self hosted gorush (tricky) or something like OneSignal (vendor lock-in :/ )
1 1
1 more reply
Skeets App
What is the endpoint for? Will this be my „server“-endpoint that gets notified when there is a new push notification (and then delivers that push itself)? Or does bsky send the pushes to e.g. APNS directly? I always thought device tokens were bound to the bundle-id and the push cert? 🤷‍♂️
2
Ansh
The code looks something like this store.agent.api.app.bsky.notification.registerPush({ serviceDid: SERVICE_DID(store.session.data?.service), platform: devicePlatform, token: t, appId: 'xyz.blueskyweb.app', Notice how you can send an appId
2 5
Samuel
Wait nvm I finally found where it makes the request to the server - it’s the same xrpc registerPush endpoint
1 3
Samuel
Host a did.json file in your backend and then use did:web:mybackend.com as the serviceDid
1
Samuel
So in summary your backend needs two routes /.well-known/did.json (Serves the DID document) /xrpc/app.bsky.notification.registerPush (Receives push tokens) The rest is on you
1 2
Yomama
Hi Sam, sorry for a sudden bump to old post. I have made a route for those. I received a POST from bsky verbatim when I call registerPush. But still I don’t get any notifs for any activties I did to authed user.
1
1 more reply
Skeets App
Have you out tried what will actually be sent to this endpoint? I'm looking for some way to authenticate accounts against my backend and was hoping this would be the way
1 1
1 more reply
Ansh
Right now the service DID is the Bsky App View but it can be your own service too if you want. We’ll just forward the data there
1 2
Skeets App
Ok. So that can be just a URL? What’s the data flow if I don’t set the service? I mean bsky cannot deliver data to APNS for my app without the push cert, can it?
1
Skeets App
Thanks! I already went through that file a while ago. As far as I understand it hands off push notifications to gorush. gorush will probably be setup with the official bluesky app's APN certificate, which AFAIK means it will only be able to send push notifications to that specific app.
1 1
Ansh
Yes that is correct. Gorush has our own certificate. However we designed this system to allow 3rd party devs to do notifications easily. Can you email me and we can chat more there?
2 4