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

Questions about permissions #751

Closed
pandora-996 opened this issue Nov 12, 2021 · 10 comments
Closed

Questions about permissions #751

pandora-996 opened this issue Nov 12, 2021 · 10 comments

Comments

@pandora-996
Copy link

Screenrecorder-2021-11-12-17-12-22-753.mp4

When I request to open the file, the system pops up the permission application window. After I choose to reject, when I request to open the file again, the permission application window does not pop up again. How to pop up the permission application window again? thank you

当我请求打开文件时,系统弹出权限申请窗口。我选择拒绝后,再次请求打开文件时,并没有再次弹窗权限申请窗口。请问如何再次弹窗权限申请窗口。谢谢

@KojiNakamaru
Copy link
Member

Perhaps you are using an Android 11 device; if the user taps Deny more than once, it also means "don't ask again". Then the user can recover permissions only from Settings/Apps. For temporarily denying the permission request, the user should tap the Back button instead of tapping Deny.

cf. https://developer.android.com/about/versions/11/privacy/permissions

Personally I think that the previous behavior is more comprehensive, but this is the current behavior since Android 11.

@pandora-996
Copy link
Author

This problem also happens with my old phone. (Android 6 device)
The permission application window will pop up again only when the WebView is reopened.

这个问题在我旧手机也会发生。(Android 6 device)
只有重新打开webview,权限申请窗口才会重新弹出。

@KojiNakamaru
Copy link
Member

Thank you for the report about Android 6 device, as it was a good hint. I could reproduce the issue on Android 6 emulator and have fixed it in #752. Could you please try the latest?

@pandora-996
Copy link
Author

After the update, the system did not respond to a request to open the file.
Even for the first time, the system does not pop up the permission request window.

更新以后,当请求打开文件时,系统没有任何响应。
即使是第一次请求,系统也没有弹出权限请求窗口。

@KojiNakamaru
Copy link
Member

KojiNakamaru commented Nov 15, 2021

Did you uninstall the app and reinstall the new app? You should also enable Write Permission in Project Settings/Player/Other Settings/Configuration/Write Permission.

@pandora-996
Copy link
Author

In the case of "unity-webview", when I refuse and ask to open the file again, the permission request window pops up again.
But before entering the file selection, the application crashed.

In the case of "unity-webView-NoFragment", when I request to open a file, the system does not pop up a permission request window.
If "WritePermission" is set to "External (SDCard) ", the system will pop up a permission request window when opening the application.
However, no matter I choose to reject or agree, when I request to open the file, there is no file selection interface, and there is no popup permission request window.

(Tested on Android 10 device and android 11 device)

=============================================================================
在使用 "unity-webview" 的情况下,当我拒绝后并且再次请求打开文件时,系统可以再次弹出权限请求窗口。
但在进入文件选择前,应用崩溃了。

在使用 "unity-webview-nofragment" 的情况下,当我请求打开文件时,系统可以没有弹出权限请求窗口。
如果"WritePermission"选择了"External(SDCard)",系统会在打开应用时,弹出权限请求窗口。
但无论我选择拒绝还是同意,在我请求打开文件时,没有进入文件选择界面,并且没有弹出权限请求窗口。

KojiNakamaru added a commit that referenced this issue Nov 16, 2021
@KojiNakamaru
Copy link
Member

The unitywebview-nofragment edition doesn't support the file input tag as noted in README.md.

I've put the sample app that can be directly opened and built with Unity 2020.3.22f1:

https://github.com/gree/unity-webview/tree/sample-for-751

and the attached sample.zip contains sample.apk that was the actual app binary. I've tested it on my Android 9 device (Vankyo S7). I'll later check it on Android 11 device when I get home.

@pandora-996
Copy link
Author

In unity2020, everything is fine.
In unity2018, the application crashes when requested to open a file. (unity2018.4.33 f1)
In unity2018, when BuildSystem selects "Gradle", the build fails. Therefore, I chose "Internal" during the build. But the application crashed when it asked to open the file.

=================================================================
在unity2020,一切正常。
在unity2018,当请求打开文件时,应用会崩溃。(unity2018.4.33f1)
在unity2018,当BuildSystem 选择Gradle,构建会失败。所以,我选择了Internal在构建时。但是在请求打开文件时,应用崩溃了。

@KojiNakamaru
Copy link
Member

I've updated the branch for 2018.4.33f1. It can and should be built with gradle.

445c72b

As noted in https://github.com/gree/unity-webview/tree/ffbf3c103d136cb95ddc0433ef657499893fa4d9#package-manager, we cannot use Package Manager so this commit includes files extracted from unity-webview.zip.

@pandora-996
Copy link
Author

To build using Gradle, "SDK-28" is required.
I used "SDK-26" earlier, so the build failed.
Thank you very much for your help.

=================================================================
使用gradle来构建,需要"sdk-28"。
我之前使用了"sdk-26",所以构建失败了。
十分感谢您的帮助。

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