Xamarin Forms Push notifications not received properly when the app is closed in android - xamarin

We have configured push notifications in our Xamarin Application for both android and iOS. In iOS notifications are being received properly. But in Android, specifically when the app is closed the notifications are not being received properly.
When the app is open, push notification is triggered and displayed properly as expected, can be observed in the screenshot attached.
When the app is closed, push notification is triggered and displayed as "body", can be observed in the screenshot attached.
Note* Notifications are being sent from ASP.net core with Azure Notifications hub.
The payload looks like below : new JObject(new JProperty("notification", pushMessage)).ToString(Formatting.None);
Andoid Notifications
I tried changing notification payload in different ways but still result didn't change.

Related

first app showing unread notification count from second app

Notifications from a previous app are being shown on the other app.
I have re-installed the app on multiple devices. If i send the notification out for one app then the unread notifications count of the other app are being displayed in the first app.
both apps are setup as different firebase projects.

Azure bot - show chat notifications in notification bar in cross platform moobile app (Xamarin)

i wanted to show azure's chat bots responses as notifications in the notification bar like PUSH notifications.
I've came across that i need to use xamarin webview to integrate bot in Android app. So, can webview capable of showing chat responses as push notifications ?
Note:-
I'm using Bot Framework SDK V4
and .Net Core
Xamarin for cross platform development
The WebChat control (webview in your questions) is used as a UX display control within your app. Messages from your bot to your app goes through a dedicated channel that has nothing to do with a mobile Push Notification. So in short, the answer to your question is no, this functionality is currently not supported by the client Webview control (WebChat).
With that said, you can create a custom middleware component for your bot that can send a Push Notification message using Azure Notification Hub. Or you can create custom functionality (sample showing a standard web app) in your bot that sends a push notification. Or your bot can drop a message to a queue and have an Azure Function pick the queue message and send the push notification. Note the last option is an implementation detail.

Is it possible display a banner for ios when receiving push notification while app is in foreground?

Currently my app can receiving push notification and display a banner when receiving a push notification while the app is in background.
But however when my app is in foreground, there is no banner showing up. I look in the log and I found out that I can receive push notification (i print out the payload).
Any way to display a banner while in app? Or is it a limitation?
I am using the Appcelerator Ti.Network.registerForPushNotifications for push notification.
This is not a limitation of Titanium.
Apple doesn't allow to show notification banner when app is in foreground.
All you can do is to create and animate a manual view when your Push callback is called in foreground state.

Using Swift 2 won't allow iOS 8 devices to Register for Push Notifications

I am configuring push notifications on for iOS using Xcode 7 and Parse. The notifications are working perfectly on a device running iOS 9.
But when running the application on a device with iOS 8, I am running into problems. I am unable to get the Alert View where the user can select to "Allow Notifications from App X".
But, the device token registration call is being called successfully when the user opts in to push notifications and the device is successfully registering an Installation object with a valid device token. Notifications are also being sent to the device.
If I go into Settings->Notifications->My App and turn the Notifications On or Off, it doesnt make a difference the notifications are still being sent through.
This is the code I am using to register for notifications:
let settings = UIUserNotificationSettings(forTypes: UIUserNotificationType([.Alert, .Badge, .Sound]), categories: nil)
application.registerUserNotificationSettings(settings)
application.registerForRemoteNotifications()
Found the solution here on stackoverflow... Registration for notifications are sent only once on devices running versions older than iOS 9.
As answered by another user here...
"The first time a push-enabled app registers for push notifications, iOS asks the user if they wish to receive notifications for that app. Once the user has responded to this alert it is not presented again unless the device is restored or the app has been uninstalled for at least a day."
OR
"If you want to simulate a first-time run of your app, you can leave the app uninstalled for a day. You can achieve the latter without actually waiting a day by setting the system clock forward a day or more, turning the device off completely, then turning the device back on."
Reference Links:
Push Notification ON or OFF Checking in iOS
https://developer.apple.com/library/ios/technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG42

handling push notification while app is running in background

I have implemented push notification in my app and it works fine when the app is not running. But when my app is send to background then no alert is being displayed regarding the push notification. What do I need to do so even if my app is in background I can display alert for push notification.
Any help would be appreciated.

Resources