Remove permission prompt

Looking for a little help,

Not sure why my app is requesting permission to “allow access to photos, media and files on device”. This only happens after I live build it and beta install on devices. The only permission in the build settings was to access the internet since I have a link in my app, but I have removed that and the app still has the prompt. The only other thing I can thing of is where we save the json file on the device for save game data. I have tried the different system directories but after each build I still receive the prompt upon install.

Does anyone know why I could be getting this prompt on install? My app doesn’t need any access and I would like to get rid of it.

I tried to look for the androidmanifest and target build for a higher api but that hasn’t worked.

Thanks,

It could be a required permission from a plugin. Can you post your build.settings for us to look at?

Rob

Yes, no prob:

– For more information on build.settings see the Corona SDK Build Guide at:

https://docs.coronalabs.com/guide/distribution/buildSettings

settings =

{

orientation =

{

– Supported values for orientation:

– portrait, portraitUpsideDown, landscapeLeft, landscapeRight

default = “landscapeLeft”,

supported = { “landscapeLeft”,“landscapeRight” },

},

excludeFiles =

{

– Include only the necessary icon files on each platform

–iphone = { “Icon-*dpi.png”, },

–android = { “Icon.png”, “Icon-Small-*.png”, “Icon*@2x.png”, },

},

– iOS Section

iphone =

{

plist =

{

UIStatusBarHidden = false,

UIPrerenderedIcon = true, – set to false for “shine” overlay

–UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend

CFBundleIconFiles =

{

“Icon.png”,

“Icon@2x.png”,

“Icon-167.png”,

“Icon-60.png”,

“Icon-60@2x.png”,

“Icon-60@3x.png”,

“Icon-72.png”,

“Icon-72@2x.png”,

“Icon-76.png”,

“Icon-76@2x.png”,

“Icon-Small.png”,

“Icon-Small@2x.png”,

“Icon-Small@3x.png”,

“Icon-Small-40.png”,

“Icon-Small-40@2x.png”,

“Icon-Small-50.png”,

“Icon-Small-50@2x.png”,

},

},

},

– Android Section

android =

{

usesPermissions =

{

},

},

}

(fyi, its very minimal)

or could it come from requiring this sprite file?:

https://drive.google.com/open?id=1spiasauokwNpKZCG9ZzK9gjyRxLZzKSN

I didn’t see anything in the sprite.lua file that would want to access the camera or the photo library. You’re not using any plugins that could inject any permissions for you. Is this on Android or iOS?

Can you share your game save loading/saving code. Please use the code formatting option, the blue <> button in the row with bold and italic and paste your code in the popup window…

Rob

This is on Android, and sure thing

Here’s the loadsave.lua:

https://drive.google.com/open?id=1–Tr_PyIsosp0ZugQjIksOw-HKzy6uM5

And this is in the main:

-- All of the data that needs to be saved (changeable). local saveData = { isFirstTime = true, herosDone = {}, herosScore = {}, highScore = 0 } local gameTable = loadsave.loadTable( "settings.json" ) if gameTable == nil then -- If there is no current table use defaults and make table print("First Time: Creating Table...") loadsave.saveTable( saveData, "settings.json" ) else --add checks for nul info in json -- If this is not the first time in the app, pull data print("Loading Saved Data...") saveData.isFirstTime = gameTable.isFirstTime for i, heroDone in ipairs(gameTable.herosDone) do saveData.herosDone[i] = heroDone end for i, heroScore in ipairs(gameTable.herosScore) do saveData.herosScore[i] = heroScore end saveData.highScore = gameTable.highScore end -- Load saved data into our game data table. gameData.saveData = { isFirstTime = saveData.isFirstTime, herosDone = {unpack(saveData.herosDone)}, herosScore = {unpack(saveData.herosScore)}, highScore = saveData.highScore } print (gameData.saveData.herosScore)

Hi!

You say “This only happens after I live build it and beta install on devices”.

Have you tested intalling it on devices as a regular (not live) build? I have had issues with live builds retaining settings from older versions, which is very tricky because you literally have code affecting your app which is no longer visible anywhere. It could be that some of this “ghost code” is using a plugin that accesses your images.

So, as a test:

  1. Do a regular build and install

  2. Create a completely new app (from the simulator wizard), copy your code into this folder and build this new app.

Yes,  I’ve built it a number of times regularly and then just copied the apk into my phone. You don’t really get a prompt, just a message when you run the apk (with developer on) saying "Do you want to install this application? it does not require any special access.”

And darn, I tried your idea but I still get a prompt. Thanks for the idea though

If all else fails I would advise you to gradually errorcheck:

  1. Start with a new empty test project (that just displays “Hello World” for example) and a clean config.lua and build.settings. Test this.

  2. Add more and more of your code module with the existing clean config and build files and test this.

  3. Add lines to the build.settings file and test this.

  4. Add lines to the config.lua and test this.

And see where and when the error starts popping up.

