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

iOS: add notification in RemoteMessage #224

Merged
merged 14 commits into from Nov 22, 2021

Conversation

ben-xD
Copy link
Contributor

@ben-xD ben-xD commented Nov 15, 2021

On iOS, the notification is kept inside the userInfo dictionary. To be consistent with Android, I extract the notification from this dictionary and pass it to the dart side.

This allows the RemoteMessage to contain a notification if one is sent when the app is the foreground, background or terminated. If receiving a push notification in the example app, it will now change from left screenshot to right screenshot. Notice, the original aps.alert object in Notification data is still there. I will not modify the data object or remove the any title/body fields, to avoid backwards compatibility issues with Ably users or confusion.
Frame 110

@ben-xD ben-xD added the enhancement New feature or improved functionality. label Nov 15, 2021
@ben-xD ben-xD self-assigned this Nov 15, 2021
@github-actions github-actions bot temporarily deployed to staging/pull/224/dartdoc November 15, 2021 11:49 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/224/dartdoc November 15, 2021 11:53 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/224/dartdoc November 15, 2021 12:01 Inactive
…ement/ios/notification-in-remote-message

# Conflicts:
#	example/lib/ui/push_notifications/push_notifications_sliver.dart
#	lib/src/platform/src/platform.dart
@ben-xD ben-xD changed the base branch from main to enhancement/remove-prefer-relative-imports November 17, 2021 17:32
@ben-xD ben-xD changed the base branch from enhancement/remove-prefer-relative-imports to enhancement/platform-initializer November 17, 2021 17:33
@github-actions github-actions bot temporarily deployed to staging/pull/224/dartdoc November 17, 2021 17:36 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/224/dartdoc November 17, 2021 17:40 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/224/dartdoc November 18, 2021 08:16 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/224/dartdoc November 18, 2021 09:46 Inactive
@github-actions github-actions bot temporarily deployed to staging/pull/224/dartdoc November 18, 2021 09:51 Inactive
…notification-in-remote-message

# Conflicts:
#	example/lib/ui/push_notifications/push_notifications_received_sliver.dart
#	example/lib/ui/push_notifications/push_notifications_sliver.dart
@github-actions github-actions bot temporarily deployed to staging/pull/224/dartdoc November 18, 2021 09:56 Inactive
ios/Classes/Notification.swift Outdated Show resolved Hide resolved
ios/Classes/Notification.swift Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to staging/pull/224/dartdoc November 18, 2021 10:02 Inactive
Use `[AnyHashable: Any]` instead of `NSDictionary`

Co-authored-by: Łukasz Szyszkowski <47628502+lukasz-szyszkowski@users.noreply.github.com>
@github-actions github-actions bot temporarily deployed to staging/pull/224/dartdoc November 18, 2021 10:07 Inactive
Co-authored-by: Łukasz Szyszkowski <47628502+lukasz-szyszkowski@users.noreply.github.com>
@github-actions github-actions bot temporarily deployed to staging/pull/224/dartdoc November 18, 2021 11:13 Inactive
Base automatically changed from enhancement/platform-initializer to main November 22, 2021 16:31
@ben-xD ben-xD merged commit 2172fc1 into main Nov 22, 2021
@ben-xD ben-xD deleted the enhancement/ios/notification-in-remote-message branch November 22, 2021 16:42
@ben-xD
Copy link
Contributor Author

ben-xD commented Nov 22, 2021

Oops, I pressed merge and assumed Github would protect me from merging when the tests are still running.

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.
Development

Successfully merging this pull request may close these issues.

None yet

4 participants