-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Token generated on iOS is similar to Android token. Cannot received push notification. #337
Comments
Is what you've done here not covered in https://github.com/AdamEssenmacher/GoogleApisForiOSComponents/blob/main/docs/Firebase/CloudMessaging/GettingStarted.md? |
I am using Plugin.Firebase, which I believe have implemented as per the link you shared. My belief is that Plugin.Firebase covers the internals of your iOS components. That's what I see from the source code (Plugin.Firebase). I am receiving token but of different format (very similar to Android token) on iOS. Why would that be? |
Plugin.Firebase is just a cross-platform wrapper over the .NET binding libraries for each platform, which themselves are just wrappers around the native Firebase libraries. Plugin.Firebase does not configure your platform projects for you. |
@gautambjain may i know detailed about code changed that you've write to receive token like you've got? |
@suariana - It is hard to recollect the exact changes I made to fix this. But I know that I reverted back the old methods of receiving push notifications. I had just installed Plugin.Firebase so that the require pre-requisites are installed. As Adam said above, we have do manually do the configuration in the code to receive the push notifications in the lines of: [Export("application:didRegisterForRemoteNotificationsWithDeviceToken:")] |
On iOS, the token generated is of below format:
csxgLoBcFkCLgJ7xTe1YML:APA91bFJi7WXJh_-0nRXTlDvy_RRh1KY_vD3s58ScMKzcD-VIGcZ4tNX6sq9KSOJPB2YWsecPzHRchUufqeBa9mSMPYBXxeIYEHjEr9frHG8ip_QiAPmxP9dwwFyo9HO3_mSS9H4IhD5
Due to this, I don't receive push notification on NotificationReceived.
So I disabled TokenChanged and wrote my own handler like below in AppDelegate:
In order to register for remote notifications, I called:
UIApplication.SharedApplication.RegisterForRemoteNotifications();
After making the above changes, token generated in below format
512AE6E911F52E3D1EB76D8790AA3B327C9106A65F54D1DE6A18A6751E0BA7FB
And I started receiving push notifications.
I am sharing my experience here so that you can point out what am I missing. These look like bugs. And if you think I am using Plugin.Firebase the wrong way, then kindly show the way please.
The text was updated successfully, but these errors were encountered: