简体   繁体   中英

Differing behaviour when an XCode project compiled on two machines with same OSX and XCode versions

Have multiple people working on the same iPhone XCode project from different machines. Finding that the app is behaving slightly differently depending on the machine it was compiled on (same source). Specifically, the app has a webview, and within that webview we add a listener for the devicemotion event:

window.addEventListener("devicemotion", function (eventData) {  alert('devicemotion'); }, false);

When built on one machine, the above code results in a prompt:

Allow "My App" to access your location even when you are not using the app?

and when built on the other, this prompt never occurs. We are testing using the same iPhone and yes we are fully uninstalling before installing each build (clearly it would retain the answer to the prompt). Both machines are running Mavericks 10.9.5 and XCode 6.4.

Any idea why these apps would behave differently? The no prompt seems like the correct behaviour since devicemotion shouldn't be part of location services...

OS X: System Preferences => Security & Privacy => Privacy => Location Services: Make sure your app is listed in the table on the right. If it's not then you'll get the prompt.

iOS: Settings => Privacy => Location Services => Share My Location => (On)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM