1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-10 12:33:28 +00:00

Added Logs for PN registration checks (#1731)

This commit is contained in:
Federico Maccaroni
2022-01-25 16:33:33 -03:00
committed by GitHub
parent f1ccbbc105
commit 37f4439892
6 changed files with 61 additions and 16 deletions

View File

@@ -251,30 +251,36 @@ namespace Bit.iOS
return base.ContinueUserActivity(application, userActivity, completionHandler);
}
const string TAG = "##PUSH NOTIFICATIONS";
public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)
{
Console.WriteLine($"{TAG} FailedToRegisterForRemoteNotifications");
_pushHandler?.OnErrorReceived(error);
}
public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
{
Console.WriteLine($"{TAG} RegisteredForRemoteNotifications");
_pushHandler?.OnRegisteredSuccess(deviceToken);
}
public override void DidRegisterUserNotificationSettings(UIApplication application,
UIUserNotificationSettings notificationSettings)
{
Console.WriteLine($"{TAG} DidRegisterUserNotificationSettings");
application.RegisterForRemoteNotifications();
}
public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo,
Action<UIBackgroundFetchResult> completionHandler)
{
Console.WriteLine($"{TAG} DidReceiveRemoteNotification");
_pushHandler?.OnMessageReceived(userInfo);
}
public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)
{
Console.WriteLine($"{TAG} ReceivedRemoteNotification");
_pushHandler?.OnMessageReceived(userInfo);
}
@@ -315,6 +321,8 @@ namespace Bit.iOS
private void RegisterPush()
{
Console.WriteLine($"{TAG} RegisterPush");
var notificationListenerService = new PushNotificationListenerService();
ServiceContainer.Register<IPushNotificationListenerService>(
"pushNotificationListenerService", notificationListenerService);