File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed
android/src/main/java/com/onesignal/flutter Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ static void registerWith(BinaryMessenger messenger) {
52
52
public void onMethodCall (MethodCall call , Result result ) {
53
53
if (call .method .contentEquals ("OneSignal#permission" ))
54
54
replySuccess (result , OneSignal .getNotifications ().getPermission ());
55
+ else if (call .method .contentEquals ("OneSignal#canRequest" ))
56
+ replySuccess (result , OneSignal .getNotifications ().getCanRequestPermission ());
55
57
else if (call .method .contentEquals ("OneSignal#requestPermission" ))
56
58
this .requestPermission (call , result );
57
59
else if (call .method .contentEquals ("OneSignal#removeNotification" ))
Original file line number Diff line number Diff line change @@ -59,11 +59,7 @@ class OneSignalNotifications {
59
59
/// Whether attempting to request notification permission will show a prompt.
60
60
/// Returns true if the device has not been prompted for push notification permission already.
61
61
Future <bool > canRequest () async {
62
- if (Platform .isIOS) {
63
- return await _channel.invokeMethod ("OneSignal#canRequest" );
64
- } else {
65
- return false ;
66
- }
62
+ return await _channel.invokeMethod ("OneSignal#canRequest" );
67
63
}
68
64
69
65
/// Removes a single notification.
You can’t perform that action at this time.
0 commit comments