Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Xamarin.Forms iOS Can't Customize Notifications

$
0
0

I've been following the tutorial found at: https://azure.microsoft.com/en-us/documentation/articles/partner-xamarin-mobile-services-xamarin-forms-get-started-push/ to try and get push notifications to work in my Xamarin.Forms app.

I've got them working on Android, but I'm having a bug on iOS - I need to customize the text (from the phone) before the notification is actually made, but I can't on ios since when the app is running in the background, ReceivedRemoteNotification isn't being called.

Here's something similar to what my notification handling code looks like:

public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)
{
    NSObject inAppMessage;

    bool success = userInfo.TryGetValue(new NSString("inAppMessage"), out inAppMessage);

    if (success)
    {
        //change the text that is displayed
        string newNotText = ModifyNotification(inAppMessage.ToString());

        var alert = new UIAlertView("Got push notification", newNotText, null, "OK", null);
        alert.Show();
    }
}

How can I customize a notification that is received on iOS?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>