App Foreground callback coming late in IOS swift

76 views Asked by At

I am developing an SDK in swift for IOS apps. The sdk basically posts events data to server. I need to know whether app is in background or foreground. I used the notification center observer to get callbacks in the applicationDidBecomeActice and applicationWillEnterForeground callbacks. But I found the callbacks to be coming late i.e the callback is coming as late as when viewDidLoad of splash screen is getting called. I have also worked with ProcessLifecycleOwner in Android where the callback is triggered instantly.

Can someone please tell me if this is the ideal behavior in ios. If yes, what else can be done to know when the app comes to foreground instantly

P.S - This is my first question on S O., apologies for long question.

0

There are 0 answers