Xamarin FCM 主题订阅

Xamarin FCM Topic Subscription

我正在使用 Xamarin Studio 开发一个 Android + iOS 应用程序,我最近通过 Firebase 集成了通知管理系统,但是我在订阅主题时遇到了一些问题,我将向 Android 应用程序解释我已正确配置所有内容,因为如果通过仪表板向 Android 用户段发送通知 Firebase 应用程序注册并正确接收,那么我已添加到 MainActivity这一行: FirebaseMessaging.Instance.SubscribeToTopic ( "news"); 在 "Task.Run (() =>" 中和调用 Forms

的 "LoadApplication" 方法之前

然后,当我编译并启动应用程序时,输出如下:“[FirebaseInstanceId] topic sync succeeded” 但是当我登录到仪表板 Firebase 以在主题中进行消息发送测试时,当我转到 select 时,"Topics" 被写为:"This project has no arguments"

我想问一下你是否可以指导我可能取决于什么? 还有你是怎么解决的? 也许我需要包含一些其他许可 nell'AndroidManifest? 还是必须先确保连 iOS 项目都订阅同一个主题 Android? 又或者还有其他我在做的目前不知道的事情你可以告诉我吗?

非常感谢您。

为了清楚和准确起见,下面进行 Firebase nell 的配置'AndroidManifest.xml 我在节点下输入“

<receiver 
        android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver" 
        android:exported="false" />
    <receiver 
        android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" 
        android:exported="true" 
        android:permission="com.google.android.c2dm.permission.SEND">
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
            <category android:name="${applicationId}" />
        </intent-filter>
    </receiver>

我还想澄清一下,我已经通过 selecting 作为 BuildOptions -> "GoogleServicesJson"

在项目中插入了 "google-services.json" 文件

相反,我在项目中使用的包版本 Xamarin.Firebase.Messaging 是“32.961.0”

再次提前感谢大家

您最近为客户订阅的主题可能需要几个小时(最多可能一天)才能显示在 Firebase 通知控制台中。

此时您可以做的是通过 or cURL

将消息发送到主题