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

iOS 11: Location permissions do not indicate missing "WhenInUse" privacy-key

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Release 6.3.0, Release 7.0.1
    • Fix Version/s: Release 7.1.0
    • Component/s: iOS
    • Environment:

      iPhone emulator (tested in all versions from 5S to X), iOS 11
      Tested in Titanium SDK 6.3.0.GA, 7.0.0.GA, 7.0.1.GA

    • Story Points:
      2
    • Sprint:
      2018 Sprint 04 SDK

      Description

      When asking for Location permissions in iOS 11, the following error is shown, even thought my plist already have these keys:

      [ERROR] :  The NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationAlwaysUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription key must be defined in your tiapp.xml in order to request this permission.

      This is the ios part of the tiapp.xml. I've also opened the generated Info.plist file and it looks good.

      <ios>
              <enable-launch-screen-storyboard>true</enable-launch-screen-storyboard>
              <use-app-thinning>true</use-app-thinning>
              <plist>
                  <dict>
                      <key>NSLocationAlwaysUsageDescription</key>
                      <string>Can we use geolocation?</string>
                      <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
                      <string>Can we use geolocation?</string>
                      <key>UISupportedInterfaceOrientations~iphone</key>
                      <array>
                          <string>UIInterfaceOrientationPortrait</string>
                      </array>
                      <key>UISupportedInterfaceOrientations~ipad</key>
                      <array>
                          <string>UIInterfaceOrientationPortrait</string>
                      </array>
                      <key>UIRequiresPersistentWiFi</key>
                      <false/>
                      <key>UIPrerenderedIcon</key>
                      <false/>
                      <key>UIStatusBarHidden</key>
                      <false/>
                      <key>UIStatusBarStyle</key>
                      <string>UIStatusBarStyleDefault</string>
                  </dict>
              </plist>
          </ios>
      

      In order to reproduce the issue, this is an example code, on an normal app, inside app.js (I've also attached the file)

      var win = Ti.UI.createWindow({layout:'vertical'});
      var label = Ti.UI.createLabel({top:30,width:'90%',height:Ti.UI.SIZE});
       
      win.addEventListener('open',function(){
      	Ti.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e){ apiInfo(JSON.stringify(e)); });
      });
       
      function apiInfo(msg) {
      	Titanium.UI.createAlertDialog({
      		title: "info",
      		message:msg
      	}).show();
      };
       
      win.add(label);
      win.open();
      

      Thanks for having a look

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              dfalcon Daniel Falcon
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code