How to Save/store push notifications sent from Parse and print it out on any viewcontroller? - swift

I have finished an application with push notification setup through Parse and it was successful, I have followed the doc of Parse to setup push notifications on swift 2.0 ,I can send push notifications. However, I need to add one important thing to the app, is how to store/save the push notification message received to the app and to print it in one/any viewcontrollers? And, of course, any new push notification would replace the old one.

Save the notifications in a table on your server. Then when app is run, call web service and read notifications from that table

Related

Handle push notification action without pressed it

Hello everyone I’m trying to understand if it’s possible to handle push notification responses without press them? For example a log out from push notification who can be handled when app starts to run again and we received the push notification before
I hope can understand my question

How to test if Geoloqi push notifications are working or not?

For normal push notifications, when something new is added to a site, a push notification is sent to the device.
So if I want to test if push notifications work how do I do that?
I tried creating triggers and Geonotes on the console with the present location I receive on my iPhone. And then tried running the triggers hoping to receive a push notification, but unfortunately I am not getting any push notification.
What am I doing wrong?
I hope someone can help me with this.
You can use the message/send method to test sending a message directly to a device.
The simplest way is to log in to your own Geoloqi account from within your app, and then use the API console to send a message to your device. You can of course also send messages to other accounts, just take a look at the doc page for message/send.

any option to know if apple app get the push notification?

I build xcode app that get push notification, the main problem is that the push notification is very critical for me.
so I want to check if the push notification is delivered to the device with the app installed, I understand that if the iphone dosn't have internet connecction / 3G the push notification is not getting to the device.
how can I check if the device get the notification or not?
how can I check if the APNS successful to deliver the push notification?
I want to send sms if the push notification is not deliver to the device so I think about the idea to get the notification event when it's open by the push notification, and to send request to my server so i can know if the push notification is successful deliver or not. the main problem is that the user need to open the app every time he get the notification and in the night it's a problem. so this option is not good for me.
I check the feedback server push notification but i don't find any info that I can get if the push notification is delivered or not
any idea??
With iOS7 you have a new method called
application:didReceiveRemoteNotification:fetchCompletionHandler:
which you probably could use for your task. From Apple's Docs:
Implement this method if your app supports the remote-notification background mode.
...
When a push notification arrives, the system displays the notification to the user and
launches the app in the background (if needed) so that it can call this method. Use this
method to download any data related to the push notification. When your method is done,
call the block in the handler parameter.
Unlike the application:didReceiveRemoteNotification: method, which is called only when
your app is running, the system calls this method regardless of the state of your app.
The short answer, you can't, since APNS is one way. However, since an app can execute arbitrary code upon receipt of a notification, you can use this to say, send an http request to your own server when the notification is recieved.
There are any number of reason why push notifications might not get delivered to your user, or might not be delivered in a timely manner. Apple does not provide any mechanism for you to query the status of a push notification that you have sent.
If your app is currently running on the user's device and the user is accepting notifications for your app, you can implement the following method in your app delegate. It would be called whenever a push notification is received and in this method you could send a request back to your server to indicate the message was received. However this will only work while the user is running your app.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
In general though, it sounds like you'e relying on push notifications for something you shouldn't. From Apple's Local and Push Notification Programming Guide:
Important Because delivery is not guaranteed, you should not depend on
the remote-notifications facility for delivering critical data to an
application via the payload. And never include sensitive data in the
payload. You should use it only to notify the user that new data is
available.
There is no way to find out whether the notification was delivered to the device or no. APNS is a one way service. If there is no internet connection on the device then the APNS server will hold the last notification for some period of time which is no specified by Apple. If a new notification is sent to APNS for delivery then the old notification data is lost and replaced by the new data if its undelivered. If the notification is delivered then also the old notification data is deleted on the APNS server.
Please go through the following link : Apple Push Notification
Hope this helps you...........
If you are using JAVAPNS to send the APNS notification, you can use the below:
List<PushedNotification> notifications =
Push.combined("alert", badge, "default", "cert.p12", "certpassword", true, deviceToken);
for (PushedNotification notification : notifications) {
if (notification.isSuccessful()) {
//Push is successful. Do your thing...
}
else {
//Push is not successful. Do your thing...
}
}

Push notifications to the same iPhone

I was successfully configured push notification and it sends notifications to other users well. However when I want to send a remote push notification to the same phone Im using it doesnt get any. However I know we can use local notifications but due to my requirement it has to be a push notification. Is there any blocking scenario where it doesnt allow the push to come to the same phone?
Thank you

How to create push notification when the RSS feed gets updated in iPhone?

I need to display a push notification on new updates in the xml feed.
Had gone through http://mobiforge.com/developing/story/programming-apple-push-notification-services and tried that sample code successfully.
But what should I need to do ,to create push notification while new entries come in RSS feed?
You need to write a push notification provider server that sends the actual remote push notification as well.
I suggest you have a look at this link
http://blog.boxedice.com/2009/07/10/how-to-build-an-apple-push-notification-provider-server-tutorial/