Skip to content

Commit

Permalink
fix requestNotificationPermissions api (flutter#761)
Browse files Browse the repository at this point in the history
* fix requestNotificationPermissions api
  • Loading branch information
huangminlinux authored and kroikie committed Oct 18, 2018
1 parent b235438 commit 50a283b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions packages/firebase_messaging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.0.2

* Use boolean values when checking for notification types on iOS.

## 2.0.1

* Bump Android dependencies to latest.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result
if ([@"requestNotificationPermissions" isEqualToString:method]) {
UIUserNotificationType notificationTypes = 0;
NSDictionary *arguments = call.arguments;
if (arguments[@"sound"]) {
if ([arguments[@"sound"] boolValue]) {
notificationTypes |= UIUserNotificationTypeSound;
}
if (arguments[@"alert"]) {
if ([arguments[@"alert"] boolValue]) {
notificationTypes |= UIUserNotificationTypeAlert;
}
if (arguments[@"badge"]) {
if ([arguments[@"badge"] boolValue]) {
notificationTypes |= UIUserNotificationTypeBadge;
}
UIUserNotificationSettings *settings =
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_messaging/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for Firebase Cloud Messaging, a cross-platform
messaging solution that lets you reliably deliver messages on Android and iOS.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_messaging
version: 2.0.1
version: 2.0.2

flutter:
plugin:
Expand Down

0 comments on commit 50a283b

Please sign in to comment.