-
-
Notifications
You must be signed in to change notification settings - Fork 462
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
Local Network Permission #282
Comments
Hi! |
So you want to add network permission, right? |
I'd appreciate it if you could |
I am also very interested in the wireless data permission, I guess that is what you called the network permission right? |
Yes,in China, when the application is started for the first time, it will apply to the system for network permission. If the user accidentally prohibits the network permission, the application will not be able to access the network until the user goes to the setting center to open the wireless network permission. |
@z234009184 fully right, no way to simple manage this permission. I can to get state of permission and request it once. |
@z234009184 are you still need this permission? |
Yes, I think it is necessary to add network permissions as an extension, so that you can only use the PermissionsKit |
Ok, doing it |
I did some refresh. Available one way to request permission, but no way to get status correctly. Each time need to do request permission for get state. |
Hey I am coming from #280. I think the permission discussed in this issue is Wireless Data Permission not Local Network Permission. I am looking for solutions for both of these permissions. |
@yuchenz27 I think you right, my bad. If you have code share with me, I am ready to integrate it shortly |
@ivanvorobei There is no official access to these permissions. I have done some research on the Internet and found the following candidate solutions. For Wireless Data Permission, this code works https://stackoverflow.com/questions/25623272/how-to-use-scnetworkreachability-in-swift?noredirect=1&lq=1
For Local Network Permission, this code works https://stackoverflow.com/questions/63940427/ios-14-how-to-trigger-local-network-dialog-and-check-user-answer/65800221#65800221
The problem for these two solutions is that they trigger the permission dialog and return the permission status through a single function, so there is no way to just check the permission status without triggering the dialog for the first time (which makes sense because we will trigger the dialog for the first time anyway). In addition, for the second code snippet, if the user allows the permission, it will take about 0.5s to get the permission status (which is success) every time in the future sessions. On the contrary, if the user denies the permission, it will instantly return the denies status in the future sessions. |
@yuchenz27 thanks for your research! I will think how I can integrate it |
@ivanvorobei no problem, your plugin is awesome. I don't think those solutions are perfect, probably there is a better way. |
Just a reminder, the code I left for Wireless Data Permission is not actually for the permission. It just checks if there is a valid network connection. So if you grant the permission and close the cellular data on your iPhone, it will still return false. |
@yuchenz27 both permissions not true public API, so it make some logic and happen request. Its not clean solution, but best which we can propose to developers. |
Feature Description
Describe what functionality you want to see.
Thank you for your development of this library. I have a small demand. When the application is started for the first time, it mistakenly touches that it is not allowed to use the network permission. How can I know that the user does not open the network permission and let the user go to the setting page to open the network permission?
The text was updated successfully, but these errors were encountered: