Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / AR Permissions issue

Author
Message
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 30th May 2018 12:46
I'm having trouble with an AR game I have published. When testing with broadcast and when installing the APK locally it all works fine, but when installing the game from the Play store, you can't see the AR background (this is the video feed from the camera). It just appears as a black screen. However, if the user goes into settings and manually updates the permissions for the app to allow camera then it starts working.

I have the camera option checked in the export settings, but I had to manually update the manifest.xml to include...

...for google Play Store to accept the APK (because of the AR Core stuff). I'm not sure if that is what is messing up the camera permissions. I've tinkering some more with the manifest but still having the same problem.

If I true updating <uses-feature android:name="android.hardware.camera" android:required="false" /> to <uses-feature android:name="android.hardware.camera" android:required="true" />, then I get the error when trying to upload the APK to Play Store:
" Upload failed

The uses-feature android.hardware.camera.ar is required in in the AndroidManifest.xml file when a dependency on ARCore is specified as required."

Does anyone have any permissions experience who could help with this? Thanks!


=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 30th May 2018 14:31
@CJB - Is this one of the times where the RequestPermission() command comes into play?

Taken from the AppGameKit Help
Quote: "Only for Android, all other platforms will do nothing. Generates a system dialog asking the user for the specified device permission, used by certain Android commands. The permissions are as follows
"WriteExternal" - used by the SaveSharedVariable commands and any "raw:" paths that access the sdcard.
"Location" - used by the GPS commands
"Camera" - used by the SetDeviceCameraToImage command
"RecordAudio" - used by the StartScreenRecording command
You can check the result of the request by calling CheckPermission. After the first request Android will give the user the option to stop displaying the request dialog. In this case this command will no longer generate a request dialog and instead do nothing. The user will have to go into the device app settings to reverse this decision. "


I notice there is a camera option there, but it says nothing about AR. Worth a try tho perhaps?
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 30th May 2018 15:56
Yes. Thanks prof. Paul came back with similar info. I tried adding the following to my app:



However it still fails. Should I expect a permission request dialogue or something? Nothing happens at all with the above code, it's like those lines aren't even in the app.
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 30th May 2018 16:15 Edited at: 30th May 2018 16:40
https://www.appgamekit.com/documentation/Reference/Extras/RequestPermission.htm

Maybe use....Request Permission () on app startup before any attempt is made to access the camera or stream to an image.

I found that when I dont allow permission then allow it later it doesn't update.
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 30th May 2018 16:40
Sorry ...double post...my internet link on a train is terrible
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 30th May 2018 16:41 Edited at: 30th May 2018 16:58
Quote: "Maybe use....RequestPermission ()"

Yep. That's the command I'm using. Obviously I don't want to ask the user for permission EVERY time they launch the app, hence the little bit of code to checkpermission in the if statement. I'm basically saying "If the user hasn't already given permission to use the camera, then request permission to use the camera".
Do you think I should just strip all that away and ONLY put the RequestPermission("Camera") command in its place? Worth a try I suppose...

Hey! That appears to have worked Just tested with a local APK install and it popped up a message asking for permission to use the camera. Sweet! Uploading update to Play Store now... Thanks

Login to post a reply

Server time is: 2024-11-18 12:24:38
Your offset time is: 2024-11-18 12:24:38