Skip to content
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

Access denied #61

Closed
florolf1 opened this issue Nov 13, 2018 · 17 comments
Closed

Access denied #61

florolf1 opened this issue Nov 13, 2018 · 17 comments

Comments

@florolf1
Copy link

Reproduce: Presenting SPRequest.Dialog -> Denie access (e.g. for camera) -> you will not see the altert to get directed to settings.

This worked with the last version.

@florolf1 florolf1 reopened this Nov 13, 2018
@ivanvorobei
Copy link
Member

Please, describe more

@ivanvorobei
Copy link
Member

Oh, I undestand... I will added it new version, and now now close this issue. Thanks!

@florolf1
Copy link
Author

(y) thank you.
Btw. do your code provide any kind of completion handler?!
E.g. you want to build a camera application (camera is initial view controller). The normal way is to ask for permission in ViewDidLoad (If PermissionStatus is .notAuthorized you won't configure the session). In ViewDidAppear you do the same thing and start the session if the permission is authorized.
In order to use your code (bzw. really nice design (y)) i need a completion handler to implement PermissionDialog in ViewDidAppear method. Do your code provide anything like this?!

@ivanvorobei
Copy link
Member

@florolf1 please, use delegate and method didHide

@florolf1
Copy link
Author

i will give it a try, thanks

@florolf1
Copy link
Author

florolf1 commented Nov 19, 2018

i just tried the new version, and the issue is still not fixed?!

if you present the permission dialog and e.g. don't allow "PhotoLibrary" access, the button isn't changed to "denied" and you are not directed to Settings app in order to fix it.

This function worked with the old version (without the new layout).

@ivanvorobei
Copy link
Member

@florolf1 I will add this functionality soon

@florolf1
Copy link
Author

There is a problem with notification. I doesn't change to "allowed" after allowing it.
If i request notification permission during app start, SPPermissionDialog ist not updating the button.

I will use the last version as long you haven't fix the important things.
But the layout look really nice, good work(y)

@ivanvorobei
Copy link
Member

@florolf1 you tested in simulator?

@florolf1
Copy link
Author

Nope, i tested it on a device.

I just translated you "old" version to swift 4.2 and tried all those functions. They are working.

@ivanvorobei
Copy link
Member

@florolf1 in simulator notification not available for register by iOS. For testing notification permission - use real device only. In the previous version notification management same

@ivanvorobei
Copy link
Member

@florolf1 I am intall 2.1.1 now for empty project, all work correctly. You allow notification permission is setting of project?

@florolf1
Copy link
Author

I tested all those functions on a real device.
To reproduce the issue:
Go to AppDelegate: implement the following in "didFinishLaunchWithOptions"

    UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge], completionHandler: {didAllow, error in
        if didAllow{
            
        }
        
    })

Allow Notification
Next step: Open SPPermissionDialog and check the buttons.
I did this with Microphone,Camera and Library. They worked fine.
Notification didn't work.

@ivanvorobei
Copy link
Member

@florolf1
I see the bug. I will solve it. Thank!

@ivanvorobei
Copy link
Member

ivanvorobei commented Nov 20, 2018

@florolf1 I am find bug in your code.
You should use

 UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge], completionHandler: {didAllow, error in
        if didAllow{
            
        }
        
    })

application.registerForRemoteNotifications() // IMPORTANT HERE LINE

@florolf1
Copy link
Author

Declaration:
func registerForRemoteNotifications()

Discussion:
Call this method to initiate the registration process with Apple Push Notification service..

I don't use push notifications service in this application. But thank you (y)

@ivanvorobei
Copy link
Member

@florolf1

about push notifications service, sorry, but project check it only by register. This is due to the architecture of the project

About alert after denied permission (alert). I'm afraid I can not add it, because now after opening to the settings and allow permission, the application restarts. Previously, this was not and I believe that this will be inconvenient. I'm sorry.

I close this issue. Thanks for your feedback. Write if you have questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants