Android Question Add Permission

fishwolf

Well-Known Member
Licensed User
Longtime User
How to add this permission in B4A?

com.google.android.gms.permission.AD_ID

<code>
AddManifestText(
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="31"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)

AddPermission (android.permission.GET_ACCOUNTS)
AddPermission (android.permission.WRITE_EXTERNAL_STORAGE)
'End of default text.

AddReplacement($ADMOB_APP_ID$, ca-app-pub-xxx)

'************ Google Play Services Base ************
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)

CreateResourceFromFile(Macro, Core.NetworkClearText)
SetApplicationAttribute(android:allowBackup, "false")
</code>
 

DonManfred

Expert
Licensed User
Longtime User
Try
B4X:
AddPermission ("com.google.android.gms.permission.AD_ID")

Check this too
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
No, Google Play still requests permission
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
I'm not sure that I understand the issue. Please post the message you see in Google Play.
Traslated with google traslator:

Google Play:
Before you can release an app targeting Android 13 (API 33), you must complete the Advertising ID declaration. 
We will use this statement to provide safeguards in the Play Console to support the Advertising ID changes in Android 13.

Apps targeting Android 13 or later using the advertising ID must include the com.google.android.gms.permission.AD_ID permission in the manifest.

New manifest B4x:
MANIFEST B4X:
AddManifestText(
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="31"/>
<supports-screens    android:largeScreens="true"
                      android:normalScreens="true"
                      android:smallScreens="true"
                      android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)

AddPermission (android.permission.GET_ACCOUNTS)
AddPermission (android.permission.WRITE_EXTERNAL_STORAGE)
AddPermission ("com.google.android.gms.permission.AD_ID")
'End of default text.

AddReplacement($ADMOB_APP_ID$, ca-app-pub-xxx)
'************ Google Play Services Base ************
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)

CreateResourceFromFile(Macro, Core.NetworkClearText)
SetApplicationAttribute(android:allowBackup, "false")

Maniferst.xml generated:
B4X:
    <uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…