Ryan Romanchuk
Ryan Romanchuk

Reputation: 10869

How to determine in applicationDidBecomeActive if triggered from a notification or springboard?

I have seen similar questions with answers stating to check the launchOptions, but i'm asking how to detect a user that has already launched the app previously. In other words, how do i detect an icon tap vs push inside func applicationDidBecomeActive(application: UIApplication)

Upvotes: 0

Views: 823

Answers (1)

Lou Franco
Lou Franco

Reputation: 89152

There are a bunch of calls in the app delegate for notifications. If they don't get called, you were started some other way (not necessarily Springboard -- could be app-switcher, a deep-link URL -- perhaps other ways in the future).

Those should be called before applicationDidBecomeActive, but if not, you will have to delay until you find out if they are going to be called.

Upvotes: 1

Related Questions