docs: update permission section in PushNotifications documentation#546
docs: update permission section in PushNotifications documentation#546
PushNotifications documentation#546Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Disabled knowledge base sources:
WalkthroughReplaces the iOS-only "Notification Permissions" section in PushNotifications.md with cross-platform guidance, recommends Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
Outside diff range and nitpick comments (3)
PushNotifications.md (3)
192-193: Ensure Consistent Heading CapitalizationThe heading "Notification Permissions using
permission_handlerpackage" should use Title Case for consistency with the rest of the document. Consider capitalizing "Using" to match the style of other headings.Apply this diff to correct the heading capitalization:
-#### Notification Permissions using `permission_handler` package +#### Notification Permissions Using `permission_handler` Package
194-194: Remove Extra Space Between WordsThere's an extra space between "the" and the
[flutter-permission-handler]link. Removing it will improve readability.Apply this diff:
-However, we recommend using the [flutter-permission-handler](https://github.com/baseflow/flutter-permission-handler) package due to its reliable cross-platform support for both iOS and Android. +However, we recommend using the [flutter-permission-handler](https://github.com/baseflow/flutter-permission-handler) package due to its reliable cross-platform support for both iOS and Android.
216-216: Ensure Consistent Heading CapitalizationFor consistency, capitalize "iOS Only" in the heading.
Apply this diff:
-#### Built-in Notification Permissions Management (iOS only) +#### Built-in Notification Permissions Management (iOS Only)
76949d8 to
718964d
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
Outside diff range and nitpick comments (1)
PushNotifications.md (1)
Line range hint
229-254: Update documentation to reflect deprecation ofPush#requestPermissionmethodAfter marking the
Push#requestPermissionmethod as deprecated, the documentation should be updated to guide users towards the recommended alternative for handling notification permissions on iOS. Continuing to instruct users to use a deprecated method may cause confusion.Apply this diff to update the documentation:
-// Create an Ably client to access the push field -final realtime = ably.Realtime(options: clientOptions); -final push = realtime.push; -// Request permission from user on iOS -bool permissionGranted = await push.requestPermission(); -// Get more information about the notification settings -if (Platform.isIOS) { - final notificationSettings = await realtime.push.getNotificationSettings(); -} +// Request notification permission +PermissionStatus status = await Permission.notification.request(); + +if (status.isGranted) { + // Handle permission granted +} else { + // Handle permission denied +}
14ebc2a to
9a8aaef
Compare
Updated permission section in
PushNotificationsdocumentation:permission_handlerpackageSummary by CodeRabbit