标签: firebase-cloud-messaging

Firebase handleIntent AbstractMethodError

当我在Android上收到推送通知时,我收到以下错误.我似乎无法找到任何有关它的信息.有人可以帮忙吗?我真的很茫然.

致命异常:pool-1-thread-1进程:com.mycompany.myerror,PID:22712 java.lang.AbstractMethodError:abstract method"void com.google.firebase.iid.zzb.handleIntent(android.content.Intent)"来自java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)的com.google.firebase.iid.zzb $ 1.run(未知来源),位于java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java) :588)在java.lang.Thread.run(Thread.java:818)

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:appcompat-v7:25.3.0'
    compile 'com.android.support:support-v4:25.3.0'
    compile 'com.android.support:design:25.3.0'
    //https://developers.google.com/android/guides/setup
    compile 'com.google.android.gms:play-services-places:10.2.1'
    compile 'com.google.android.gms:play-services-maps:10.2.1'
    compile 'com.google.android.gms:play-services-location:10.2.1'
    compile 'com.google.android.gms:play-services-vision:10.2.1'
    compile 'com.google.android.gms:play-services-gcm:10.2.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.google.zxing:core:3.2.0'
    compile 'com.journeyapps:zxing-android-embedded:3.5.0'
    compile 'com.loopj.android:android-async-http:1.4.9'
    testCompile 'junit:junit:4.12'
}
Run Code Online (Sandbox Code Playgroud)

FirebaseMessagingService.java

public class FirebaseMessagingService extends FirebaseMessagingService {

    private static final String TAG = "FCM Service";

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) { …
Run Code Online (Sandbox Code Playgroud)

android push-notification firebase firebase-cloud-messaging

22
推荐指数
2
解决办法
9213
查看次数

Apple Push Notification 服务服务器证书更新

2021 年 3 月 29 日,与 Apple 推送通知服务的基于令牌和证书的 HTTP/2 连接必须包含新的根证书 (AAACertificateServices 5/12/2020),以取代旧的 GeoTrust Global CA 根证书。为确保无缝过渡并避免推送通知传递失败,请在 3 月 29 日之前验证 HTTP/2 接口的新旧根证书都包含在每个通知服务器的信任存储中。

请注意,此时无需更新 Apple 向您颁发的 Apple Push Notification 服务 SSL 提供商证书。

我收到了关于更新推送通知证书的电子邮件。我已将 FCM (Firebase) 配置为使用 APNs 身份验证密钥发送推送通知。我还没有为推送通知生成任何证书。

我需要改变什么吗?

ssl apple-push-notifications ios firebase firebase-cloud-messaging

22
推荐指数
1
解决办法
3313
查看次数

如何在应用程序处于前台时处理火基通知

我已将Fire基础云消息传递与我的应用程序集成.当我从firebase控制台发送通知时,如果app处于后台/未打开,那么我收到通知,

但当应用处于前台/开放时无法接收通知

所有建议都表示赞赏.

android broadcastreceiver firebase-cloud-messaging

21
推荐指数
2
解决办法
3万
查看次数

Android:订阅Firebase云消息传递(FCM)主题

根据Firebase云消息传递文档,用于订阅用户我需要调用的主题

FirebaseMessaging.getInstance().subscribeToTopic("news");
Run Code Online (Sandbox Code Playgroud)
  1. 在我的应用程序中,我需要所有用户订阅我的云消息传递主题.既然返回值是void,问题是我如何理解订阅是否成功?
  2. subscribeToTopic每次我的应用程序启动时调用是不好的做法 ?

android firebase firebase-cloud-messaging

21
推荐指数
1
解决办法
2万
查看次数

Firebase云消息传递 - 管理注册令牌

我正在考虑使用Firebase云消息传递实现移动和浏览器应用之间的消息传递,我有几个问题,文档似乎没有回答.

为了能够接收消息,您需要注册令牌(RT).消息可以发送到RT,主题或设备组notification_key.也可以使用RT:

  • 订阅主题
  • 添加到设备组

RT也可以过期/更改.

在我的应用程序中,我正在维护每个用户的RT列表.现在,当RT改变时:

  1. 我是否必须取消订阅旧令牌并将新令牌订阅到主题?
  2. 我是否必须删除旧令牌并将新令牌添加到设备组?
  3. 是否可以获取有关令牌的设备组/主题的信息?
  4. 我可以多次向设备组添加令牌吗?
  5. 我可以多次为某个主题订阅令牌吗?
  6. 多个订阅/添加相同令牌会导致接收重复消息

对不起,这是很多问题,但我想,对于那些经历过这个问题的人来说,它应该是馅饼;)

registration token firebase firebase-cloud-messaging

21
推荐指数
1
解决办法
5767
查看次数

Firebase:如何在Android应用中设置默认通知频道?

如何为应用程序在后台时出现的通知消息设置默认通知通道?默认情况下,这些消息使用"杂项"通道.

android firebase firebase-cloud-messaging android-8.0-oreo

21
推荐指数
2
解决办法
2万
查看次数

在Android Oreo版本中没有收到FCM通知消息?

我已经从服务器向用户发送FCM通知.它工作正常(直到api 25),但在奥利奥,当应用程序没有在后台(服务已关闭)(或)完全关闭.我没有得到任何FCM通知在这种情况但在Whatsapp工作正常.这里我附上了FCM代码

的Manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.fcm">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service
            android:name=".MyFirebaseMessagingService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT"/>
            </intent-filter>
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
            </intent-filter>
        </service>

        <meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/ic_stat_ic_notification" />

        <meta-data
            android:name="com.google.firebase.messaging.default_notification_color"
            android:resource="@color/colorAccent" />

        <meta-data
            android:name="com.google.firebase.messaging.default_notification_channel_id"
            android:value="fcm"/>

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

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

    </application>

</manifest>
Run Code Online (Sandbox Code Playgroud)

应用程序/ gradle这个

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.fcm"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 1
        versionName "1.0" …
Run Code Online (Sandbox Code Playgroud)

android firebase firebase-cloud-messaging

21
推荐指数
2
解决办法
1万
查看次数

尝试在 Firebase Cloud Functions 中使用 Firebase Cloud Messaging 发送推送通知时未找到请求的实体

我正在尝试使用以下代码通过 FCM 从 Firebase Cloud 函数发送多播通知:

const message = {
    tokens: recipients,
    notification: {
        title: title,
        body: body
    },
    data: {
        projectPartnerId: projectPartnerId
    }
};
return admin.messaging().sendMulticast(message);
Run Code Online (Sandbox Code Playgroud)

并且没有发送任何推送通知。每个响应都包含一个带有相同消息的错误:“未找到请求的实体”。

我在 Google Cloud 控制台中启用了 API(Firebase 文档中没有提到它,但显然这是必要的)。我不知道我还能做什么。我能找到的所有其他问题都与 HTTP API 或遗留 API 相关。我使用的是最新版本的 Firebase Admin SDK。

firebase firebase-cloud-messaging firebase-admin

21
推荐指数
2
解决办法
3万
查看次数

iOS 14 上的 Flutter FCM

对于更新到 iOS14 和 Xcode12 后从 FCM 发疯的每个人。我花了 2 天时间来解决这些问题。在模拟器上,它可以工作,但在真实设备上,它没有。也许这些说明可以帮助某人并防止浪费时间。此外,如果所有这些步骤都可以改进,那么听取 Flutter Guru 的一些想法会很棒:)。谢谢!

XCode 设置

在此处输入图片说明

AppDelegate.swift

import UIKit
import Flutter
import GoogleMaps
import Firebase
import FirebaseMessaging

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    if #available(iOS 10.0, *) {
      UNUserNotificationCenter.current().delegate = self as UNUserNotificationCenterDelegate
    }
    GMSServices.provideAPIKey("")
    GeneratedPluginRegistrant.register(with: self)
    application.registerForRemoteNotifications()
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }

    override func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
        Auth.auth().setAPNSToken(deviceToken, type: .prod)
    }

    override func …
Run Code Online (Sandbox Code Playgroud)

ios dart firebase flutter firebase-cloud-messaging

21
推荐指数
1
解决办法
3019
查看次数

如何从节点服务器发送Firebase云消息传递?

有没有办法FCMnode.js服务器发送通知?

我在文档中没有找到任何关于它的内容.

node.js firebase firebase-cloud-messaging

20
推荐指数
2
解决办法
2万
查看次数