Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Allow push notifications via Expo #2

Merged
merged 5 commits into from
Jul 19, 2021
Merged

Conversation

jesseplusplus
Copy link
Owner

From the push documentation:

Mastodon natively supports the Web Push API. You can utilize the same mechanisms for your native app. It requires running a proxy server that connects to Android’s and Apple’s proprietary notification gateways.

For apps built with Expo, push notifications can be sent directly to the Expo push server instead of running the proxy server yourself.

This modifies the web push subscription and worker to add an expo option. A subscription with an expo token does not encrypt the notification, and so doesn't generate the keys for encryption. I did this because I had some trouble generating the kind of keys the server would be happy with. I tried using the elliptic-expo module with each of the secp256k1, p256, and curve25519 curves with no luck. There is no sensitive information in the payload since notifications are of the form 'XXXX followed you', so I'm just going to the skip the encryption for non-web-push notifications.

@jesseplusplus jesseplusplus merged commit a1738d4 into freq-main Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant