phonegap / phonegap-plugin-push

Register and receive push notifications
MIT License
1.94k stars 1.91k forks source link

App rejection on android play store - advertising ID #2571

Open pliablepixels opened 6 years ago

pliablepixels commented 6 years ago

(phone gap plugin version 2.1.3, platform Android)

Hi, my android app suddenly got pulled down (after several years on the store) with this:

screen shot 2018-10-01 at 3 56 32 pm

I was pretty sure I did nothing with the advertising ID. Upon further investigation, it looks like this plugin uses firebase SDK which in turn seems to collect that ID. I see the irony with Google kicking my app out because I used their library.

If you think appropriate, you may want to add a notice in your README.md encouraging uses to add a privacy policy to their store listing and their app if they use this plugin. I think these conditions are being scrutinized more closely due to GDPR compliance.

(not quite related to https://github.com/phonegap/phonegap-plugin-push/issues/778 as that deals with different libraries and for iOS)

lamuertepeluda commented 6 years ago

All of a sudden I'm facing the same issue. If you don't need the advertising ID (like me: I didn't even know what it was), then you may disable it.

It would be nice to have an option that does that for both platforms (iOS and Android). I will arrange some hook-based solution for now, and I will share it here if it works, but an option in the cordova manifest preferences for this plugin would be nice.

References on disabling the Android ID:

jcesarmobile commented 6 years ago

I would vote for documenting how to disable it by adding this line to the AndroidManifest.xml with a edit-config tag <meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />, as making the plugin disable it by default might cause problems with other plugins requiring it to properly work.

pliablepixels commented 6 years ago

This would need to be done for both Android and Ios. It seems firebase collects for both platforms. Apple always asks if our app collects the advertising id. It's a matter of time before Apple starts booting apps.

lamuertepeluda commented 6 years ago

I would vote for documenting how to disable it by adding this line to the AndroidManifest.xml with a edit-config tag <meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />, as making the plugin disable it by default might cause problems with other plugins requiring it to properly work.

Indeed, I'm trying this with

        <config-file parent="/manifest/application" target="AndroidManifest.xml">
            <meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
            <meta-data android:name="firebase_crash_collection_enabled" android:value="false" />
        </config-file>

in the app config.xml file.

I've set it up for Android, under <platform name="ios">. So far it seems affecting the Manifest.xml as expected. I will let u know if this solution works for Google...

For iOS, I'm trying with

        <edit-config overwrite="true" parent="FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED" platform="ios" target="*-Info.plist">
            <boolean>YES</boolean>
        </edit-config>

under <platform name="ios">. Hope it works as well...

drago-aca commented 6 years ago

please let us know if it works..

pliablepixels commented 6 years ago

Thanks @lamuertepeluda. My app got put back the moment I linked a privacy policy with a lame comment about firebase collecting IDs. That being said, I'll incorporate your changes. I don't do anything with the ad id and Apple's policies are are even stricter - you can't collect the ad id if you don't do anything with it.

lamuertepeluda commented 6 years ago

@pliablepixels we neither... we got knowledge of the existence of this Advertising ID the moment our app was rejected! 😞 I hope this works... stay tuned

pliablepixels commented 6 years ago

Interestingly, it looks like on iOS the flag was already disabled (and explains why my .ipa file passed iTunes checks). So not 100% sure we need the iOS flags but no harm in being safe.

find . | xargs fgrep FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED 2>/dev/null
Binary file ./platforms/ios/zmNinja.xcarchive/Products/Applications/zmNinja.app/zmNinja matches
Binary file ./platforms/ios/Pods/FirebaseCore/Frameworks/FirebaseCore.framework/FirebaseCore matches

Further observation: I use FCM for push notifications. It looks like this is the contents of GoogleService-Info.plist in my project root:

 <key>IS_ADS_ENABLED</key>
 <true></true>
 <key>IS_ANALYTICS_ENABLED</key>
 <false></false>

I wonder if we need to turn off IS_ADS_ENABLED

lamuertepeluda commented 6 years ago

Guys the edit-config approach did work for Google! I re-submitted our app and after 1h or so it was back in the play store. I hope they won't rejected it again.

I'll let you know if it works for iOS as well, but thanks @pliablepixels for your investigation!

mrhyper commented 5 years ago
    <config-file parent="/manifest/application" target="AndroidManifest.xml">
        <meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
        <meta-data android:name="firebase_crash_collection_enabled" android:value="false" />
    </config-file>


in the app `config.xml` file.

I can't compile my app with those settings, I get this error: Error parsing XML: unbound prefix

GabrielArakaki commented 5 years ago

@mrhyper , don't have much information of your environment settings, but if you're working on cordova-android 7.x.x., the relative path to AndroidManifest.xml has changed.

So you should change the target in the config-file, such as:

<config-file parent="/manifest/application" target="app/src/main/AndroidManifest.xml">
        <meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
        <meta-data android:name="firebase_crash_collection_enabled" android:value="false" />
</config-file>

@see https://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html

Charlie-Hua commented 5 years ago

@mrhyper adding an attribute to the root <widget> fixed the Error parsing XML: unbound prefix error for me. from this comment: https://github.com/dpa99c/cordova-custom-config/issues/24#issuecomment-172981002

touletan commented 5 years ago

I added this code below to config.xml and successfully build the APK using phonegap build. I submitted the apps on Google and it has been active for few hours. Not the apps has been removed again for the same reason :) Is it still working for you?

`

    <meta-data android:name="firebase_crash_collection_enabled" android:value="false" />

`

jdtaylor91 commented 5 years ago

@touletan we also added the same snippet to our config.xml and the app was removed for the same reason a few hours later. Did you find another work around for this?

We confirmed that the generated AndroidManifest.xml file contains both the google_analytics_adid_collection_enabled and firebase_crash_collection_enabled settings so we don't think it's a configuration issue.

touletan commented 5 years ago

@jdtaylor91 , I added a privacy policy to my app.

jdtaylor91 commented 5 years ago

@touletan OK thanks. We've had to go down this route as well unfortunately!

digaus commented 5 years ago

@mrhyper , don't have much information of your environment settings, but if you're working on cordova-android 7.x.x., the relative path to AndroidManifest.xml has changed.

So you should change the target in the config-file, such as:

<config-file parent="/manifest/application" target="app/src/main/AndroidManifest.xml">
        <meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
        <meta-data android:name="firebase_crash_collection_enabled" android:value="false" />
</config-file>

@see https://cordova.apache.org/announcements/2017/12/04/cordova-android-7.0.0.html

Ty this worked perfectly. My last release is now active since ~5 days! This should be added in the documentation.

tmladek commented 5 years ago

I added this code below to config.xml and successfully build the APK using phonegap build. I submitted the apps on Google and it has been active for few hours. Not the apps has been removed again for the same reason :) Is it still working for you?

<config-file parent="/manifest/application" target="app/src/main/AndroidManifest.xml"> <meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" /> <meta-data android:name="firebase_crash_collection_enabled" android:value="false" /> </config-file>

I added this into my config.xml, but then my handler stopped getting called?

Registration and getting the ID worked fine, but no notification would ever trigger the "notifications" event again. I had to remove this from the config, completely delete all artifacts and cache and rebuild to fix this - which obviously isn't ideal, as now my app is getting rejected again.

Any news regarding this issue?