【发布时间】:2020-01-24 14:26:31
【问题描述】:
应用程序未收到通知。
错误:
在 Java.Interop.JniEnvironment+InstanceMethods.CallObjectMethod(Java.Interop.JniObjectReference 实例,Java.Interop.JniMethodInfo 方法,Java.Interop.JniArgumentValue* args)[0x00069] in :0 在 Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualObjectMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* 参数) [0x0002a] in :0 在 WindowsAzure.Messaging.NotificationHub.Register (System.String pnsHandle, System.String[] tags) [0x00043] in :0 在 D:\Projetos\SIAGRIAutorize\SiagriAuth\SiagriAuth\SiagriAuth.Droid\Services\MyFirebaseIIDService.cs:74 中的 SiagriAuth.Droid.MyFirebaseIIDService.SendRegistrationToServer(System.String 令牌,System.String pessoaId,System.String conta)[0x00035] --- 托管 WindowsAzure.Messaging.NotificationHubUnauthorizedException 堆栈跟踪结束 --- com.microsoft.windowsazure.messaging.NotificationHubUnauthorizedException:未经授权 在 com.microsoft.windowsazure.messaging.Connection.executeRequest(Connection.java:250) 在 com.microsoft.windowsazure.messaging.Connection.executeRequest(Connection.java:172) 在 com.microsoft.windowsazure.messaging.Connection.executeRequest(Connection.java:132) 在 com.microsoft.windowsazure.messaging.NotificationHub.refreshRegistrationInformation(NotificationHub.java:297) 在 com.microsoft.windowsazure.messaging.NotificationHub.registerInternal(NotificationHub.java:391) 在 com.microsoft.windowsazure.messaging.NotificationHub.register(NotificationHub.java:144)
注册:
void SendRegistrationToServer(string token, string pessoaId, string conta)
{
try
{
hub = new NotificationHub(Constants.NotificationHubName, Constants.ListenConnectionString, Context);
var tags = new List<string>();
tags.Add($"{pessoaId}-{conta}");
var reg = hub.Register(token, tags.ToArray()); // Error here
}
catch (Exception ex)
{
App.HandleException(ex);
}
}
在许多论坛中,他们说这是日期和时区问题。更正了服务器和应用程序上的时间,但通知仍然没有到达,帮助meee?
Xamarin.Azure.NotificationHubs.Android 0.5.0 版
【问题讨论】:
标签: c# xamarin push-notification android-notifications