Search Unity

READ_PHONE_STATE Permission auto-included when newest Unity Facebook SDK versions installed

Discussion in 'Android' started by nztree, May 7, 2017.

  1. nztree

    nztree

    Joined:
    Oct 16, 2016
    Posts:
    9
    The READ_PHONE_STATE permission has cropped up before, but this is a variation that relates specifically to the Unity Facebook SDK.

    Installing any Unity Facebook SDK version later than 7.9 will prompt Unity to auto-include the READ_PHONE_STATE permission in the manifest, which in turn translates to a permission message in Google Play requesting "Device ID & call information". The full description of this in Google Play is as follows: "Allows the app to determine the phone number and device IDs, whether a call is active ant the remote number connected by a call".

    For many, if not most developers using the Unity Facebook SDK, this permission does not align with the permissions actually required, and given its invasive nature is likely to turn away users at the point of installation.

    Unity Facebook SDK versions of 7.8 and below do not appear to trigger the permission's inclusion. It seems that recent changes to the Facebook SDK have included items that are auto-flagged by unity when compiling the manifest. Although using earlier versions of the SDK will 'resolve' the issue, doing so is clearly not a long-term solution.

    Given the SDK's popularity, it would be greatly appreciated by myself (and the many others scattered throughout the forums who have suffered through resolving this permission issue) if the Unity team could interface with Facebook to find a way to either prevent the auto-inclusion of the permission in later versions altogether, or to facilitate some way of allowing devs to exclude those components that do require the permission.
     
    CGAPPS likes this.
  2. ianholing

    ianholing

    Joined:
    Nov 15, 2015
    Posts:
    9
  3. lukos

    lukos

    Joined:
    Nov 11, 2012
    Posts:
    22
    Add this to your manifest. It will strip down the permission

    <uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" />


    And this to your manifest header
    xmlns:tools="schemas.android.com/tools"
     
    Last edited: Mar 21, 2018
  4. adam_mehman

    adam_mehman

    Joined:
    Dec 11, 2014
    Posts:
    104
    I have added this and still, READ_PHONE_STATE is available. Final Manifest has this permission :(
     
  5. adam_mehman

    adam_mehman

    Joined:
    Dec 11, 2014
    Posts:
    104
    Is it from Facebook SDK? Unity Analytics? Those are the only SDK I have.