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

A Note About Push Notifications

$
0
0

I aim to be the knight in shining armor with this post...

For the last 5 days, I have worked 8 hours a day in order to solve why Xamarin was rejecting push notifications from external services such as parse (through bindings) and Pushwoosh (they have company-made bindings). I worked effortlessly, thinking that the app was somewhere misdirecting and handling the push notifications, possibly through external dependencies. I thought permissions might be wrong, compile versions, or Assembly Info. I created a new Xamarin.Android project which worked with identical code and (identical) android manifest files. That worked and notifications appeared fine. This led me to believe Shared Projects might mess up notifications, which I thought to be impossible. The Pushwoosh sample led me in the right direction, as I placed break-points in the message-received section. Although this fired, and had the correct json, a push notification wouldn't show up. I was frustrated.

After around 36 hours of work, I began today at around 11:45. At around 1:00, I began to think that perhaps the notification was failing to create locally, as I was receiving messages successfully. I looked into android resource files, but everything looked OK. At 1:30, still on this train of thought, I found that my application section of Android Manifest had no icon defined. I thought "Surely Google/Android would crash the app, warning the user that no icon is defined when the push notification attempts to be created. Surely they would handle the exception and tell the app user. Surely they would route the icon to default if one wasn't defined. Surely they would document this on their website". I compiled. I sent. I received.

Ultimately, a warning to anyone using push notifications: If for whatever reason you have no default Icon defined, Android will handle it silently when creating a notification and fail to alert you. There is no documentation on this. For those of you finding this thread from google, searching "push notification won't appear in system tray", here is probably your solution.

Thanks,

Michael


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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