iPhone - Triggering APNS - iphone

I am working on a iPhone application which uses APNS. I am clear about the procedures in implementing APNS, creating device token, blah blah blah... I have no idea how to trigger and initiate the APNS from the provider side by web service. Can anyone suggest me some blogs or links which guide me to gain knowledge how to deal with it. Thanks in advance.

If you don't want to spend time doing it on your own, you can try Urban Airship. If you want to do everything on your own instead, check out this tutorial. It also explains how to create the required certificates.
Otherwise you can try libraries such as apns-php. Just make sure it works with lots of messages (I haven't tested it) and meets your requirements (you may want support for multiple apps). Avoid EasyAPNS because it just doesn't work with more than 10 messages (it tries to open a connection for each message and will probably get your IP banned).

If you just want to get a better understanding of APNS and don't want to get aboard one of the 3rd party services, then try:
NWPusher
It allows you to send pushes right from your Mac. Great for testing your client application and for setting up the right certificates.

You might want to take a look at Urban Airship, they will make things a lot easier for you.

If you want to roll out your own server, here are some good starting points in terms of documentation/help
apns-php
easy apns
Another tutorial

Related

Android VoIP application: PARTIAL_WAKE_LOCK vs ignoring Battery Optimizations (doze whitelisting)

I'm working on a Voice over IP (VoIP) application using the SIP protocol which requires the application to be listening to incoming calls. This means the application must not sleep or die.
For old code, it seems the way to do this is to acquire a PARTIAL_WAKE_LOCK.
Now from Android 6.0 and higher, there's the new Doze. It is recommended that, if you don't want your app to go to standby, you should "whitelist" it by requesting the REQUEST_IGNORE_BATTERY_OPTIMIZATIONS permission. This is specifically for VoIP applications according to the documentation.
These two different things seem to be related. I'm not sure how they are related, if they interfere with each other, if I should use one or the other or both, and if there are other considerations. Please explain.
Also, I am not allowed to use Push Notifications on this project. If you have other advice for saving the battery please let me know.
In your case looks like you should be asking for whitelist, as the documentation you linked, it advises that GCM can collide with the SIP protocol. I would handle this case like a typical runtime permission. On some place of your app(the on create of your main screen for ex) ask for whitelist and the reason why you need it, if they dont want just disable functionality related to receive calls.
You should only use one of them at a time, you can always do it the hard way and handle the voip calls without sip, then you could handle incoming calls with push notifications from your server, but i dont think someone is up to that unless you need a top tier product.
There is no workaround for this, indeed the only good way is to do the heavy lifting by yourself, because its kinda popular on users to use battery optimizators / improved doze apps so you could get killed anyway.

Fetch from background

I am writing an iPhone app, and I have a remote server that will deliver content. I would like to have my app poll the server once per day to see if there is new content, even if it's not running or in the background. I would also like to do this without setting up an APNS. Any advice?
You can't do that, either when your 'not' running or if you are running in the background. The best you could do is to download once per day when your app is first run / pushed to the foreground.
You could use remote notifications to "prompt" the user to bring the app to the foreground so that it could download something?
With the current apple IOS guidelines, that is about the best you can do.
I read that you are trying to avoid using APNS, but I am wondering if you are trying to avoid it for the right reasons, especially when it is designed to efficiently solve the scenario you are describing. I've seen many developers seek alternative solutions to APNS simply because the technology appeared to be complex to use after looking at Apple's documentation. The online documentation does go into a lot of details, right down to the binary protocol level.
But just to be sure you know, there are open-source libraries whose only purpose is to shield you from all these technical details. Some libraries are more complex than others, but some are remarkably user-friendly. If you have not done so already, you might like to take a look at JavaPNS and other similar projects.

How to create a server for APNs for iphone

I'm creating an iPhone app that produce Pushnotifications. When I went through the documents and tutorials, I can see that we need a server support to provide the push notification. So, what are the requirements or what all are the important things that I should keep in mind when I create the server.
Thanks
If you are implementing it on your own, take a look at how to make my server support APNs? You can use php-apns if you want readymade server.

Direct communication between iPhone users

I'm new to iPhone programming. So far I've only written a couple of simple apps just to get the hang of it. In a short time I will have an assignment to write an app that will let iPhone users communicate directly using short messages, and probably they will add a requirement to be able to send files to each other attached to the messages. Of course this sounds a lot like a mail client. For several reasons the client does not want to use mail, if possible, and attaching files would leave SMS messaging out. I've been reading Apple's documentation on local, push and broadcast notifications. Would any of these be the way to go?
Thanks
User bonjour if you are one the same network: http://www.mobileorchard.com/tutorial-networking-and-bonjour-on-iphone/. Otherwise it sounds like you want to use Push. I'd recommend checking out Urban Airship

How to make a chat system on iPhone?

I'm doing research for making a chat based app for the iPhone (it's not really text chat in the regular sense, but the principles are the same).
Maximum 6 people can be logged into the same chat room at any one time, and the most basic question is how to efficiently check for new messages?
Would I need to simply poll the server periodically? Or is there a way I could trigger an event on the phone from the server whenever there is some new content to pay attention to?
If having to poll all the time, I worry about the resulting lag as each participant will have to wait longer for others before they can post their own responses to others. And, potentially it might also be too much to handle for the server to respond to lots of requests all the time. It would also waste bandwidth, which is not free for the user...
Unfortunately I will not be able to set up a socket server for this app, it has to be based around a regular LAMP configuration.
I think you can either go with push notifications, or XMPP (Jabber) server.
XMPP will allow your iphone app to receive data even when in the background using the new multitasking features (listening for a socket), and i'm pretty sure you should find ready to use servers for LAMP (or at least open source implementations).
Note that the iOS4 multitasking API doesn't support polling in the background, so your only other option should be push notifications. If you're new to push notifications, you can maybe use a service like Urban Airship that might make the process easier.
XMPP sounds good for you idea, i think this is the best technology for Chat. It alos works great in iOS apps.
Maybe this code sample will be helpful to start using XMPP in iOS app - look at this QuickBlox Chat code sample. It demonstrates how to integrate 1-1 Chat, Chat in room into your android application. Also there is guide how it works. I think there will be no problem to integrate it into your application. Otherwise - Comments system below allows to ask any question you want and get fast answer.
Also there is Demo video http://www.youtube.com/watch?feature=player_embedded&v=SncQaJBBW_0 how this Chat works.
In my opinion the best solution is socket, but you say that you can't implement the server side for this.
You could also implement it with push notifications. You can receive the push also when your app is running and send all the data you need inside the push. Usually chat messages are short...
If you don't want to mess with push notifications on the server then the only thing left, as long as I know, is the polling.