-2

I want to check if an app is really running in iOS, this app isn't built by me, such as I want to check is there gmail app installed in an iPhone and running, How can I check this? I don't know how to do this by javascript or Objective-C, so can you give me an idea or opinion? Many thanks

rmaddy
  • 314,917
  • 42
  • 532
  • 579
spotcool
  • 19
  • 3

1 Answers1

0

The only thing you can do is check if the app is installed. You can't check if the app is running.

For example, if you want to check whether Facebook is installed, you would do the following:

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"fb://"]]) {
    // Facebook app is installed
}

Here is a long list of url for apps.

There is a library that lists of some apps on the phone. You can view and download it here: iHasApp.

Jessica
  • 9,379
  • 14
  • 65
  • 136
  • how can I know `[NSURL URLWithString:@"fb://"]` this? such as why not `[NSURL URLWithString:@"facebook://"]` ? thanks – spotcool May 13 '15 at 03:12
  • iHasApps does not list most apps. It has a small percentage of the available apps and it gets more out of date every day. – rmaddy May 13 '15 at 15:38