Solution : Add the Didfinishlaunchingwithoptions inside the AppDelegate.h:
-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchOptions{// Override point for customization after application launch. NSLog (@ "did Finish launching with Options"); if ([[[Nsuserdefaults Standarduserdefaults] boolforkey:@ "isfirstlaunched"]) {NSLog (@ "Appdelegate-didfinishlaunchin Gwithoptions:app was already launched. "); else{NSLog (@ "Appdelegate-didfinishlaunchingwithoptions:app's first launch."); [[Nsuserdefaults Standarduserdefaults] setbool:yes forkey:@ "isfirstlaunched"]; [[Nsuserdefaults standarduserdefaults] synchronize]; } if ([[[[[[] nsuserdefaults standarduserdefaults] stringforkey:@ "clientversion"] isequaltostring:client_version]) { NSLog (@ "Appdelegate-didfinishlaunchingwithoptions:app version remains the same."); else{NSLog (@ "Appdelegate-didfinishlaunchingwithoptions:app version did update."); [[Nsuserdefaults StandarduserdeFaults] setobject:client_version forkey:@ "ClientVersion"]; [[Nsuserdefaults standarduserdefaults] synchronize]; } return YES;
Define the client_version in APP-PREFIX.PCH:
#define Client_version [[[NSBundle Mainbundle] infodictionary] objectforkey:@ "cfbundleshortversionstring"]
Reference Link: http://stackoverflow.com/questions/9964371/how-to-detect-first-time-app-launch-on-an-iphone/9964400#9964400
Whether the IOS monitoring app is the first time to open & monitor whether the app has been updated