-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
[Mobile App] Issue 538: Enable push notifications for iOS #1032
[Mobile App] Issue 538: Enable push notifications for iOS #1032
Conversation
…d the Remote notifications
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
📝 WalkthroughWalkthroughThis pull request introduces iOS-specific configuration changes for a mobile application, focusing on push notification handling and entitlements. The modifications include updating the project's code signing settings, adding background notification support, configuring the APNs development environment, and enhancing the messaging repository's message handling logic. The changes aim to improve the app's notification capabilities and project configuration. Changes
Sequence DiagramsequenceDiagram
participant App
participant FirebaseMessaging
participant BackgroundHandler
App->>FirebaseMessaging: Initialize Notifications
FirebaseMessaging->>BackgroundHandler: Register Background Handler
alt Foreground Message
FirebaseMessaging->>App: _handleForegroundMessage()
else Background Message
FirebaseMessaging->>BackgroundHandler: _firebaseMessagingBackgroundHandler()
else Initial Message
App->>BackgroundHandler: _handleInitialMessage()
end
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
recipients_app/lib/data/repositories/messaging_repository.dart (4)
44-45
: Consider renaming_handleBackgroundMessage
when bound toonMessageOpenedApp
.The naming might be confusing since
onMessageOpenedApp
is specifically triggered upon user interaction.
63-66
: Implement or remove the TODO for foreground notifications.Would you like help implementing local notifications while the app is open?
69-73
: Implement or remove the TODO for background notifications.Consider finalizing this logic or removing the placeholder code.
75-78
: Streamline logic for initial messages.You could unify
_handleInitialMessage
with background/foreground handlers if similar steps are needed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
recipients_app/ios/Runner.xcodeproj/project.pbxproj
(11 hunks)recipients_app/ios/Runner/Info.plist
(1 hunks)recipients_app/ios/Runner/Runner.entitlements
(1 hunks)recipients_app/lib/data/repositories/messaging_repository.dart
(3 hunks)recipients_app/pubspec.yaml
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- recipients_app/pubspec.yaml
🔇 Additional comments (10)
recipients_app/ios/Runner/Runner.entitlements (1)
5-6
: LGTM! APNs environment is correctly configured.The
aps-environment
is set todevelopment
which is appropriate for development and testing push notifications.recipients_app/ios/Runner/Info.plist (1)
66-70
: LGTM! Background modes are properly configured.The required background modes for push notifications are correctly set:
remote-notification
: Enables receiving push notificationsfetch
: Allows background data refreshrecipients_app/ios/Runner.xcodeproj/project.pbxproj (1)
38-38
: LGTM! Entitlements are properly configured across all build configurations.The Runner.entitlements file is:
- Added to the project references
- Included in the Runner group
- Configured in all build configurations (dev, stage, prod)
Also applies to: 128-128, 445-445, 535-535, 622-622, 714-714, 804-804, 891-891, 978-978, 1123-1123, 1160-1160
recipients_app/lib/data/repositories/messaging_repository.dart (7)
6-12
: Great job ensuring background handler is not removed by tree shaking.This function is correctly annotated with
@pragma("vm:entry-point")
and simply logs and delegates toMessagingRepository.logRemoteMessage
.
22-22
: Be cautious about logging the FCM token.Access tokens can be sensitive. Consider omitting them or logging only in debug mode.
32-33
: Avoid printing current FCM token in production logs.Similar to line 22, tokens might be considered sensitive. Restrict logging or sanitize the token before logging.
35-38
: Good approach for handling terminated-state messages.This logic ensures that messages arriving before the app is started are handled properly.
41-42
: UsingonBackgroundMessage
is aligned with best practices.This enables background handling without blocking the main thread.
47-49
: Foreground notification handling is set up correctly.You’ve correctly wired a listener to
_handleForegroundMessage
.
85-97
: Review log data to prevent accidental PII exposure.
logRemoteMessage
prints various fields of theRemoteMessage
. Confirm these fields do not contain sensitive user data in production builds.
Followed the "Set up a Firebase Cloud Messaging client app on Flutter" guide and add the following:
Handling of Android notifications if the app is in the foreground, is still open. See #540
Summary by CodeRabbit
New Features
iOS Configuration
Version Update