Best way to show the recent post - Objective C - ios

I have an iOS app which is installed in two different device but logged in with same account. If I do a new post from a device it should be shown instantly in the other devices. Currently I am refreshing the posts feed for every 10 seconds interval. Is this is a optimal way or is there any other better solution for this.

As #wattson12 was saying push notification are designed for that.
I would recommend using an API for that : Urban Air Ship

What you do is called polling. It’s the simplest solution, but it’s not optimal, because it requires you to query the server constantly and still there’s delay before you know about the new posts.
One way to know about new posts is to keep an HTTP connection open, waiting for the server to notify you about new posts (see Wikipedia for details, also related question here). Other option is push notifications: the server can post a notification when new content arrives. I’m not sure which one is technically more simple.

Related

user to user push notifications

I have seen many questions on here and online that address this topic, but they all are from a long time ago, and are possibly outdated. I wanted to get a more recent answer if Firebase has implemented anything recently that is capable of a user to user push notification system, essentially what is used in all chat applications, or if the best option is still currently using Onesignal.
Yes! These days, you can use Cloud Functions for Firebase to do things like send a notification when something interesting happens on the Database side of things.
Here's an example where a user gets notified via notifications when they gain a new follower. Obviously, your part of the database portion will probably change depending on what exactly you want to trigger a notification, but the general theory is the same.

How can I send Parse push notifications to users after specific user action?

I have read a lot of tutorials and doc but I cannot quite wrap my head around it: I am trying to send users of my app a notification when somebody posts something new or if someone likes one of their posts (think Facebook-style table view displaying notifications as they happen). The certificates are set up and the app is able to receive remote notifications that I send through the Parse push console.
Obviously I want to send a notification as the actions happen, but I am unsure how to do that. Parse suggests using cloud code, but it seems to be in Javascript. Is there a way to do it in Swift? My first idea was to send the push from the users' devices as they interact (when the user likes a pic from you, he sends the push and you receive it) but apparently, it is discouraged as it is unsafe.
I understand my question is general, but I am lost as to how I can tackle this issue: can anybody give me an outline of how this should be dealt with? Not necessarily precise code, but a general idea of what I should do?

iBeacon notification database

I have a question which I have not been able to figure out so I decided to see if I can get some help on here.
I am working on an iBeacons project and I have been able to understand the basic function of iBeacons, setting up UUID'S and major and minor id's to specify exact notifications, but my question is how do I dynamically update information I send out to the users without having to go into the code each time to do this. Do I need to create a database to store all my information I want to push out to users? if so how will this database constantly refresh messages pushed out to users? An example would be lets say if you walk into a store and you get a notification in the shoe section saying there is a 10 percent off, you look at the notification but not too impressed and start to walk out, then you get another notification saying for today only you can get a 25 percent off... The app has to dynamically refresh for this to be possible.
Please help me clarify this
Thank you very much for the help
What you probably want is to store this deal information in a web service so you can update it without changing the app. Your app would need to download the updated deal information from the web service either when it starts up or when it sees an iBeacon.
My company, Radius Networks, offers a tool called Proximity Kit that makes this easy. You can assign arbitrary key/value pairs to iBeacons using a web interface. Then your app downloads them automatically an has access to them whenever you see iBeacons.
In your scenario, they key/values could be something like:
primary_offer_text=10% off all shoes
secondary_offer_text=20% off all shoes

push only new data from server to iPad

I am trying to create an application in which server will push updated/new data to the iPad whenever there's any change in the database(just like how the mail application works). I think APNS wont work in this scenario but i could be wrong. Can anyone suggest any good approach to get this functionality?
You might find this wikipedia article about Push Technology interesting, specifically the section where it deals with "long polling". And you can have a sample implementation of long polling for ios here (also by having a look at this other post).
On the other hand, you might well try and use APNS so that the server notifies the app when new data is available, then the app (possibly after some user interaction) can get the new data.

In Newsstand app how do I find a list of devices that are subscribed?

I can't afford UrbanAirship so I'm trying to program the server side of a Newsstand app myself.
I plan on using the JavaPNS API.
The one thing I can't seem to figure out is how to find a list of users who have a subscription in my app.
Can I query this information from Apple some how?
If I can't then I guess that means that each time a user subscribes they send their device token directly to my server. I hope this is not the case because I was hopping to run the server on my laptop and send out pushes myself without having to keep the laptop running all day listening for new subscribers.
Thanks!
Looks like I do need to register each device with my server: http://www.ibm.com/developerworks/web/library/mo-ios-push/index.html#resources
You kind of found your answer but just in case you really need a server for not only handling the push notification (for telling your app in Newsstand to check the new issue and download it in the background) but also for subscription and in-app purchasing.
Every time you launch the app you should check few things before you refresh the UI. You should check if the user is a subscriber or has user already bought the issue so you can show view/download button instead of Buy button.
Check out these tutorials if they help to understand these communications better but believe me you will end up with one of those services like Urban Airship (Which I think UA is the best option because it handles all in one not just push notification):
http://ios-blog.co.uk/tutorials/how-to-make-a-magazine-app-in-ios-part-i/
this one is more focus on server part:
http://ios-blog.co.uk/tutorials/how-to-make-a-magazine-app-in-ios-part-ii/
http://www.viggiosoft.com/blog/blog/2011/10/17/ios-newsstand-tutorial
http://www.raywenderlich.com/2797/introduction-to-in-app-purchases
And as always this is the best place for start (it has everything you need):
https://developer.apple.com/devcenter/ios/newsstand/
These are some resources to help you in developing app for Newsstand but still there are not enough people out there to share their experience.
Best of luck.
Edit: Add these two links two this list:
http://www.marco.org/2012/10/11/the-magazine
http://www.marco.org/2012/12/12/the-magazine-future-of-publishing

Resources