android - firebase 通知未显示,令牌未刷新
问题描述
当我添加这个捆绑的依赖项时, 'com.google.android.gms:play-services:12.0.1' , (FirebaseInstanceIdService,FirebaseMessagingService) 这两个类没有响应。
我尝试过的解决方案:
添加 firebase 消息传递依赖项。
在示例应用程序中使用我的应用程序的 google-services.json 并且通知工作正常..
<service android:name="com.Bookerr.android.services.MyFirebaseMessagingService"
android:permission="true">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service android:name="com.Bookerr.android.services.MyFirebaseInstanceIDService"
android:permission="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
// this is my GRADLE FILE
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.Bookerr.android"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
/*compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}*/
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.ss.bannerslider:bannerslider:1.8.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'uk.co.chrisjenx:calligraphy:2.2.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.squareup.retrofit:retrofit:1.9.0'
implementation 'com.squareup.okhttp:okhttp:2.7.5'
implementation 'com.squareup:otto:1.3.8'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
implementation 'com.stripe:stripe-android:6.1.2'
implementation 'com.stripe:stripe-java:5.33.2'
implementation 'com.stripe:stripe-android-pay:4.1.3'
implementation 'io.branch.sdk.android:library:2.19.5'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.github.sundeepk:compact-calendar-view:2.0.2.3'
implementation 'com.koushikdutta.ion:ion:2.2.1'
// implementation 'com.google.android.gms:play-services-auth:16.0.1'
// implementation 'com.google.android.gms:play-services-plus:16.0.0'
// implementation 'com.google.android.gms:play-services-gcm:16.0.0'
// implementation 'com.google.android.gms:play-services-maps:16.0.0'
// implementation 'com.google.android.gms:play-services-location:16.0.0'
// implementation 'com.google.android.gms:play-services-places:16.0.0'
// implementation 'com.google.android.gms:play-services-vision:17.0.2'
// implementation 'com.google.firebase:firebase-storage:16.0.5'
// implementation 'com.google.firebase:firebase-messaging:17.3.4'
// implementation 'com.google.firebase:firebase-core:16.0.7'
// implementation 'com.google.firebase:firebase-database:16.0.6'
// implementation 'com.google.firebase:firebase-auth:16.1.0'
// implementation 'com.firebaseui:firebase-ui-auth:0.6.0'
//
implementation 'com.google.android.gms:play-services:12.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
解决方案
推荐阅读
- php - 如何在PHP中的单个字符串中替换所有时间戳?
- ios - 构造数据数组的最佳方法,其中每个项目都可以分成不同的部分?
- spring - PublisherSubscribeChannel 中的 Spring 集成处理异常
- r - 条件连接列
- powershell - 通过power shell脚本将磁盘号映射到windows server中的集群资源
- python - camelot 可以使用 pdf "primitives" 来提取数据吗?
- python - Python obd 没有将树莓派连接到汽车
- mongodb - 想为我的项目的 mongodb/mongoose 中的时间表创建一个模式,以及如何使用用户对其进行建模
- python - TypeError:需要一个类似字节的对象,而不是请求中的“str”有什么问题?
- asp.net-core - 为什么我不能在功能块内使用原始元素?