Search Unity

Unity IAP 1.21.1 including READ_PHONE_STATE(?) Android permission

Discussion in 'Unity IAP' started by Nicolas1212, Oct 17, 2018.

  1. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    This results in a scary "Allow GAME to make and manage phone calls" permission dialog when the app is installed (I think it's READ_PHONE_STATE that does this).

    1.21.0 doesn't have this issue (building with Unity 2018.2.0f2).

    Given that it seems like this happened before, with 1.9.2, I'm assuming this is an issue with an external lib:

    (On a side note, is there an easy way to remove all the store implementations that you don't care about? I.e. only include iOS and Google Play?)

    ping @nicholasr or @thabang_unity

    Thanks
     
  2. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi,
    Which store are you targeting in Unity IAP?
    This permission shouldn't be included in your APK if you are targeting Google Play.
    Please delete the 'Library' folder and try it again.
     
  3. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    Hi @unityjingyao,

    Thanks for getting back to me. I rebuilt the APK after deleting the Library folder (which, incidentally, makes Unity crash if it's open), but I'm still getting the permission if I use UnityIAP 1.21.1

    We've only ever built for Google Play and iOS. If I could remove the other stores included, I would, but it won't build in that case.

    Thanks
     
  4. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi,
    I suspect that this permission is used by other plugins.
    Can you reproduce this issue in a new project with only Unity IAP imported?
     
  5. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    Hi @unityjingyao,

    UnityIAP was the only plugin updated - our project's being going now for ~3yrs, so it's rare that a new plugin is added.

    My literal testing flow is like this:
    • Update UnityIAP to 1.21.1
    • Build the game to make sure everything's still working
    • "Make and manage phone calls" is now showing up
    • Revert UnityIAP back to 1.21.0
    • Permission is no longer asked for
    No other files change in the meantime
     
  6. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Thank you for sending me these steps!
    I still couldn't reproduce it with 1.21.1.
    The latest version is 1.20.1, could you please try this version out?
    If you still can see this issue, please send me a reproducible project. Thank you.
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Apologies on the version numbering, 1.20.1 is the latest. Make sure you remove the previous version before updating, and make sure to create a fresh build with a new manifest. Specifically make sure to remove the UDP folder prior to reinstall. UDP.dll is causing the issue. This dll is used for release to stores in China, which requires the elevated permissions. Note - When you remove the previous version, make sure you have no compiler issues prior to importing again, or the import may fail.
     
    Last edited: Oct 23, 2018
  8. Berno

    Berno

    Joined:
    Oct 29, 2014
    Posts:
    40
    I was able to solve this problem by just deleting the Plugins/UDP folder before updating to 1.20.1.

    Can we have clarification of what exactly constitutes uninstalling a previous version of IAP?
    I didn't want to go down that path as deleting everything IAP related in the Plugins folder obviously does break all the store code in my project and then as you pointed out the import for IAP doesn't work correctly with compiler issues.
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    That is the process, we are working on improving the upgrade, such as possibly leaving a stub file with the appropriate references, etc.
     
  10. Nicolas1212

    Nicolas1212

    Joined:
    Dec 18, 2014
    Posts:
    139
    Yep, that did the job. Though I simply had to update the plugin, removing UDP, then re-open Unity (as it doesn't unload plugins). Once that was done, the extra permission disappeared.

    Thanks @JeffDUnity3D and @unityjingyao
     
    JayR likes this.