2016-08-01 29 views
1

我正在制作一个android应用程序,之前我已经使用gcm进行推送通知,现在我正在尝试firebase云消息发送推送通知。我实施了firebase云在我的应用程序的邮件功能它工作正常,但问题是,它正在当应用程序启动第一次了太多的时间,请大家帮我为什么FirebaseApp初始化非常慢,如何减少应用程序的启动时间

build.gradle 

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

    defaultConfig { 
     applicationId "com.next.fcm" 
     minSdkVersion 15 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
     multiDexEnabled true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    dexOptions { 
     javaMaxHeapSize "4g" 
    } 

} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.android.support:design:23.4.0' 

    compile 'com.google.firebase:firebase-messaging:9.0.0' 

} 
apply plugin: 'com.google.gms.google-services' 

回答

1

不要编译整个FCM的lib只是编译如下行。

compile "com.google.firebase:firebase-messaging:9.0.0" 
+0

我试过,但没有工作,仍然缓慢 – skyshine

+0

OK亲爱的,请检查你的工作室,你支持离线支持 –

+0

我没有得到,我应该工作室 – skyshine

相关问题