Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
permission_handler
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
songyanzhi
permission_handler
Commits
0f630d5f
Commit
0f630d5f
authored
Oct 30, 2019
by
Tonghdj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[iOS] update requestPermission
parent
28bb7af0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
example/ios/Runner/Runner.entitlements
+8
-0
ios/Classes/strategies/NotificationPermissionStrategy.m
+4
-4
No files found.
example/ios/Runner/Runner.entitlements
0 → 100644
View file @
0f630d5f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist
version=
"1.0"
>
<dict>
<key>
com.apple.security.application-groups
</key>
<array/>
</dict>
</plist>
ios/Classes/strategies/NotificationPermissionStrategy.m
View file @
0f630d5f
...
...
@@ -23,10 +23,9 @@
completionHandler
(
status
);
return
;
}
dispatch_async
(
dispatch_get_main_queue
(),
^
{
if
(
@available
(
iOS
10
.
0
,
*
))
{
UNUserNotificationCenter
*
center
=
[
UNUserNotificationCenter
currentNotificationCenter
];
UNAuthorizationOptions
authorizationOptions
=
0
;
authorizationOptions
+=
UNAuthorizationOptionSound
;
authorizationOptions
+=
UNAuthorizationOptionAlert
;
...
...
@@ -36,7 +35,6 @@
completionHandler
(
PermissionStatusDenied
);
return
;
}
completionHandler
(
PermissionStatusGranted
);
}];
}
else
{
UIUserNotificationType
notificationTypes
=
0
;
...
...
@@ -45,8 +43,10 @@
notificationTypes
|=
UIUserNotificationTypeBadge
;
UIUserNotificationSettings
*
settings
=
[
UIUserNotificationSettings
settingsForTypes
:
notificationTypes
categories
:
nil
];
[[
UIApplication
sharedApplication
]
registerUserNotificationSettings
:
settings
];
completionHandler
(
PermissionStatusGranted
);
}
[[
UIApplication
sharedApplication
]
registerForRemoteNotifications
];
completionHandler
(
PermissionStatusGranted
);
});
}
+
(
PermissionStatus
)
permissionStatus
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment