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

Windows: Ti.Contacts permission methods need to renamed be to match iOS and Android

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 5.3.0
    • Fix Version/s: Release 6.0.0
    • Component/s: Windows
    • Labels:
    • Environment:

      Windows 10 Pro
      Visual Studio 2015 Community Update 2
      Appc Core: 5.3.0-46
      Appc NPM: 4.2.5-5
      Ti SDK: 5.3.0.v20160523083840

    • Story Points:
      3
    • Sprint:
      2016 Sprint 13 SDK

      Description

      Description

      Currently, Windows uses Ti.Contacts.requestAuthorization() to request authorization, this should be changed to match iOS and Android which use Ti.Contacts.requestContactsPermissions() this was implemented in TIMOB-19479

      Ti.Contacts.requestContactsPermissions(function(e) {
          if (e.success === true) {
              alert("Access granted");
          } else {
              alert("Access denied, error: " + e.error);
          }
      });
      

      iOS and Android also use Ti.Contacts.hasContactsPermissions() to detect whether permissions are accepted for the app or not.

      Steps to reproduce

      1. Using the code above build to a Windows device or emulator

      Actual result

      The application will throw the error

      [ERROR] :  Application Error: {
      [ERROR] :    "line": 2,
      [ERROR] :    "column": 10,
      [ERROR] :    "message": "Error while require(/app) Ti.Contacts.requestContactsPermissions is not a function. (In 'Ti.Contacts.requestContactsPermissions', 'Ti.Contacts.requestContactsPermissions' is undefined)",
      [ERROR] :    "native_stack": [
      [ERROR] :      "JSExportClass<class Titanium::GlobalObject>::CallNamedFunction"
      [ERROR] :    ]
      [ERROR] :  }
      

      Expected result

      The same method should be used across all platforms

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gmathews Gary Mathews
                Reporter:
                eharris Ewan Harris
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code