Ravi Kiran Ravi Kiran - 1 year ago 97
iOS Question

how to get app launch event in my custom framework

I am constructing a framework in objective c and I have to get notified when the application launches, Can I add observer to get track of app launch with in the framework? , I dont want application didBecome active notification since it will be called even after returning from background,

I want the fresh launch notification, please help me how do I acheive this

Answer Source

This will perform the block whenever your app is first launches.

[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidFinishLaunchingNotification
                                              usingBlock:^(NSNotification * _Nonnull note) {
                                                      // your code here
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download