Closed johnug closed 5 years ago
Hi @johnug, thanks for bringing this to our attention. Your feedback has been shared with the content owner for further review.
@Grace-MacJones-MSFT please assign this to me.
@johnug we're refreshing the SDK samples and the docs.
Step 12. using WindowsAzure.Messaging; not available for Xamarin.Forms platform. Replaced with NotificationHubClient. Doesnt work, no notifications are coming, code won
t even enter to any of declared classes.
@spelluru Can you please take a look at this? Do we need an update?
@jwargo - The original issue reported has been resolved. We have updated this tutorial to use channels. It uses NotificationCompat.Builder now. Thanks.
@MrXLR8 - Not sure I understand the issue. In this tutorial, you create "Android App(Xamarin)", not "Android XAML App(Xamarin.Forms)". Thanks.
There is no Register() method in the Microsoft.Azure.NotificationHubs packages. The class is NotificationHubClient and it contains a CreateRegistration/CreateUpdateRegistration but this guide doesn't cover how to use it.
Apart from this, according to the official Google migration guide from GCM to FCM you should remove certain permissions from the manifest since they can cause duplicate notifications but this guide suggests that we should add them, is this correct?
Will this be updated?
***Update: NotificationHub is a different class from a different namespace. My second question is still valid though. Should we add the permissions in the manifest? Or remove them per this guide: https://developers.google.com/cloud-messaging/android/android-migrate-fcm?utm_source=gcm-deprecation-last-round-msa&utm_medium=email#update-server-endpoints
@JPSiller the Engineering team is looking at this and yes we will make docs updates for this. It is my understanding that the permissions must be removed, but checking with people smarter than me (on this topic).
@jwargo I was able to do the migration. I removed the permissions per Google's guide. FCM library adds them automatically. For the InstanceID and FCM service I just had to add the attributes directly in the services class and xamarin creates the permissions, the services do not have to implement "Export=false" anymore.
Another important change is the with FCM you no longer have to request the token passing the SenderID, the FCM library obtains it automatically when you call it (no parameters needed).
Hope this helps with the doc's update.
@JPSiller thanks.
@spelluru any pending updates based on this conversation?
@jwargo - I had tested and updated the tutorial a month ago. I can test it again and see if there's an issue. Thanks.
Regarding Step 14, the SendNotification() method does not work when Target Android version is API 26 and above. This is because starting from Android Oreo (API level 26), all notifications must be assigned to a NotificationChannel. Additionally, it might be better to use NotificationCompat.Builder instead of Notification.Builder?
To create NotificationChannel programmatically, one could follow the guide provided in the following link: https://docs.microsoft.com/en-nz/xamarin/android/app-fundamentals/notifications/local-notifications#notification-channels
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.