Sunday, January 31, 2016

PushKit Framework iOS

Instead of app keeping the persistent connections, apps can utilize the push kit framework. When push is received, the app is called to action. The action it can take could be display a notification to the user in the Notification center informing there is a call so that user can accept the call. The whole purpose of this framework is to avoid having the apps to maintain persistent socket connection with the backend servers. 

We tried to push this concept to TWC but received an almost NO response or it is moving very slow. The TWC ACME backend / SBC does not have the capability for it. The main problem from backend perspective is that, considering A call B (iOS App), A’s request needs to be queued at server, Server need send push to B, user acts on B’s popup and finally B reaches to the server to grab the pending call. But today what happens is that, when server receives call from A, it checks if B is actively having a socket and if it does not find, immediately sends back a 403 User not registered response to A. Servers needs to have a change for this to be fully utilized. If the server is willing to change, it will be a very good advantage to the user, the battery life will be more!. 

Overall, Below are advantages of PushKit 

1. The device is woken up only when VoIP push occur. saving energy. Apps no need to maintain persistent connection with server. 
2. Unlike normal push messages, the VoIP push directly goes into the app first. This means that app can do some background task such as if user has set Busy, then it won’t ring, instead send a busy signal back to the server. 
3. VoIP pushes are considered high priority ones and delivered without delay. 
4. VoIP push can contain more data than normal push messages.  
5. App is automatically launched when VoIP push is received. 
6. App is given runtime to process push even if app is running in background. 

This is supported in iOS 8.0 and later. 

Below are the process involved in this

1. Declare Background mode as VoIP => Like conventional VoIP applications, prior to PushKit, app should declare background mode as VoIP so that application can run in background. 
2. Create VoIP certificate for the app. Each app which wish to use PushKit, needs to have separate VoIP services certificate. This certificate allows an App’s backend Notification service to reach to Apple’s VoIP service.


REferences:

No comments:

Post a Comment