Woo! Hooy!
We have just recieved your project brief and our expert will contact you shortly.
Send Again
Close
When we are building the application and we need permission so something we need to fetch contacts, notifications, and camera.Its better approach to take permission on starting of the application rather than again it says for permission.You can use PermissionScope to implement this feature. How to use PermissionScope library:-
1 |
let permissionScope = PermissionScope() |
1 2 3 4 5 6 7 8 9 10 11 |
// Set up permissions permissionScope.addPermission(LocationWhileInUsePermission(), message: "We use this to track\r\nwhere you live" ) permissionScope.addPermission(NotificationsPermission(notificationCategories: nil), message: "So that we can send you the latests updates straightaway" ) permissionScope.addPermission(PhotosPermission(), message: "So that we can access to your Photos from Camera roll" ) |
1 2 3 4 5 6 7 8 9 10 11 12 |
// Show permission dialog with callbacks permissionScope.show( { finished, results in print("Permissions state changed, results: \(results)") }, cancelled: { results in print("User closed the permission alert, results: \(results)") } ) |
1 2 3 4 5 |
if PermissionScope().statusLocationInUse() == .authorized { print("authorized") } |
Be the first to comment.