0

I would like to ask if someone could help with a problem which i have. I have generated the Authentication Key (.p8). Also i have set it into the firebase console under the tab "Cloud Messaging". While i successfully completed the android push notification process, i get stuck on IOS implementation. I test the APNS with the pusher app and it works just fine. So the certificate is correct. When i use the firebase console the error is "Unregistered registration token". Of course i use the token which is generated from firebase plugin and not the token from APNS. I use xamarin form for the development and the plug in is Plugin.FirebasePushNotification by Rendy Del Rosario. i follow the instructions from the github. Below is the code :

code inside the AppDelegate.cs file // Here is the code to Initialize the FirebasePushNotificationManager

public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            global::Xamarin.Forms.Forms.Init();
            LoadApplication(new App());
            FirebasePushNotificationManager.Initialize(options, true);
            return base.FinishedLaunching(app, options);
        }

Function prints the token from APN which i use to send notification from the pusher app. The generated token is valid

public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
        {
            byte[] deviceTokenBytes = deviceToken.ToArray();
            string deviceToken2 = 
            BitConverter.ToString(deviceTokenBytes).Replace("-", enter code 
            here"").ToUpperInvariant();
            Debug.WriteLine("------> " + deviceToken2);

 FirebasePushNotificationManager.DidRegisterRemoteNotifications(deviceToken);
        }

inside the App.cs file Function print the token which i use to send notification from the firebase console. The generated token is invalid and produce an error "Unregistered Registration Token"

CrossFirebasePushNotification.Current.OnTokenRefresh += (s, p) =>
            {
             System.Diagnostics.Debug.WriteLine($"TOKEN : "+ p.Token
            };

Can anyone help me?

Thanks

Dennis
  • 63
  • 7
  • 1
    Did you already [upload your APNS key](https://firebase.google.com/docs/cloud-messaging/ios/client#upload_your_apns_authentication_key) to Firebase? – James Poag Oct 05 '18 at 12:49
  • At first i had uploaded the keys APNs authentication key. Now i use the APNs Certificates. Still nothing. – Dennis Oct 05 '18 at 13:05
  • @Dennis Can you show the code setup push notification? – Chuong Tran Oct 05 '18 at 13:43
  • https://stackoverflow.com/questions/39672297/how-to-use-apples-new-p8-certificate-for-apns-in-firebase-console – Jhonny_C Oct 05 '18 at 17:56
  • I have generated the Authentication Key (.p8). Also i have set it into the firebase console under the tab "Cloud Messaging". I use Plugin.FirebasePushNotification by Rendy Del Rosario. i follow the instructions from the github. – Dennis Oct 08 '18 at 08:24

0 Answers0