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

iOS: Permissions (Geolocation) Bugs in implementation & documentation

    Details

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

      SDK 5.1.0.v20151028190028

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

      Description

      While working on the permissions sample app I ran into some irregularities:

      • The API reference for hasLocationPermissions lists all AUTHORIZATION_* constants as possible values, while only AUTHORIZATION_ALWAYS and AUTHORIZATION_WHEN_IN_USE are valid.
      • The API reference for requestLocationPermissions lists all AUTHORIZATION_* constants as possible values, while only AUTHORIZATION_ALWAYS and AUTHORIZATION_WHEN_IN_USE are valid.
      • The implementation of requestLocationPermissions seems to call the locationPermissionManager twice if the first statement is false:

                  if (currentPermissionLevel == kCLAuthorizationStatusAuthorizedWhenInUse) {
                      NSLog(@"[ERROR] cannot change already granted permission from AUTHORIZATION_WHEN_IN_USE to AUTHORIZATION_ALWAYS");
                  } else {
                      [[self locationPermissionManager] requestAlwaysAuthorization];
                  }
                  [[self locationPermissionManager] requestAlwaysAuthorization];
      

      • On Android Ti.Calendar.requestCalendarPermissions, Ti.Contacts.requestContactsPermissions and Ti.Media.requestCameraPermissions will call back with success:false if the required permission is missing in tiapp.xml but on iOS Ti.Geolocation.requestLocationPermissions will not call back at all when the required NSLocation*UsageDescription key is missing in tiapp.xml. It should call back with success:false as well.
      • If you don't allow permission when asked by Ti.Calendar.requestCalendarPermissions or Ti.Contacts.requestContactsPermissions it will call back with success:false but Ti.Geolocation.requestLocationPermissions does not call back at all.
      • For both hasLocationPermissions and requestLocationPermissions wouldn't the expected behaviour be that if AUTHORIZATION_ALWAYS was granted then AUTHORIZATION_WHEN_IN_USE would be seen as granted as well since always > when in use?

        Attachments

          Activity

            People

            • Assignee:
              hknoechel Hans Knöchel
              Reporter:
              fokkezb Fokke Zandbergen
              Reviewer:
              Chee Kiat Ng (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code