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

Add notifications #33

Open
skjiisa opened this issue May 19, 2021 · 3 comments
Open

Add notifications #33

skjiisa opened this issue May 19, 2021 · 3 comments
Labels
feature New major feature to be added help wanted Extra attention is needed

Comments

@skjiisa
Copy link
Owner

skjiisa commented May 19, 2021

It would be nice to be able to set a time to give a notification if a track isn't ticked that day.

Unfortunately, I don't know how to do this with iCloud sync. The app could set and update local notifications on launch, but if you tick a day on one device, I don't know how to make it so other devices delete their local notification.

This might be possible with CloudKit push notifications, but if it is, I don't know how.

@skjiisa skjiisa added help wanted Extra attention is needed feature New major feature to be added labels May 19, 2021
@skjiisa
Copy link
Owner Author

skjiisa commented Jun 30, 2021

From some testing, it seems like this is possible, but it might not be reliable if the app is closed (to be clear, it works when the app is in the background, but I'm not sure if it works after the app has been force closed).

By making a CKQuerySubscription to the CloudKit Core Data record and setting its shouldSendContentAvailable to true, we can add a UIApplicationDelegateAdaptor to App and use didReceiveRemoteNotification to get and process silent CloudKit notifications.

@skjiisa
Copy link
Owner Author

skjiisa commented Nov 4, 2021

Notifications not syncing in the background might actually be fine. Looks like other apps like Due don't do this. The widget sync actually ended up working better than expected, so if we also update the notifications when the widget syncs, that could make the notification experience a lot better for users who use both notifications and the widget.

@skjiisa
Copy link
Owner Author

skjiisa commented Nov 4, 2021

This could maybe be locked behind a premium feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New major feature to be added help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant