Push notification message customization? - ios

I am working on chat application. Whenever someone send me a message I receive a push notification with text "A send a message to you".But sometimes I receive push with text "You have 4 new messages".(4 is the variable number). Server team claims that they are not sending this type of message.Just wanted to know if apple customize the message in any case.

No, Apple doesn't do that.
It has to be your server developers or some third party library they are using to send Push Notifications.

Related

Does Apple Push APN provide a statistics API?

I didn't find this answer anywhere so decided to ask.
Does the Apple Push Notifications have a stats API or dashboard where we can see count for sent, received and opened?
Thanks.
Apple does not provide that kind of dashboard. When you are calling the APNS server to send a push notification you receive a response from the APNS server, that you can use to extract some statistics(mostly if the notification was send). If you need to know that the notification was opened you can manually track if the application was launched due to the user tapping the PN or an action of the PN.

Push notification capabilities

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.

Pubnub iOS push notification filtering?

According to this post, the best practice is filtering channel messages on client side. I haven't found a feasible way to do that when push notification is integrated yet. Right now our iOS client gets notified for a lot of useless messages when app is not running.
Filtering PubNub Messages and Push Notifications
This is a shortcoming with APNS, not PubNub. PubNub works in such a way that all subscribers of a channel receive all messages published on that channel. But when an app is in the background on iOS or not running at all, your app does not have the opportunity to process the push notification before it is displayed by the iOS device. Android/GCM does allow your app to intercept the message before it is displayed.
Fortunately, there is only one scenario (that I can think of) where the sender of a msg would receive their push notification version of the message (meaning, you couldn’t intercept and not display it).
user publishes msg
then immediately (quickly) leaves the app (home button, switch to another app, etc)
push msg appears
But if the user stays in the app for a second or two (or long enough to receive the realtime msg AND the push notification), then you can prevent the push msg from being displayed. But there is no need to filter on UUID because you should be suppressing all push notifications from being displayed when the app is active in the didReceiveRemoteNotification delegate, because you already have the realtime message on the subscribe callback.
That link you referenced (Filter Owner Messages on PubNub Data Streams) is only for realtime push notifications and Stephen is calling out a feature that we will be rolling out in the near future which allows you to subscribe to a channel but provide a query that allows you to filter/query condition for the messages on the channel, like, “where uuid != ”, where is the uuid of the subscriber. Then the subscriber would not receive realtime or push notification messages because the server filters them out for you.
For a good overview of push notifications see Sending APNS and GCM Messages to Subscribers and Mobile Push Notification Services in One API Call
For complete push notification setup, configuration and implementation, see the docs for each of our SDKs.
Also, see my answer that describes how to use iOS silent push notifications to do on device filtering. Same thing can be done on Android but no need to do anything special because you always get the opportunity to process the push notification before it is displayed.

How WhatsApp implements delivery receipts for messages pushed through Push Notifications in iOS?

An user X(Has Whatsapp in Android) tries to send a message to user Y(Has Whatsapp) in iOS when the user Y is offline. The user Y receives a push notification that he has a message from user X. As soon as the push notification is received, user X is able to see the double tick mark in his WhatsApp client. How WhatsApp is able to figure out that the push notification has been successfully delivered to the iOS client ?
It's not really possible to know what's going on without seeing at least a protocol dump of WhatsApp as this occurs, so on with the rampant speculation:
I'd guess that WhatsApp is using Message Delivery Receipts, which rely on the client responding to the message, rather than the server. Since push notifications talk to an intermediate service (e.g., APNS), which itself wouldn't send said receipt acknowledgements, the client running on the device, upon receiving the push notification, wakes up, analyzes the message, and sends the delivery acknowledgement to the initiator of the dialog.
At least, that's how I'd do it, if I were trying to leverage existing standards, which isn't necessarily what WhatsApp is doing.
Whatsapp uses XMPP, which is TCP based. Thus, if the Server is able to get a connection to Y this should ensure that the message has been delivered.
So if the whatsapp server is able to send the message to Y, the message is pushed out of the server. If Y has enabled the extension to send message states, Y automatically sends a repsone to X with the extension "delivered".
I can't really know, but i would say Whatsapp keeps a service in background that detects it. If i am correct, when you close totally the app (from multitask), and receive a message, the other person won't see a received double tick if you don't open the app.

Is it possible to implement an IMAP push client in iOS?

Would it be possible for me to implement a client that is capable of receiving IMAP push messages, without the awareness of the user (i.e. they are not displayed in an inbox etc.)
Yes. You can create a job (corn) to check for emails every few often and send a push message (apns) to the user (using your app) with the email message attached as body.

Resources