Github user infil00p commented on a diff in the pull request:

    
https://github.com/apache/cordova-plugin-contacts/pull/78#discussion_r40477508
  
    --- Diff: src/android/ContactManager.java ---
    @@ -48,13 +54,66 @@ Licensed to the Apache Software Foundation (ASF) under 
one
         public static final int NOT_SUPPORTED_ERROR = 5;
         public static final int PERMISSION_DENIED_ERROR = 20;
         private static final int CONTACT_PICKER_RESULT = 1000;
    +    public static String [] permissions;
    +
    +
    +    //Request code for the permissions picker (Pick is async and uses 
intents)
    +    public static final int SEARCH_REQ_CODE = 0;
    +    public static final int SAVE_REQ_CODE = 1;
    +    public static final int REMOVE_REQ_CODE = 2;
    +
     
         /**
          * Constructor.
          */
         public ContactManager() {
    +        permissions = new String[2];
    +        permissions[0] = Manifest.permission.READ_CONTACTS;
    +        permissions[1] = Manifest.permission.WRITE_CONTACTS;
    +    }
    +
    +    public String [] requestPermissions()
    +    {
    +        return permissions;
    --- End diff --
    
    I don't think this is needed, to be honest.  Contacts was the first actual 
plugin where I implement the permissions. 
    
    But this is very similar to Geolocation, and if there is a call to 
requestPermissions(), it is recommended that a plugin actually return the 
permissions.  We could very easily drop this and only do it for the Geolocation 
plugin in hindsight.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to