For the record: the config.lua is most likely not the culprit so you could skip that in all likelihood.

Would it have to do with the save game file location at all? Right now we save a .json file on the users phone using a directory, I’ve tried a couple, like 

system.ApplicationSupportDirectory and  system.DocumentsDirectory

but no luck. Just wondering if I need to change anything else.

I’ve been slowly taking things out but still get a prompt. It’s so strange since we don’t look in or need to users phone for anything

I doubt it. File location would only come into play when the code is executed. Not at install time. Have you gone through the steps I listed?

“allow access to photos, media and files on device” is a message you always get on device with a live build.

Live builds simply run your source on the device so access is required.

SGS,

I’ve installed other corona built apps from the play store and they don’t prompt me that message.

Do I not need a live build for the play store?

Live builds are for development only --> they are called “live” because the changes to your code are reflected in real-time.

Final distribution to Play Store or App Store are not done with live builds.

thomas6,

yes this change did it, this is my first app and I wasn’t sure and figured i needed a live build for the play store so i left it checked live. Just building regularly with my key and after releasing an updated beta then the prompt was gone.

Thanks!, (still figuring things out, but its fun!)

We did say this weeks ago but hey… glad you sorted it

It could be a required permission from a plugin. Can you post your build.settings for us to look at?

Rob

Yes, no prob:

– For more information on build.settings see the Corona SDK Build Guide at:

https://docs.coronalabs.com/guide/distribution/buildSettings

settings =

{

orientation =

{

– Supported values for orientation:

– portrait, portraitUpsideDown, landscapeLeft, landscapeRight

default = “landscapeLeft”,

supported = { “landscapeLeft”,“landscapeRight” },

},

excludeFiles =

{

– Include only the necessary icon files on each platform

–iphone = { “Icon-*dpi.png”, },

–android = { “Icon.png”, “Icon-Small-*.png”, “Icon*@2x.png”, },

},

– iOS Section

iphone =

{

plist =

{

UIStatusBarHidden = false,

UIPrerenderedIcon = true, – set to false for “shine” overlay

–UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend

CFBundleIconFiles =

{

“Icon.png”,

“Icon@2x.png”,

“Icon-167.png”,

“Icon-60.png”,

“Icon-60@2x.png”,

“Icon-60@3x.png”,

“Icon-72.png”,

“Icon-72@2x.png”,

“Icon-76.png”,

“Icon-76@2x.png”,

“Icon-Small.png”,

“Icon-Small@2x.png”,

“Icon-Small@3x.png”,

“Icon-Small-40.png”,

“Icon-Small-40@2x.png”,

“Icon-Small-50.png”,

“Icon-Small-50@2x.png”,

},

},

},

– Android Section

android =

{

usesPermissions =

{

},

},

}

(fyi, its very minimal)

or could it come from requiring this sprite file?:

https://drive.google.com/open?id=1spiasauokwNpKZCG9ZzK9gjyRxLZzKSN

I didn’t see anything in the sprite.lua file that would want to access the camera or the photo library. You’re not using any plugins that could inject any permissions for you. Is this on Android or iOS?

Can you share your game save loading/saving code. Please use the code formatting option, the blue <> button in the row with bold and italic and paste your code in the popup window…

Rob

This is on Android, and sure thing

Here’s the loadsave.lua:

https://drive.google.com/open?id=1–Tr_PyIsosp0ZugQjIksOw-HKzy6uM5

And this is in the main:

-- All of the data that needs to be saved (changeable). local saveData = { isFirstTime = true, herosDone = {}, herosScore = {}, highScore = 0 } local gameTable = loadsave.loadTable( "settings.json" ) if gameTable == nil then -- If there is no current table use defaults and make table print("First Time: Creating Table...") loadsave.saveTable( saveData, "settings.json" ) else --add checks for nul info in json -- If this is not the first time in the app, pull data print("Loading Saved Data...") saveData.isFirstTime = gameTable.isFirstTime for i, heroDone in ipairs(gameTable.herosDone) do saveData.herosDone[i] = heroDone end for i, heroScore in ipairs(gameTable.herosScore) do saveData.herosScore[i] = heroScore end saveData.highScore = gameTable.highScore end -- Load saved data into our game data table. gameData.saveData = { isFirstTime = saveData.isFirstTime, herosDone = {unpack(saveData.herosDone)}, herosScore = {unpack(saveData.herosScore)}, highScore = saveData.highScore } print (gameData.saveData.herosScore)

Hi!

You say “This only happens after I live build it and beta install on devices”.

Have you tested intalling it on devices as a regular (not live) build? I have had issues with live builds retaining settings from older versions, which is very tricky because you literally have code affecting your app which is no longer visible anywhere. It could be that some of this “ghost code” is using a plugin that accesses your images.

So, as a test:

  1. Do a regular build and install

  2. Create a completely new app (from the simulator wizard), copy your code into this folder and build this new app.