I have successfully implemented the Reply through notification for the query I asked [Swipe Buttons not coming for Remote notifications
My problem is that I do get a callback and I can do the necessary handling of the actions like fetching the text from text field and doing the necessary to send chat message without opening app from background 'when running' using this method:
- (void) application:(UIApplication *)application
handleActionWithIdentifier:(nullable NSString *)identifier
forRemoteNotification:(NSDictionary *)userInfo
withResponseInfo:(NSDictionary *)responseInfo
completionHandler:(void(^)())completionHandler
My issue is when the App is not in memory and not running in the background when home button pressed like scenario the Same Reply through notification is not sending chat.
I suspect that its not able to Connect XMPP --> Connect My DB -- > Send Data over XMPP when app totally not in background.
How to handle this. I want similar to whatsapp like when the app is even not switched on but on notification reply we can send a whatsapp message to other user and he gets it, similar Skype as well.
Am I missing in my understanding or have to do anything else.
For iPhone, the app needs to do one of two things:
VOIP will allow the app to continue to receive messages in the background, even when it is "asleep". However, Apple needs to approve your app as qualifying for this permission.
EDIT:
XMPP requires an open TCP connection. If the connection closes, the server has no idea how to route the message. This means keeping the TCP connection open even when the app is in the background.
This type of arrangement is what Apple classifies as a "VOIP Feature" which requires the special permission. With VOIP an incoming call can only activate on a phone with an active TCP connection. Thus, XMPP is essentially the same as VOIP.