firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.26k stars 573 forks source link

Firebase In App Messaging cause Google Map SDK slower #320

Closed yuminghao closed 5 years ago

yuminghao commented 5 years ago

I found Google Map will become very slow when banner style in-app messaging is shown over the app. I think it is the problem on combination of In App Messaging and Google Map SDK (see below case contents).

Here is some info of SDK version. -com.google.android.gms:play-services-maps:16.0.0 -Google Maps Android API: Google Play services package version: 14799037 -In App Message ver17.0.4

Our app is showing Google Map (SupportMapFragment). If banner style in-app messaging is shown over our app. Dragging of map becomes toooooo slow. It's about 1-2fps. Other Views are rendered smoothly, and touch event are reached to our Activity.

It seems to happen with combination of In App Messaging and Google Map.


After that, I was pursuing whether there was a workaround, but this one seems to be a combination problem with Google Map. If animateCamera etc. is done with DialogFragment on Google Map (MapView), display update will be very slow. Perhaps it seems that MapView is changing the behavior triggered by Window losing focus with onWindowFocusChanged. (Frame rate drops even if DialogFragment appears in the table even in banner other than In App Message) However, · In App Message provides banner type, you can operate the screen below without erasing the banner · When Google maps something on top (to lower the load of display) drop the screen update frequency etc And I think that it is a big issue that the UI direction collides with what your company offers.

Steps to reproduce: It is very easy to reproduce this issue.

  1. Create a new project(Google Maps Activity) in Android studio https://developers.google.com/maps/documentation/android-sdk/start
  2. Add the Firebase In-App Messaging SDK to project https://firebase.google.com/docs/in-app-messaging/get-started
  3. Get your app's Instance ID and send a message to your testing device

reproduce video: https://drive.google.com/file/d/1x9j1cvXZJ95hCsli7wVfEmocYauvJuiw/view?usp=sharing

build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.minghaoyu.testmapandiam"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:customtabs:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:multidex:1.0.3'
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.google.android.gms:play-services-maps:16.0.0'
    implementation 'com.google.firebase:firebase-inappmessaging-display:17.0.4'
    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.google.firebase:firebase-iid:17.0.4'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
google-oss-bot commented 5 years ago

I found a few problems with this issue:

samtstern commented 5 years ago

Closing this as a duplicate of #328 which has more information.