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

Implement Push Notifications listener #141

Closed
ben-xD opened this issue Jul 22, 2021 · 3 comments · Fixed by #166
Closed

Implement Push Notifications listener #141

ben-xD opened this issue Jul 22, 2021 · 3 comments · Fixed by #166
Assignees
Labels
enhancement New feature or improved functionality.

Comments

@ben-xD
Copy link
Contributor

ben-xD commented Jul 22, 2021

In ably-java and ably-cocoa, it was the customer/ developer's responsibility to set up listeners for push notifications, e.g. inheriting from Firebase classes. To make it convenient, we should allow users to listen/ react to push notification messages without writing Flutter "package plugins" which involves writing native (java, obj-c, kotlin or swift) code themselves.

  • Allow users to configure notifications to show even when App is in the foreground.
  • In iOS, the remoteNotification handler has a completion handler, where the user should tell the OS if the download succeeded, failed or that there was no new data. We should allow users to specify this to comply with iOS.
  • In iOS: We need to replace the Push Notification delegate singleton (we should replace it but save the original one and call it inside the delegate methods). This is important to avoid breaking functionality in other plugins used by the user. See this discussion in Slack: https://ably-real-time.slack.com/archives/CSQEKCE81/p1627656347010000. This will be done in the next PR.
  • At this point, integration tests can be written fully in dart, to make sure background messages arrive. Additionally, there may be a way to check that UI notifications are received by Android devices. Test device activation, subscription, receiving messages and deactivation #153

┆Issue is synchronized with this Jira Story by Unito

@ably-sync-bot
Copy link

ably-sync-bot commented Aug 18, 2021

➤ Nik Silver commented:

On hold (18 Aug 2021) until Quintin returns from holiday and we can discuss with him and Andrey. At the current time it doesn’t seem necessary for the user we're discussing it with, so safe to put on hold.

@QuintinWillison
Copy link
Contributor

Indeed, for the current user's case on which we're focussed this is not needed as they already have these callbacks implemented in their own platform native code.

However, going forwards I do feel that for us to offer a complete, plug-and-play solution for Flutter developers then we should not be requiring them to write their app in anything other than Dart. As such we should be providing these native callback implementations plus Dart-side interfaces for them to consume them from Flutter.

@ben-xD
Copy link
Contributor Author

ben-xD commented Aug 27, 2021

TODOs in the code:

  • Remove the PushMessagingService from example app: including PushMessagingService.java and .PushMessagingService service declaration in the manifest
  • Make ably-java and firebase-messaging implementation dependencies in android/build.gradle instead of api, since users won't need to use these dependencies themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improved functionality.
3 participants