Receive push notification with APP closed (iOS) - push-notification

Hello fellow Xamarin developers,
We are developing an APP that should receive push notification, even with APP closed.
I am receiving notifications when the APP is open or in the background, but after restarting the device the notifications are not received.
Note:
I read the content of the page https://developer.apple.com/reference/uikit/uiapplicationdelegate
I added in Info.plist: UIBackgroundModes / remote-notification
Overwrote the methods: RegisteredForRemoteNotifications, ReceivedRemoteNotification and DidReceiveRemoteNotification
Any tips? Can I actually receive notifications after rebooting the device? I would need to create some service to register the device (In Android was necessary to create the service, in Windows-UWP No)?
Thank you very much!

I following this tutorial and it's working for me perfect
https://learn.microsoft.com/en-us/azure/notification-hubs/xamarin-notification-hubs-ios-push-notification-apns-get-started

Related

How to make video call with IceLink, when the peer app is closed

I have a Xamarin.Forms app. In it, I implemented video chat functionality (that supports iOS and Android) using IceLink. The video chat works when both the caller and the recipient have their apps open. Now I wonder how I can make a call to a device which has the app not open.
For Android
You can send notification by Firebase Cloud Messaging when device do not open, click the notification to open your application, show the video chat page.
If you use a high priority FCM for an app, it will allow that app to run services in the background for a short period of time. This would be a good alternative to having a background service that polls an app in the background:https://learn.microsoft.com/en-us/xamarin/android/app-fundamentals/services/#background-execution-limits-in-android-80
For iOS
You can refer to Jack's reply.
https://stackoverflow.com/a/60001529/10627299

How to create a "real" iOS push notification from Firebase topic messages if the app is not running?

As far as I understand messages on subscribed topics are received through the socket connection.
So while the app is running in the background I could create local notifications and "fake" notification that pop up on the home screen and are visible in the notification center.
But is there a way to receive topic pushes if the app is closed/not running in the background?
I'm grateful for any kind of feedback as I couldn't find any documentation regarding that specific use case.
Just to clarify: I am talking about (subscribed) topic messages in firebase NOT the firebase messages. I am used to the generic iOS push notifications handling and the involved lifecycle methods. All I need to know is how firebase topic messages can be sent via apns notifications.
With Firebase Messaging you can send notifications so the app is closed (it must be installed), basically it is configured in the AppDelegate the methods and configuration according to your need, you can see more information here Firebase Messaging
No you can’t, setup your configration in apo delegate and firebase settings, when the app is offline firebase talked directly to the APN which called the nitification center in your iphone but you don’t have access on it during the application is closed.

How to Send Push Notification from Xamarin Form app?

Hi I am new to Xamarin forms App development. I recently set up Push Notifications through App center & Firebase. This allows me to send push notifications through their console. However Is there Library or Nuget Package By which I can send These Push notifications through .NET? i.e Send a push notification through my C# Code.
Preferably not using Web Request etc.
This is broad question. We can't provide you exact solution. I have collected all the Proper Links these should get you Setup your App Center and your Xamarin Forms Apps. Please follow the instruction throughly.
Configure App Center Push Server :
As you said, You have already setup the App Center to send push notification. I hope you setup all the instruction correctly otherwise use the following link to read more in details :
iOS : https://learn.microsoft.com/en-us/appcenter/sdk/push/ios
Android : https://learn.microsoft.com/en-us/appcenter/sdk/push/android
Configure your Forms App:
To Setup your Xamarin forms app to receive the Push notification. Please following the following :
https://learn.microsoft.com/en-us/appcenter/sdk/push/xamarin-forms
Send/Subscribe/UnSubscribe the Push notification:
You can call the App Center Push notification API which will send the push notification to specified Device or to the group of devices.
Please go through the following link to learn more about App Center Push API's:
https://learn.microsoft.com/en-us/appcenter/push/pushapi
Let me know; If you stuck on specific problem.

Unable to receive notification when app closed

How I can receive push notification when app was closed?
When I roll up app notification received, but when I close - no.
I`m using react-native and onesignal.
You should look how to intent a service in react-native. A service work apart from the main thread of the app, so when the app is closes the service is steal working.

Push notification to iOS not working when message received

I have a Worklight app doing push notifications. Sending the push causes the notification to appear in the notification bar on both Android and iOS as expected. If the push is received while the app is running, it calls the message handler function as it is supposed to.
The issue I'm having is that if you launch the app by tapping on the notification on iOS, the message handler never gets called if another push is sent while the app is running. I have to exit the app and kill it completely, then relaunch the app from the launcher. Then if the push is received while the app is running, it will call the message handler.
This only occurs on iOS. The app will respond to a received message on Android while the app is running, even if the app has been launched by tapping on the notification.
EDIT:
I did struggle to verbalize the scenario, couldn't find the right words that made sense, but the steps you have done Idan are largely correct for what I'm trying to do. We are doing tag based notifications, so that is different that what you have done. We are also using PersistentCookieAuthentication as they wanted push notifications to be sent without the user having to explicitly logging in.
We are currently using WL build 6.2.0.01-20141216-0427
We've tried it on a couple of different models, an iPhone 4s running 8.0.2, and an iPhone 5 running 8.1.2.
Edit based on the edited question:
Tag-based notifications do not require any login, as it is the device that is to be subscribed to any tags that you define in application-descriptor.xml; it is not login-based, so any type of login that you are doing it irrelevant. The push will be sent to any device (app...) that was subscribed to your tag using the subscribeTag API.
I did another test in iOS using a broadcast-based notification (it's basically like tag-based notifications). I kept the app in the background and sent a notification. Tapping on the incoming notification in the notification bar brought the app to the foreground, which then displayed the alerts of the incoming notification.
You can try it with this application: https://www.dropbox.com/s/l2yk2pbvykrzfoh/broadcastNotificationsTest.zip?dl=0
Make sure to place your own .p12 certificate and pushSender password.
I've been trying to understand your scenario... I suspect you've left out something or need to better word the problem description.
Here's what I've tried using MobileFirst Platform 6.3 (no drastic push changes in iOS between 6.2 and 6.3) and iPhone 6 running iOS 8.1.2.
Launched sample push notifications app (which uses event source-based notifications) on device
Logged-in > Subscribed
Quit application
I then sent a notification by invoking the adapter in the Studio
The notification arrived and displayed in the notification bar
Tapping the notification launched application
Logged-in
The notification alerts were then displayed.
I then moved the application to the background.
Sent another notification, which was displayed in the notification bar upon arrival
Tapping this second notification brought the application to the background, displaying the alerts
I then kept the application in the background.
Sent a third notification
In this case, because the application is in the foreground, the notification did not display in the notification bar -- as expected -- and instead the alerts were displayed right away.
If your scenario is different than the above, such as: you're not even using event source-based notifications but rather broadcast- or tag-based notifications, or your application flow differs, etc then please edit the question with a more precise description.
When you edit the question, also mention the following:
Worklight version and build number
Device model
Used iOS version
I am aware of one possible issue (APAR #PI31988) that is currently under investigation, where the underlying native code dispatches the message before the JavaScript framework is ready to handle it, thus no message is displayed. This was found to happen in slower devices such as iPhone 4.

Resources