Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-20002

iOS: Ti.Geolocation.requestLocationPermissions is not always called?

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 5.1.0
    • Fix Version/s: Release 5.1.2
    • Component/s: iOS
    • Labels:
    • Environment:

      SDK 5.1.0.v20151116104422
      iOS Simulator 9.1 (13B137)
      iPhone 6S running same iOS version

    • Story Points:
      3
    • Sprint:
      2015 Sprint 24 SDK

      Description

      Both on device and in Simulator I can't get the callback for requestLocationPermissions in the following code to be called, even though - the first time - the dialog requesting permission is displayed. Which is weird, because in the Ti 5.1.0 Sample App it does call and is implemented in the exact same way. Removing everything in the button event listener except the request call doesn't change it either.

      var win = Ti.UI.createWindow({
      	backgroundColor: 'white'
      });
       
      var btn = Ti.UI.createButton({
      	title: 'Request Permissions'
      });
       
      btn.addEventListener('click', function(e) {
       
      	Ti.API.info('Before Callback');
       
      	Ti.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e) {
       
      		Ti.API.info('In Callback');
       
      		Ti.API.info(JSON.stringify(e, null, 2));
      	});
       
      });
       
      win.add(btn);
      win.open();
      

      Notes:

      • Don't forget to add <key>NSLocationAlwaysUsageDescription</key><string>Deny or grant permission to test different scenarios.</string> to the tiapp.xml or use the attached project.
      • For a clean slate either change the app id, reset the Simulator or just Settings > General > Reset > Reset Location & Privacy.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                apetkov Angel Petkov
                Reporter:
                fokkezb Fokke Zandbergen
                Reviewer:
                Pedro Enrique (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-20691
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration