Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

UDP Requires READ_PHONE_STATE?

Discussion in 'Unity IAP' started by Slaye, Nov 30, 2018.

  1. Slaye

    Slaye

    Joined:
    Apr 30, 2015
    Posts:
    27
    I recently went through the process of adding IAP to my title, and noticed that the Android build is now requesting permissions for phone state.

    After going through a triage to figure out what was going on, I was able to identify via the manifest merge tool in Android Studio that the file at...

    /Assets/Plugins/UDP/Android/udp.aar

    ...includes the line
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

    Is this permission really required? I really don't want the initial launch of my title to immediately prompt a request for phone access!

    I am using Unity editor 2018.2.18f1, and Packages is showing In App Purchasing 2.0.3 as up to date.
     
  2. Slaye

    Slaye

    Joined:
    Apr 30, 2015
    Posts:
    27
    Deleting the UDP folder (per another thread) seemed to do the trick. It looks like that folder got brought in by IAP. So far, I don't see any side-effects or compilation problems after removing it. Hmm.

    For future reference for those trying to sort out these issues, you can do the following:

    1) Install Android Studio, if you haven't already.
    2) Export the Android project from Unity.
    3) Open the Android project in Android Studio.
    4) Open the [project]/manifests/AndroidManifest.xml file
    5) At the bottom of this window, select the tab for Merged Manifest.
    6) You can now click on lines in the Merged Manifest, and you will see the source of a particular line (e.g.
    <uses-permission android:name="android.permission.READ_PHONE_STATE" /> listed in the window on the right.
     
    VulsanGabriel likes this.
  3. Slaye

    Slaye

    Joined:
    Apr 30, 2015
    Posts:
    27
  4. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi,
    UDP requires that permission. If you are not targeting UDP and seeing that permission in your apk files, you can just delete the udp.aar file.
    But the udp.aar file shouldn't be compiled into your apk if you are not targeting UDP.
    Unity IAP 1.20.1, the latest version, doesn't have UDP included.
     
  5. Slaye

    Slaye

    Joined:
    Apr 30, 2015
    Posts:
    27
    I checked my Git repo, and it shows that the UDP import happened when I imported Unity IAP on Sep 20, 2018. I found under /Assets/Plugins/UnityPurchasing/Changelog.md the following:

    [1.21.0] - 2018-08-14
    Added
    The link cited is pretty unhelpful.

    IAP in the Services window indicates that the Unity IAP is up to date, but clicking on reimport does bring up some changes. I can't seem to find a way to view the changelog for the import without actually doing the import.
     
  6. unityjingyao

    unityjingyao

    Unity Technologies

    Joined:
    Feb 20, 2017
    Posts:
    220
    Hi,
    If you are not going to use UDP, you can just ignore it.
    The latest version is 1.20.1, you can also find it in the Asset Store.
    https://assetstore.unity.com/packages/add-ons/services/billing/unity-iap-68207
    1.20.1 doesn't have UDP included. So if you have already imported 1.21.0, you should have UDP folder in your project. If you import 1.20.1 then, the UDP folder will still exist.
    You can fully delete Unity IAP and re-import 1.20.1. Please make sure that you don't have compile error when importing Unity IAP. Otherwise, you'll get unexpected behaviors.
     
    Slaye likes this.
  7. Sysware

    Sysware

    Joined:
    Jan 10, 2019
    Posts:
    3
    this sucks, it's a lot of complication, a lot of bureaucracy thanks to google.
     
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    3,130
    @Sysware Sorry, can you elaborate? Google? And what complication? If you use 1.20.1 (which is the latest as of this post, and is actually more recent than 1.21) then the problem is solved.
     
  9. Sysware

    Sysware

    Joined:
    Jan 10, 2019
    Posts:
    3
    The problem is not with unity but with the new counterintuitive panel of google console.
    The information on this are all scattered in various places, google is not clear in what it says, I had to search a lot in the forums to understand the mechanism of the console, something that google should explain right.
    They said: error, you build upload falied because you need the privacy policy but they did not say where the hell I'm adding it, what format it has, whether it's inside the build or elsewhere. I got confused on the terms and got all lost looking in the forums. But after a lot of test and error I got it. I was just a fool trying to put the privacy policy inside the build, and this was just a page referenced in an unconventional location inside the google console.
     
  10. Sysware

    Sysware

    Joined:
    Jan 10, 2019
    Posts:
    3
    I just found an error in this forum, if I edit my response 3 times he accuses me of spammer and I can not edit anymore.