Forum Xamarin.Mac

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Azure/APNS Push Notifications in Xamarin.Mac

AllanChin.6924AllanChin.6924 USUniversity ✭✭✭

I'm seeing a lot of documentation for supporting such Push Notifications from Azure in iOS, Android, and Forms. Is there support for it in Xamarin.Mac apps? If so, can you point me to any documentation on how to do it? If not, how can a Xamarin.Mac app receive a Push Notification?

Thanks

Answers

  • ChrisHamonsChrisHamons USForum Administrator, Xamarin Team Xamurai

    This suggests it should work with .NET Standard.

    https://azure.microsoft.com/en-us/updates/azure-notifications-hubs-net-sdk-now-compatible-with-net-standard-2-0/

    XM Modern projects are that by default. XM Full need to swap their .NET version to 4.7 but they should be good as well.

    See https://developer.xamarin.com/guides/mac/advanced_topics/target-framework/ for more details on the various XM project types.

  • AllanChin.6924AllanChin.6924 USUniversity ✭✭✭

    Thanks Chris.

    This suggests that these notifications are not supported for XM Modern, which of course is our project. But, it's an old post so I will investigate more.

    https://stackoverflow.com/questions/45981638/xamarin-mac-azure-notification-hub

  • AllanChin.6924AllanChin.6924 USUniversity ✭✭✭

    I was able to install the Microsoft.Azure.NotificationsHub package into our XM Modern app presumable because we are building against .Net 2.0.

    .NET Core
    Runtime: /usr/local/share/dotnet/dotnet
    Runtime Versions:
    2.0.5
    2.0.0
    SDK: /usr/local/share/dotnet/sdk/2.1.4/Sdks
    SDK Versions:
    2.1.4
    2.0.0

    But, it's unclear if XM apps should be receiving push notifications via APNS or MSN. The Microsoft.Azure.NotificationHubs namespace seems to imply receiving native MNS notifications, but in the Azure portal, setting up an MNS notification requires registering the receiving apps in the Windows Developer Center which doesn't quite sound like the right thing to do for an XM app.

    I'm investigating ways to receive push notifications in our XM app in any way possible at this point. It would be great if there was evidence that this was ever actually successfully done before. And even better if there was good documentation on how it was done and even a XM test app demonstrating how to do it.

    Has anybody out there done this?

    Thanks.

Sign In or Register to comment.