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

DRAFT: Add initial implementation for iOS push notifications using APNs #1095

Closed
wants to merge 1 commit into from

Conversation

hjiangsu
Copy link
Member

@hjiangsu hjiangsu commented Jan 29, 2024

Pull Request Description

This is a draft PR which adds the ability to handle apple push notification service (APNs).

To do this, I'm using a package push which handles platform specific implementations for iOS and Android. For iOS, it uses APNs (apple push notification service). For Android, it uses FCM (Firebase Cloud Messaging). I'm only implementing the iOS platform specific implementation here. Ideally, we can ignore the Android specific portions, and use UnifiedPush for Android devices. Whether or not this is possible is up in the air as we would have multiple packages handling push notifications on Android (may clash with each other).

Additionally, implementing push notifications requires a separate server in order to perform notification polling and sending out push notifications for devices. I've set up a simple server to handle this for now, and the domain is https://thunderapp.dev.

There is still a lot of work required for this to function properly. I'll add a to-do list here:

  • Set up endpoint on the server to store device token and JWT token. The device token is required in order for APNs to work since it needs to know which device to send push notifications to. The JWT token is required to poll for new notifications. Ideally, Lemmy can implement a better method authentication so that it does not require the JWT token.
  • Setup encryption for device token and JWT. We want to make sure that both the device token and JWT are encrypted through transit to prevent malicious actors from accessing the information. I'll need to perform more research on this and understand the implications of it.
  • Setup server to perform periodic polling for new notifications, and send out push notifications. This step should be relatively straight-forward.

While I'm developing the server code, I'll keep it closed-source. I'll most likely make it open-source once I'm done with all the local testing (to ensure that no keys are accidentally committed to the repository)

Another note: I've shifted the notification logic and moved it from 'mainintoThunderApp`. I hope this still works with the local notification logic!

Issue Being Fixed

Issue Number: #219

Screenshots / Recordings

Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-01-29.at.10.59.01.mp4

Checklist

  • Did you update CHANGELOG.md?
  • Did you use localized strings where applicable?
  • Did you add semanticLabels where applicable for accessibility?

Copy link
Member

@micahmo micahmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting!!

I'll try to do a more thorough review and also re-test on Android when ready!

@hjiangsu
Copy link
Member Author

Closing this draft in favour of #1237.

@hjiangsu hjiangsu closed this Mar 25, 2024
@hjiangsu hjiangsu deleted the feature/ios-push-notifications branch March 25, 2024 19:14
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.

2 participants