-
Notifications
You must be signed in to change notification settings - Fork 16
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
docs: update permission section in PushNotifications
documentation
#546
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes enhance the Changes
Poem
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: 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
flutter-permission-handler
package for cross-platform support.