microsoft / EmbeddedSocial-Android-SDK

SDK for interacting with the Microsoft Embedded Social service from inside your Android app
MIT License
9 stars 14 forks source link

ES SDK disables Firebase Analytics in apps by default #118

Open barbeau opened 5 years ago

barbeau commented 5 years ago

Summary:

We recently integrated Firebase Analytics in OneBusAway, but no events were showing up in our dashboard. After some debugging we eventually figured out that this line in the ES SDK manifest disables Firebase Analytics in OneBusAway, because the manifests get merged during builds:

<meta-data android:name="firebase_analytics_collection_deactivated" android:value="true" />

So, in OneBusAway we had to add this line in our manifest to enable Firebase analytics:

        <meta-data android:name="firebase_analytics_collection_deactivated" android:value="false"
                   tools:replace="android:value"/>

Because Firebase Analytics is typically enabled by default without any edits needed to the manifest, this solution wasn't an obvious one.

If possible I'd suggest removing the line from the ES SDK so that other apps that use Firebase Analytics don't have the same issue.

Steps to reproduce:

  1. Checkout OBA master branch at this commit - https://github.com/OneBusAway/onebusaway-android/commit/e6520baa4e70018a4d8dbc2026226a33ee8ecb97
  2. Start an emulator and enable Firebase debugging client-side via:
adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC
  1. Start OBA and look at the terminal log from Firebase

Expected behavior:

Firebase Analytics should be enabled within OBA and you should see debugging messages logging events

Observed behavior:

The log shows App measurement disabled.

Device, Android, and Embedded Social SDK version:

    // Embedded Social SDK
    implementation('com.acrowntest.test:sdk:0.7.4@aar') {
        transitive = true
    }

OBA master branch at this commit (prior to adding the entry to our manifest) - https://github.com/OneBusAway/onebusaway-android/commit/e6520baa4e70018a4d8dbc2026226a33ee8ecb97