parse-platform - Xamarin.Android 异常与 FCM & Parse
问题描述
我能够实现 Firebase 通知并成功地从 Firebase 控制台向客户端发送通知。当我使用 Parse SDK 通过 Parse Dashboard 发送通知时,就会出现问题。我正在使用 Xamarin.Android,而带有 FCM 和 Parse 的 Native Android 的文档并不完整。我注意到通过 Parse Dashboard 发送通知时,客户端出现以下异常:
Java.Lang.RuntimeException: Unable to instantiate service com.parse.fcm.ParseFirebaseMessagingService: java.lang.ClassNotFoundException: Didn't find class
当解析文档告诉我在下面实现以下清单时:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.xamarin.fcmexample" android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="20" android:targetSdkVersion="25" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="g" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">
<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>
<service android:name="com.parse.fcm.ParseFirebaseInstanceIdService" android:exported="true">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service android:name="com.parse.fcm.ParseFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<receiver android:name="com.parse.ParsePushBroadcastReceiver" android:exported="false">
<intent-filter>
<action android:name="com.parse.push.intent.RECEIVE" />
<action android:name="com.parse.push.intent.DELETE" />
<action android:name="com.parse.push.intent.OPEN" />
</intent-filter>
</receiver>
</application>
</manifest>
想知道我是否缺少任何东西来让 Xamarin.Android + Parse SDK + FCM 工作。谢谢。
解决方案
推荐阅读
- php - php7.4 扩展 amqp 已安装但未加载
- bash - 无法使用“未设置”操作数组
- ruby-on-rails - 未初始化的常量 (NameError) Ruby
- django - 谷歌云数据存储回滚之前保存的行
- python-3.x - groupby value_counts 存储在数据框中
- javascript - HTML5 Canvas Resize - 可以控制或预测内存问题吗?
- mat-table - Mat选项卡切换自定义按钮单击
- javascript - 如何在 ReactJs 中的箭头函数内传递事件和其他参数
- java - FileChooser 保存对话框上的 JavaFX ExtensionFilter 在 macOS 上太宽
- php - 验证数组是否已存在于 mysql php laravel