在我的Xamarin.iOS项目中,我更新了Firebase nuget程序包,完成更新后,我开始在此代码上出错
//You'll need this method if you set "FirebaseAppDelegateProxyEnabled": NO in GoogleService-Info.plist
public override void RegisteredForRemoteNotifications (UIApplication application, NSData deviceToken)
{
SISConst.PushInfo = new PushNotification();
SISConst.PushInfo.DeviceID = deviceToken.ToString();
NSUserDefaults.StandardUserDefaults.SetString(deviceToken.ToString(),"dToken");
#if DEBUG
Firebase.InstanceID.InstanceId.SharedInstance.SetApnsToken(deviceToken, Firebase.InstanceID.ApnsTokenType.Sandbox);
#if RELEASE
Firebase.InstanceID.InstanceId.SharedInstance.SetApnsToken(deviceToken, Firebase.InstanceID.ApnsTokenType.Prod);
}
下面的行显示错误
Firebase.InstanceID.InstanceId.SharedInstance.SetApnsToken(deviceToken, Firebase.InstanceID.ApnsTokenType.Sandbox);
请参阅屏幕截图以获取更多信息
我该如何解决这个问题?
几个小时后得到答案
if DEBUG
Firebase.CloudMessaging.Messaging.SharedInstance.SetApnsToken(deviceToken, ApnsTokenType.Sandbox);
endif
if RELEASE
Firebase.CloudMessaging.Messaging.SharedInstance.SetApnsToken(deviceToken,ApnsTokenType.Production);
endif
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句