Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening TestFlight app from another app and deep link to specific app

Tags:

How do i find the scheme of another app and deep link to it from my own iOS app?

More specifically, I want to deep link to the Testflight app upon certain conditions (set by my code). I'm assuming the person has Testflight installed, (which might be a bad assumption but we can live with that assumption).

I know that on Android, you can query for apps and send intents to deep link to someone else's app. What would be the equivalent on iOS?

like image 256
David T. Avatar asked Oct 31 '14 04:10

David T.


People also ask

Can you deep link to another app?

Mobile app deep linking is a technology that launches an app and opens a specific page once a user clicks a URL on a web page or in another app. Implementing deep links is a sure way to optimize user experience and increase your conversion rates.

How do I link an app to TestFlight?

Simply go to your app's TestFlight page, click an existing group, and click Enable Public Link. You can then copy the link and share it on social media, messaging platforms, email campaigns, and more.

How do I promote an app from TestFlight to the app store?

To distribute using TestFlight or through the App Store, choose App Store Connect. If you are a member of the Apple Developer Enterprise Program and are ready to release your app to users in your organization, choose Enterprise. To distribute a macOS app without code signing, choose Copy App.


2 Answers

There are two things you need to do. First, check to see if TestFlight is installed. Then create a new link to your app.

NSURL *customAppURL = [NSURL URLWithString:@"itms-beta://"]; if ([[UIApplication sharedApplication] canOpenURL:customAppURL]) {      // TestFlight is installed      // Special link that includes the app's Apple ID     customAppURL = [NSURL URLWithString:@"https://beta.itunes.apple.com/v1/app/978489855"];      [[UIApplication sharedApplication] openURL:customAppURL]; } 

This special https://beta.itunes.apple.com URL will be opened directly in TestFlight.

Finally, if you are using iOS 9 (or later), you need to make an addition to your Info.plist to get the canOpenURL: method to work.

If your app is linked on or after iOS 9.0, you must declare the URL schemes you want to pass to this method. Do this by using the LSApplicationQueriesSchemes array in your Xcode project’s Info.plist file. For each URL scheme you want your app to use with this method, add it as a string in this array.

<key>LSApplicationQueriesSchemes</key> <array>     <string>itms-beta</string> </array> 
like image 126
picciano Avatar answered Sep 22 '22 03:09

picciano


From looking at the plist the URL scheme for TestFlight is "itms-beta://" I can't manage to get it deep linking yet, I've tried passing it the Apple ID, with and without a ? along with prefixing it with appleid= I will try bundle ID next.

To open the TestFlight app on the users device you can use:

NSURL *customAppURL = [NSURL URLWithString:@"itms-beta://"]; if ([[UIApplication sharedApplication] canOpenURL:customAppURL]) {     [[UIApplication sharedApplication] openURL:customAppURL]; } 
like image 44
Gary Riches Avatar answered Sep 21 '22 03:09

Gary Riches