App build.settings has NSLocationWhenInUseUsageDescription
In main.lua, there is Runtime:addEventListener( “location”, locationHandler )
Ensure that Location Services is Off in Settings -> Privacy
Install app, launch app which uses location
Prompt occurs - Turn On Location Services to Allow “App” to Determine Your Location. Click on Settings -> enable Location Services
Hit Home and Launch the App again
At this stage, the app does not detect the location or ask for permissions. However many times you close the app and relaunch, it does not.
Only if we exit the app (kill it off), and relaunch it, that it detects the location. However, this would mean most new app users may never notice it, fail to use the app and uninstall. Also, Apple review team is rejecting this as a serious bug.
Any suggestions or workarounds would be much appreciated!
Your workaround isn’t a work around. It’s the way this needs to be done. Because Apple doesn’t like apps that exit, main.lua can be thought of as doing things only the first time the app is run… ever… If you need to do things like check for facebook logins, initialize game center (could have a password change), etc. those need to happen in the system events for started and resumed. Location checks fall into that category.
Your workaround isn’t a work around. It’s the way this needs to be done. Because Apple doesn’t like apps that exit, main.lua can be thought of as doing things only the first time the app is run… ever… If you need to do things like check for facebook logins, initialize game center (could have a password change), etc. those need to happen in the system events for started and resumed. Location checks fall into that category.