Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Anyone using Application.installMode on iOS?

Discussion in 'iOS and tvOS' started by andymads, May 9, 2017.

  1. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    I want to know if it works correctly on iOS App Store apps. Does it return ApplicationInstallMode.Store? I know the docs say yes but I want be sure.
     
  2. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    I'm going to answer my own question because I've just found out it doesn't work correctly on iOS. Or perhaps I misunderstood it?

    I have some code to present a popup for submitting crash reports but didn't want it exposed to players in App Store builds. We've just seen the popup in an App Store build which means that it does not work how I thought it would, or it's bugged?

    The docs do say that it means "Application installed via online store", and my app was installed in that way (from App Store).

    Code (CSharp):
    1. if(Application.installMode!=ApplicationInstallMode.Store)
    2. {
    3.     // Show popup
    4. }
    5.  
    Bug reported #913886 (23 May 17)
     
    Last edited: May 23, 2017
  3. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    A bit more information.

    I've started tracking Application.installMode and Application.installerName in my analytics. It turns out that the only value for Application.installMode that I'm is seeing is ApplicationInstallMode.Unknown yet for Application.installerName I'm seeing "Apple Store".
     
  4. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Even more information.

    Application.installMode works as expected on Android. I'm seeing values of ApplicationInstallMode.Store and ApplicationInstallMode.DeveloperBuild via analytics.
     
  5. JeanLuc

    JeanLuc

    Joined:
    Aug 6, 2012
    Posts:
    8
    @andymads
    • Did you end up using Application.installMode on iOS and Android?
    • Did you try it with a newer Unity Version?
    • Do you know if we can distinguish between installations through Apple Testflight Build and from regular App Store?
    • And the same question for Google Play Alpha / Beta tracks vs. regular installation in the production release track.
    My current test results on iOS are:
    • For Developer Build it returned ApplicationInstallMode.DeveloperBuild.
    • For Adhoc Build, it returned ApplicationInstallMode.Adhoc.
    • I haven't tested it in Testflight or App Store yet.
    My current test results on Android are:
    • For Unity's ADB installation and APK installation over file system, it returned ApplicationInstallMode.DeveloperBuild.
    • I haven't tested it over Google Play yet.
     
    Last edited: Sep 18, 2019
  6. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Not looked at it in ages. Didn't trust it as didn't seem reliable. Perhaps it's better now.
     
  7. squarelover

    squarelover

    Joined:
    Nov 14, 2012
    Posts:
    31
    semms not
     
  8. bourriquet

    bourriquet

    Joined:
    Jul 17, 2012
    Posts:
    181
    When I create an apk and install it myself on my device, it says installMode = Store. Basically it always says Store.
    I'm on 2019.4.18.
     
  9. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Yeah, we noticed this. Seems ok on iOS now though.
     
  10. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Have just found out that on iOS for TestFlight it returns Store - which is annoying!

    Also, we've seen some Android devices not returning Store for apps downloaded from the Google store.