Touch Object Creates Location Services Prompt on iOS

  • Problem Description

    Including the Touch object in a Construct 2 project prompts a location services request on first startup on iOS devices.

    Attach a Capx

    dl.dropboxusercontent dot com/u/1108862/Cordova%20Test.capx

    Description of Capx

    This is an empty project with only the Touch object included.

    Steps to Reproduce Bug

    • Export project to Cordova
    • Zip contents of project and upload to Adobe PhoneGap Build
    • Load IPA file on iOS device

    Observed Result

    The application displays the following message to the user: "Allow "Cordova Test" to access your location even when you are not using the app?"

    Expected Result

    This prompt should not appear. There is no reason for the Touch object to request location services.

    Affected Browsers

    • N/A

    Operating System and Service Pack

    Windows 7 Ultimate x64 SP1

    Construct 2 Version ID

    Release 200 (NOTE: This is still an issue in the 204.2 beta)

  • I think this is a bug in PhoneGap Build. The export from Construct 2 clearly specifies in config.xml:

    <preference name="permissions" value="none"/>

    However if you build the .ipa, rename to .zip, open and extract, the bundled config.xml file is a "hello world" style default which says nothing much about permissions, so I guess it might default to asking for location.

    According to this thread: http://community.phonegap.com/nitobi/topics/how-to-i-turn-off-geolocation-when-using-phonegap-build - it sounds like it's been a problem before:

    [quote:3oquyyrs]That's a good idea. My guess is, that PGB never built with your config.xml and took a default config instead. That has been reported several times before.

    I'd report this to the PhoneGap Build service, I don't think it's related to Construct 2 at all, our export is trying to say that it does not require any permissions. Geolocation calls are made strictly only from the Geolocation object, so if that is not in your project, the C2 engine is not making any location requests.

  • I just rebuilt the version of my project with the Touch object intact and checked the IPA file. The "hello world" config.xml still has the "permissions none" flag despite throwing that location prompt when I install it.

    I can report this to PhoneGap Build, but if you could recommend any temporary workarounds (some value in the Info.plist I could change?), it would be greatly appreciated. I was able to get my app approved in the App Store the first time around, but they rejected my update the second time around due to that prompt. So, it's effectively impossible to get any touch enabled C2 project approved on iOS as it stands (unless you get a lax reviewer, I suppose). PhoneGap Build is the recommended export method, correct? No alternatives with comparable performance?

  • I don't know, it definitely did not do this previously and we haven't made any changes to the Cordova exporter lately, so it seems the most likely cause is a change in the PhoneGap build system and that thread seemed to make it sound like it was a known/recurring issue too. Not sure what can be done since it already doesn't ask for location permission!

    Does removing the Touch object prevent the prompt? I'm just wondering if it thinks the device orientation counts as location...

  • It's definitely the Touch object. I spent a few weeks banging my head over this issue (even when it got approved the first time, I still had a handful of negative reviews because of the shady prompt) and finally nailed this down after slowly eliminating plugins from my project until it didn't give the prompt anymore.

    If you build a C2 project without the Touch object and upload it to PhoneGap, it will NOT display the location prompt.

    I appreciate your help and understand that it's out of your hands! It's just a very frustrating problem to have this late in the game, haha.

  • Just would like to add that I've had this same issue. Got rejected because of it, even though 'permissions' in config.xml is set to none.

    Device orientation could be a possible cause, I've forced it to portrait but maybe if it isn't forced it won't show up?

  • I'm having this same issue too, and as donkeyspaceman says, it's the touch object.

    Did you guys found any workaround?

    I have 2 games rejected because of this.

  • It was recommended to me to use the Cordova CLI, but now I have a weird audio issue and don't know how to fix it. :/

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Good to see that this is getting some discussion and making some progress (we know it's related to the Touch object now).

    I haven't worked on this issue in nearly 5 months but I did have some dialogue with Petra over at PGB and did some of my own testing. None of it was conclusive. I was able to build with Cordova CLI which further supports the theory that it is an issue with how PGB is handling the touch object.

    Keep me posted. Thanks all.

  • So I tried looking in to this disabling various features of the Touch object one at a time, and the prompt eventually stopped coming, and then I re-enabled everything, and it still didn't come back. So either iOS stops prompting after a while (making testing this extremely difficult), or it's sporadic, or it's somehow fixed already? I don't really know what is going on here. I still suspect it's Cordova making the location request, since it used to work.

  • It prompts the first time you open the app (per install), then saves whatever choice you selected and doesn't prompt after that. I'm not sure exactly what your testing conditions were, but that's my experience.

    Someone on that Adobe support post recommended I use the Cordova CLI, which DID NOT produce the prompt, leading me to believe it is a problem on Adobe's end. Of course, this build produced a sound bug that I've had little luck troubleshooting, so I'm still not really any closer to having my app updated.

    I tweeted at Adobe Support and they weren't super helpful. The rep on that support post recommended I make a ticket for it, so at least they're pretending like they believe it's their problem (5 months ago, when that post first came up, the rep pointed the finger at Construct).

    I'm writing the ticket now. Hopefully something will be done in a reasonable amount of time. I'll also try rebuilding my game to see if it's randomly working as you described (even if it's sporadic, if I can get one good build I could push my update).

  • github.com/phonegap/build/issues/440#issuecomment-110510525

    [quote:3he31bwf]construct 2 uses the accelerometer that will trigger this warning

    specifically it listens for "devicemotion" and "deviceorientation" events of the window object.

    Is there anything that can be done about this, Ashley?

  • I replied to the thread, but they closed it already. Hopefully they will see my message and reopen it...

  • Ashley I will do a build when I get home later today. I should note that during the course of my testing back in January I would receive the permission prompt every time on initial run, without fail. I deleted the app data from the test iOS device, rebuilt, and uploaded the app file at least 40-50 individual times during this period, so if you are noticing that the prompt is no longer appearing on the initial run, that is potentially good news.

  • I replied to the thread, but they closed it already. Hopefully they will see my message and reopen it...

    Do we need to open a new ticket? Still no reply. D:

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)