But on implementing that, it seems like a time taking process, while WhatsApp does it very quickly and more curious how that app works.
There’s two ways you can approach this:
I can’t offer you detailed guidance with regards A. In general you can look at an app’s on-the-wire behaviour using one of the tools listed in QA1176 Getting a Packet Trace.
Personally I’d recommend you start with B. The fact you said “it seems like a time taking process” indicates that you haven’t actually tested this, and measuring the problem is always the first place to start with issues like this. For example, if your measurements shows that 90% of the delay is with the push notification making it to your app, there’s not a lot you can do about that.
Finally, on the measurement front, if you use
NSURLSession
for your networking, it has great support for breaking down the time taken by each request. Check out
NSURLSessionTaskMetrics
, discussed in detail in WWDC 2016 Session 711
NSURLSession: New Features and Best Practices.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"