handling push notification while app is running in background - apple-push-notifications

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.

Related

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

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.

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.

Simulating Apple Watch background push notifications PushNotificationPayload.apns

I can successfully use the PushNotificationPayload.apns file to simulate a push notification in the simulator but it simulates a foreground UIUserNotificationActionBehaviorDefault notification.
How can I simulate a background notification with an action behavior of UIUserNotificationActionBehaviorTextInput?

Display the push notification ios only if it for the user saved category inside app

I have created a shopping cart IOS app where the user can save Categories for which they are interested in (saved inside app localstorage). Now, whenever the admin is adding any product, I am sending the push notification from the server.
My question is how should i handle push notification, so that when my push notification will arrive on an ios device, it will check using APN PAYLOAD that if this product is from the user saved interested categories (saved inside app localstorage) and then display the push notification to the user, else the push notification will be ignored.
Can someone please tell me how to handle this exactly??
P.S - I am aware of the Silent Push Notifications and Push Notifications in IOS, the only problem is you can use the silent push notification for some app processing but again let's say if I send a Push Notification for an added product in cart, and when the app will receive the silent push notification and after code processing how I can again display the push notification again if the push notification is for the user interested category???

Windows Phone 7.5 - Push Notifications when app is tombstoned

I have written a Windows 7.5 phone app that registers for tile and toast push notifications with MPNS. I have all the infrastructure working and the phone registers with MPNS. I save the ChannelUri locally on the phone and then post the ChannelUri to a rest service endpoint on my website which records the device / ChannelUri. I'm able to send toast and tile messages from the web service and receive them on the phone without any problem. If the application is running I'm able to trap the ShellToastNotificationReceived event and can read the push notification details and I save the message to a local database in the application and the messages are also displayed to the user in a Listbox. The system is disconnected from my website other than having to register the ChannelUri and all the data I need is contained with the notification.
My question is when the application has been tombstoned and I send a push notification I see a toast message displayed by the phone OS and if I click on the toast I have put a URI pointing to a page in my application and this re-launchs the app and I can trap all the data in the message and can save it again to the database. But if the application is tombstoned and the user misses the toast I have no way of saving that message it is lost unless I write some logic to go back to my server and check if the messages I have locally match the ones it sent. Am I missing something or am I going to have to run a check with my server when the app re-launches and re-sync with my server for any toast push notifications the user might have missed.
Thanks
When a push notification is received while the application is not running or is tombstoned there is no way to handle the data if nothing was done with the missed toast. You might need confirmation logic on the server to check whether the message is received or not.

Resources