If I use Apple Push Notification service for instant messaging will apple block my account?
Asked Answered
V

4

8

I want to create an iOS chatting app using APNS. If I have 10,000 active and they are continuing chatting, will apple block my developer account ? Is there any limitation regarding this?

Veronique answered 8/5, 2013 at 15:43 Comment(0)
A
14

I would discourage you from using APNS as a backbone of an "chatting app".

If you need fast chatting functionality you should write your own TCP-socket based server.

If every-few-second syncing is o.k. you can get away with a HTTP-based server backend (but all the pull-syncing can be hard on network traffic - so TCP-socket is still better choice).

You could however use APNS for fallback - when your app on certain device is not responding (i.e. is not connected to server) you can send an initial message trough APNS (to wake up your app & to notify the user there is a message waiting for him).

As soon as the user opens your app you should switch back to your TCP-socket or HTTP request based server communication.

As for your question: no, Apple would most probably (one can never know for sure) not reject your app just because of using APNS for chatting. But note (as the others said allready): messages between two users will get "lost" if they would interact too frequently - see the link Roman Barzyczak gave you.

Adalard answered 8/5, 2013 at 17:38 Comment(1)
I tend to disagree, while it is true that delivery isn't guaranteed, there are some successful apps that use push notification for that very purpose. see here blog.parse.com/2013/02/01/…Rabelais
G
13

"If you are sending multiple notifications to the same device or computer within a short period of time, the push service will send only the last one."

more information: http://developer.apple.com/library/ios/#technotes/tn2265/_index.html

but Apple wont block your developer account :)

Ginzburg answered 8/5, 2013 at 15:46 Comment(5)
I have tested my app. When chatting I am not missing any text actually. My confusion is, if thousands of people will chat simultaneously then what will happen! thanks to you and also apple that they will not block my account.. :-)Veronique
APNS isnt good idea for instant messaging. Very good alternative is f.e. websocket :)Ginzburg
So, I need to implement socket programming and I need to create my own push server, right ?Veronique
You need your own socket server for IM when applications is running, but when application is off and you need notification user about new message you need use APNS.Ginzburg
I agree with Roman 100%. Own socket server + APNS for fallback (to initiate 'conversation'. It is not a problem of loosing messages with 1000 users - you WILL loose messages if there are just a few messages sent to he same device in short period oftime. Even if you are not loosing messages in in production-testing mode it doesn't mean you won't be loosing them in distribution mode.Adalard
S
6

You can use them for messaging but you are going to quickly find out that there is no guarantee they will arrive. This is known as the black hole of push notifications. ;-)

Subterranean answered 8/5, 2013 at 15:46 Comment(2)
Push notification should generally be used a bonus feature rather than a full proof method of delivery. Your best option would be to use local notifications. Although backgrounded apps have limits to the amount of time they can be open with the exception of apps playing music, navigation, constant peripheral support (bluetooth) or voip apps. developer.apple.com/library/ios/#documentation/iPhone/…Subterranean
Local notifications for a chat app? How is that going to work? He should use Push to notify users that a new message has arrived, but that should be it. The messaging service itself should live on a dedicated server.Howse
N
1

I like this answer here.

First try to use an APNS only solution. Make your push notifications stateless (they only serve as "Hey you have some new stuff in the server").
So when the client gets a push notification it asks the server for new data (messages or other stuff).

Use OneSignal to simplify the code that sends push notifications (from the back-end). If a user in your app gets a message after 10 seconds he dose not care if you used TCP,socket.io or xmpp...

Even Whatsapp's messages can take couple of seconds to arrive.

A chat app is not a realtime game. A delay of couple of seconds will be acceptable by end users.

Nonconformity answered 23/3, 2016 at 0:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.