1

I want to check if my app was opened from the TestFlight app or the AppStore app.

I made a test and found this information in didFinishLaunchingWithOptions when launching it from TestFlight:

if launchOptions?[UIApplicationLaunchOptionsKey.sourceApplication] as? String == "com.apple.TestFlight" {
    // ...
}

But I don't know how to check if the app is opened from the AppStore. What's the identifier?

Thanks for your help.

Rob
  • 4,123
  • 3
  • 33
  • 53
  • 1
    https://stackoverflow.com/questions/9910366/what-is-the-bundle-identifier-of-apples-default-applications-in-ios So maybe `com.apple.AppStore`? – Larme Apr 27 '18 at 15:45
  • is there a reason you couldn't just use else { // App Store } – Zachary Bell Apr 27 '18 at 15:47
  • @Larme That's what I thought but I wasn't sure and couldn't find any information about it... Thank you! – Rob Apr 27 '18 at 15:47
  • @ZacharyBell Yeah that's because my app may actually be opened by different means (App Store, Test Flight, classic tap, deeplinking...) so I want to check each of them. – Rob Apr 27 '18 at 15:49

1 Answers1

2

The Bundle Identifier for the App Store iOS app is com.apple.AppStore

Andy Obusek
  • 12,614
  • 4
  • 41
  • 62