-
Notifications
You must be signed in to change notification settings - Fork 18
docs: update permission section in PushNotifications
documentation
#546
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes expand and restructure the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (5)
✨ Finishing Touches🧪 Generate Unit Tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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: 4
Outside diff range and nitpick comments (3)
PushNotifications.md (3)
192-193
: Ensure Consistent Heading CapitalizationThe heading "Notification Permissions using
permission_handler
package" 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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#requestPermission
methodAfter marking the
Push#requestPermission
method 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
PushNotifications
documentation:permission_handler
packageSummary by CodeRabbit
permission_handler
Flutter package for cross-platform support.