Simulating Apple Watch background push notifications PushNotificationPayload.apns - apple-push-notifications

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?

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.

iOS 11 push notification banner now shown while app in foreground

In doing some testing on the iOS 11 preview, I've noticed that when I get push notifications while my app is foregrounded the OS displays the system notification that you normally only see when your app is not active.
I didn't see anything announced as having been changed, or any new APIs to change this behavior one way or another. Does anyone know or have links to documentation stating if this is intended, a bug, temporary, or what?
There's an option for showing Push Notifications in the foreground in UserNotification framework.
- (void)userNotificationCenter:(UNUserNotificationCenter *)center
willPresentNotification:(UNNotification *)notification
withCompletionHandler:(void (^)(UNNotificationPresentationOptions options))completionHandler
Quoting the comment from the Framework:
The method will be called on the delegate only if the application is in the foreground. If the method is not implemented or the handler is not called in a timely manner then the notification will not be presented. The application can choose to have the notification presented as a sound, badge, alert and/or in the notification list. This decision should be based on whether the information in the notification is otherwise visible to the user.
This could be the place to start looking for the answer.

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.

push notification badge does not reset when app opened - Trigger IO

iOS badge does not clear via Parse REST Push notification API if called when app is opened, and if we call API on app paused event provided by trigger io it still doesn't get clear as code doesn't get executed in app paused event until again app is resumed. note mention in this question not working https://www.parse.com/questions/push-notification-badge-not-resetting-via-rest-api
You can reset the badge with the Forge Notification module:
forge.notification.setBadgeNumber(number, success, error)
See https://trigger.io/modules/notification/current/docs/index.html#forgenotificationsetbadgenumbernumber-success-error

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