I am writing an iOS application which will be sent notifications over APNS from backend servers.
Can I configure multiple servers to connect to APNS and send notifications? If so, is there a limit on the number of servers which can send notifications for a single application?
I can't find any details about this on the Apple site (e.g. http://developer.apple.com/iphone/library/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html)
Yes, you can have multiple servers (Providers) connected to the APNS to send notifications to the same application, and no, there is no limit on how many. You just have to have the same APNS certificate on all of them.
Having multiple servers (providers) works well when sending notifications, the question is how to handle the Feedback service?
One server might query the feedback service, get a list of device tokens that have been removed but some tokens might be there from a push notification send from another server.
Related
Can I send multiple device tokens to APNS api in a single request?
I do not believe so. We use AWS SNS to handle that.
For IOS App, we have secure intranet and want to send push notification without APNS.
I have gone through may scenarios on here on site. I am not able to find any answer if using our network and server is it possible to send push notification without APNS.
For Android App I found that it is possible to bypass GCMS. what about to bypass APNS for IOS?
APNS can not work in closed networks ! You need internet to reach publicly hosted Apple Cloud Server. It's not possible to by-pass Apple servers for any Push Notification to be delivered to your app.
1) If I want to send simultaneously e.g. 10 thousand push notifications, do I have this capability?
2) Can push notifications interact with other apps? To explain this: If I want something to be done when a push notification is sent to another app, does Apple act as a middle man, or the other developer has to give me the tokens of his clients in order to send them the notifications directly?
Thanks in advance!
1) If you have 10,000 devices to send the push to then that should be possible. If you sent 10,000 to the same device the Apple servers would detect that and block it most probably.
2) Your question is not clear. A push is a message sent from a server to an app. The server that is sending the push needs to be signed with the push certificate of whatever app it is sending the push to, also the app needs to send its push token to the server before the server can send the push.
A server is not an iOS app so to say "when a push notification is sent to another app" does not make sense. If you are talking about a server sending a push to more than one app, then provided the server is signed with the relevant certificates and has the device tokens it can do whatever it wants.
I want to send push notification from a iOS device to another iOS device without using backend server. Is it possible for an iOS device to act like a server and send push notification to APNs server?.
Thanks in advance.
Theoretically you can send Apple Push Notifications from a device directly to another device. All you need are the push certificate of the app, the device token of the device you are sending the notification to, and code that establishes a secure TLS connection to the APNS servers.
However, there are several practical problems that make the use of a server almost mandatory :
You need a single place where all the device tokens of all the devices that installed your app will be sent to and persisted in. The best such place would be a server. Without a server, how would device A send its device token to other devices that want to send it push notifications?
Apple require that you keep connections with the APNS server open for as long as possible and use the same connection for sending many notifications. If you open a connection to APNS server on your device, it will probably be short lived (since devices switch networks frequently, and don't stay connected to the internet all the time). Therefore, if you try to send many notifications frequently, and each time use a new connection to APNS, you will probably be banned (since Apple would treat this as DDoS attack).
If you store the push certificate in each device that installs your app (to allow it to send push notifications to other devices directly), aside from the security issue of storing the certificate in many places, you'll have to publish a new version of your app each time the push certificate expires (once a year), and push notifications would stop working for users who don't upgrade to the new version.
Try NWPusher.
It has an iOS framework for sending pushes and has an iOS demo application that sends push notifications from iOS to iOS.
You also need to consider Server costs (other than maintenance and development time if you code your own server).
By sending the push directly from the app device:
- you obtain a much better scalability (since you don't have to centralize everything on your server)
- you don't have to pay for server cost or other service's cost
You can use for iOS:
- https://github.com/noodlewerk/NWPusher Pusher
And for Android:
- Send push notification GCM by java
After reading and searching, apple MDM client - MDM server interaction seems to be:
When Server wants do sth on devices, it sends a notify to APNS (with device token & AppID for APNS to know which devices and application need to receive notification).
APNS send notify to provided app on provided device
when receive notify from APNS, Apple-MDM-client will connect to server, get command and do the command task on devices.
My questions are:
The application that registered for APNS is my application (MY_APP, not Apple-MDM-client). That means the one which receive notification is my MY_APP. Then how Apple-MDM-client know about the notification in order to connect to MDM server?
The solution can be: MY_APP receive notification, then connect to server, get command and push received commands to Apple-MDM-client, tell Apple-MDM-client do the task. If this approach is correct, how MY_APP can communicate to Apple-MDM-client?
There must be API for that purpose but I can not find it via google...
Please take a look at my answer for your original question:
How does MDM in IOS really work?
MDM is clientless protocol. Your MY_APP is not involved in MDM protocol.
What happens is:
Your server send push notification using device token, topic and PushMagic.
This is a little bit unusual push notification, because you don't specify AppID
(Check "Structure of MDM Messages" section in the MDM documentation
This push message goes directly built-in MDM client
MDM client will go and talk to server (to get new commands)
As you can see your app isn't involved in MDM at all.
I would like to enforce Victors answer(because answers to Apple's MDM are so few on the internet)!
Again, in MDM protocol the is no application that has to subscribe to Apple's push notification service, the iOS is the client here. He will be dealing with handling the requests from APNS, but for this to happen the device must have a special kind of configuration profile installed, named an enrollment profile, which is like a normal configuration profile with two payloads in it: an MDM payload, and a Certificate payload, and thats it! After the user install is, the iOS client is ready to receive requests from APNS.