Process received apple push notification in monotouch - ios

Is there a way to show or list Apple push notifications on any user page?
It's pretty hard to find where is the alert message is received.

Here is the Xamarin doc for Remote Notifications: http://docs.xamarin.com/guides/cross-platform/application_fundamentals/notifications/ios/remote_notifications_in_ios/.

iOS handles the push notification for you, your app is only informed of a push notification if you app is running in the foreground or when the user clicks on the notification and you app is opened.
With the iOS SDK there is no way to get a list of notifications for you app, the best way to create this is by keep a list server side.
Have a look at MonoTouch.UIKit.UIApplicationDelegate.ReceivedRemoteNotification Method

Related

Handle the remote notification for chat application in iOS

BACKGROUND
I am buidling a chat messaging applicaiton and I faced a problem handling push notificaton when user receiving message from the sender.
WHAT I WANT TO ACHIEVE
Like Whatsapp does, after I received the push notification and I turned on the airplane mode, I still can see the message contents while I open the app. so, I believe it has gotten the message while receiving the notification.
PROBLEM
I cannot find a good way to handle the remote chat message push notification when the user opens the app through its icon on the home screen instead of pressing or doing another action on the notification.
WHAT I TRIED
I manually loaded the message when the app did apear, but this is not like the tested behavior on Whatsapp.
I tried this third party socket library, but iOS killed the listening service once the app was closed, it is not applicable to what I want to build.
MY QUESTION
If still using the push notification or background mode remote notification, is that any way to able to handle the push notification when the app is not running?
I also find out about the Apple PushKit, I not sure if this is only allowed for VoIP providing apps. Does anyone know if Apple will accept my app to be published to their AppStore if I use the PushKit for only text messaging?
The untimate question, how can Whatsapp achieve this? Does it use PushKit as well?
Actually you can't handle something when your app is killed, so simple solution for you problem is to store all push notifications data in server , get it from server when you run app, and delete them once you got them. I think Whatsapp handle this in same way.
Just search about XMPP server, for live chat there is no need for Pushkit, Pushkit is only for Video call notification when app is terminated.
Use XMPP server for live chat integration.
https://code.tutsplus.com/tutorials/building-a-jabber-client-for-ios-xmpp-setup--mobile-7190
What is XMPP, and how can I use it within an iOS chat application?

Notification - when app is killed

I have implemented AWS SNS push notification service.
We have an issue which is explained below :
Scenario :
We are trying to save the notification message we receive as a part of requirement.
When the app is killed (swipe out from recent apps) we are able to receive notification, also we are able to save the notification message when we open the message directly from the notification panel it works fine,but when we open the app directly the notification message is not getting saved.
In short we are not able to know if we had received a notification message if we directly open the app rather than clicking the message from the notification panel.
Is this default behavior ? or is there any work around for this ?
Have looked into many posts on about Push Notifications but haven't seen any threads pointing to this scenario.
This is a normal behavior, and there is no workaround.
If your app is killed by the user, it won't be able to run ANY code before it's manually launched again.
If it's manually launched from a notification, this notification's payload will be handled by your AppDelegate.
On top of that, don't forget that Push notifications are Best Effort. That means that they are not reliable, they can be heavily delayed or never delivered at all. Don't rely on Push notifications to achieve any critical work.
If you need to keep a copy of your notifications in-app, keep them server side and fetch them as you would do with any other object.
In order to execute code when the app is killed by the user you need to implement VOIP using PushKit framework provided by apple.
VOIP push unlike regular push notification enables the app to become active even if the app is killed by user.

Callback function for push notifications while app is killed (titanium iOS)

I cant find a clear answer about this in the Titanium documentation. Is it possible to directly respond to a push notification while the app is killed ?
I know that the callback is called when you open the app trough the push notification. but is there a way to respond when the app is opened manually ?
I tried to use remote-notification as UIBackgroundModes, but this only helps for paused apps.
My goal is to show the push notification in a in-app message center.
You should never rely on push notifications to deliver you payloads, they are too limited for that. If the user receives 5 push notifications and opens the app via the app icon, you will never receive any of the payloads. If he opens the app via one of those notifications you will only receive that payload.
You could use silentpush:
http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Background_Services-section-37539664_iOSBackgroundServices-SilentPush
But the app should always query a back-end to get the actual data. That's how WhatsApp does it as well, as you can see when you open it via a notification it will then still fetch the message(s) form the server.

How can I turn off push notifications of other apps when Im using my app

I created an app which receives push notifications from my server. At the same time, if some other app is sending push notifications (for e.g., whatsaap, twitter), the notification is getting displayed when I'm using my app. I want to hide all other app's push notifications except my app's push notifications. Can this be done in iOS? I want my app to receive push notifications only from my server but not from the other apps.
Thanks in advance.
Try to think like your customer. Would they like to receive the push notifications of the other apps (whatsapp, twitter, the notification that a very important email just arrived)? Of course they would. Your App is one of many and most probably not the most important one they own.
Let me provide some background first.
Your app can only receive notifications from your service/server.
The user might have apps that are receiving notifications from the respective service/server.
e.g. if the user has FB app, then it would be receiving notification from FB servers.
In the end, you are only responsible for managing your service/server.
There is no way for you to block notifications that are received from other services from your app.
Hope this helps.

Using Apple Push Notification Service to Push Application Updates

I am new to iOS development and I recently came to know about the Apple Push Notification Service.
Does anyone know whether it is possible to push application updates to iPhone/iPad devices using Apple Push Notification Service..?
Thanks.
From the documentation:
Local notifications and push notifications are ways for an application
that isn’t running in the foreground to let its users know it has
information for them. The information could be a message, an impending
calendar event, or new data on a remote server. When presented by the
operating system, local and push notifications look and sound the
same. They can display an alert message or they can badge the
application icon. They can also play a sound when the alert or badge
number is shown.
So no, you can't push application updates. You could send a message telling the user that an update was available, though that would be considered pretty obnoxious by many users.

Resources