Removing Unity Android READ_PHONE_STATE Permission
Removing Unity Android READ_PHONE_STATE Permission
Hello everyone, in this post I saw that after I took a Build for the release of my game and tried to upload it to Google Play, the store asked me to prepare a privacy policy for my game for a permission that I did not add to my game.
Since I do not actually use any phone data, or more precisely contact book etc. data, in my game, I did not need this permission and I wondered how I could remove this permission. After some research on the internet, I saw that when I applied the following methods, this permission was removed from my game.
I think the cause of this error is the ADMob SDK, so let me note this and return to the article.
Solution Method
To solve this problem, I added the following line to the Android Manifest file that I found among the files of the application I downloaded. Then, when I took a new Build, I was able to upload my game to the store without any problem or privacy policy request.
You need to place this code right above the "</manifest>" line.
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove"></uses-permission>
In order for the above code to work, you also need to add the following code snippet to the part starting with "<manifest ..".
xmlns:tools="http://schemas.android.com/tools"
Yes friends, doing this will be enough. Additionally, I should mention that when taking a build, make sure the minimum Android version is 4 or above. On Android 4 and below, this permission is automatically added.
Let's take a look at how our manifest file will look in full when we place the codes.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.unity.ads" xmlns:tools="http://schemas.android.com/tools" android:versionName="1.0" android:versionCode="1">
<application>
<uses-library android:required="false" android:name="org.apache.http.legacy" />
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="" />
</application>
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" />
</manifest>Yes friends, this article ends here, and if you encounter any problems, do not hesitate to ask in the comment section below.


Yorum Gönder