Add data-only push support & implement health check
Closed this issue · 3 comments
Server:
{
"aps" : {
"content-available" : 1
},
"event": "string event name",
"params": {}
}
On Client we need to add application:didRecieveRemoteNotifications:fetchCompletionHandler: to the Teak instance (method hook already exists. just impl it).
In that method it will look for data-only pushes, and dispatch events based on the event name/params in the dictionary received.
- Add handler to
TeakPushState
for the push registration check- Call
determineCurrentPushStateWithCompletionHandler
- In the completion handler, call server (no session)
- Call
- Add handler in Teak instance for install tracker
- Send ping to server (no session)
For iOS we may need to add 'Background Fetch' to make sure we can send the requests off to the server, for both these tasks as well as the Session Duration reporting.
HOWEVER
I do not expect that we need to add it, as we supposedly have 30 seconds to perform tasks and call completion handler.
Updates:
- For the "health check"
- Send back DeviceId + any parameters the server sends us
- Send back current push state chain
We do not need to enable background mode, however the Apple docs are incorrect; there can be no other items in the aps
dictionary besides the content-available
item.
Items outside the aps
dictionary are fine.