我正在使用 nuget 包Xamarin.Firebase.Messaging
并Xamarin.GooglePlayServices.Base
在我的应用程序中接收推送通知,以前它工作正常,但是当我更新时visual studio 2022 to 17.2.3
它停止工作
我尝试了所有这些:
<PackageReference Include="Xamarin.Google.Guava" ExcludeAssets="all"> <Version>27.1.0</Version> </PackageReference>
我之前所做的一切都不起作用
我的接收推送通知的代码:
using System;
using System.Threading.Tasks;
using Android.App;
using Firebase.Messaging;
using Plugin.DeviceInfo;
using Xamarin.Essentials;
using Xamarin.Forms;
namespace MyApp.Droid
{
[Service]
[IntentFilter(new[] { "com.google.firebase.MESSAGING_EVENT" })]
public class MyFirebaseMessagingService : FirebaseMessagingService
{
readonly AndroidNotificationManager _androidNotification = new AndroidNotificationManager();
public override void OnMessageReceived(RemoteMessage message)
{
var mensajeData = message.Data;
string title= mensajeData["notiTitle"];
string bodymessage= mensajeData["notiBody"]; …
Run Code Online (Sandbox Code Playgroud) push-notification xamarin.android firebase xamarin.forms firebase-cloud-messaging
firebase ×1