Search Unity

Check if other app is installed on device

Discussion in 'iOS and tvOS' started by fredstales, Oct 6, 2014.

  1. fredstales

    fredstales

    Joined:
    Jun 4, 2013
    Posts:
    36
    Hi,

    I was wondering if there is a way or an asset on the Asset Store that lets you check if another app is installed on the device.

    What I want to do is to add cross promotion between our own apps. But I only want it to run within the app if the user doesn't already have it installed on the device. Running it if they already have it feels stupid. Any suggestions on how to do this?

    Thanks
     
  2. RazorCut

    RazorCut

    Joined:
    May 7, 2009
    Posts:
    393
    You can check if the apps you are interested in knowing are installed have a scheme. You could write a native plugin that essentially runs this:

    Code (csharp):
    1. return [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString: @"theAppScheme"]]
    If that returns true, then the application with the provided scheme is installed on the device.
     
  3. fredstales

    fredstales

    Joined:
    Jun 4, 2013
    Posts:
    36
    Thanks for the reply. I'm not sure how to do this though. What is a scheme?
     
  4. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
  5. OJ3D

    OJ3D

    Joined:
    Feb 13, 2014
    Posts:
    33
    Hey all, I know it's been a while since the last post. Since then, ios9 has now added a new requirement on checking app installations.

    Anyway, I got an objective-c plugin along with a c# script example, and apple's new info.plist mods for yall to use -
    http://answers.unity3d.com/questions/1217507/get-objective-c-functionvalue-in-c-wrapper-for-uni.html

    I know there are round about ways within unity to do this, they're just to clunky for me and I don't think they're necessarily the correct approach vs. a native one.

    Anyway, enjoy.

    Cheers,
    OJ