Sir*_*Art 3 android push-notification firebase xamarin firebase-cloud-messaging
我尝试按照教程进行操作:将通知推送到 Xamarin.Android (iOS 部分已经可以使用)
但我在构建时收到以下错误:
未为“ProcessGoogleServicesJson”任务提供所需参数“ResStringsPath”的值。服务工具标准.Android
到目前为止我所拥有的:
之后教程说“构建您的项目/运行您的应用程序...”,我收到错误。
*这里我不太确定在${applicationId}处填写什么:
<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>
Run Code Online (Sandbox Code Playgroud)
感谢您的帮助!
所以我不太确定为什么会出现这个错误。但将 Visual Studio 从 v15.7.1 更新到 v15.7.2 后,错误消失了。重启 Visual Studio 可能是解决方案?在教程中,它说如果您无法选择构建操作“GoogleServiceJson”,则必须重新启动。也许无论如何你都必须重新启动它。
对于 android:name="${applicationId}" 我使用了与 AndroidManifest 中“manifest”行中的“package”相同的内容。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="3" android:versionName="1.2" package="com.xxxxx.ServiceToolStandard" android:installLocation="auto">
[...]
<application android:label="ServiceToolStandard" android:icon="@drawable/icon">
<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="com.xxxxx.ServiceToolStandard" />
</intent-filter>
</receiver>
</application>
Run Code Online (Sandbox Code Playgroud)
现在我可以构建并运行该应用程序。此外,来自 Azure“测试发送”的推送通知也能正确接收。
| 归档时间: |
|
| 查看次数: |
1743 次 |
| 最近记录: |