Deep linking allows you to create seamless integration when a the Gett app is installed on a user's phone.

For deep linking to work seamlessly the Gett app needs to be present on the user's phone. In case the app is not installed activating a deep link will take the user to the Gett page on the App Store.

Deep links are supported on both Android and iOS clients.

CHECKING IF THE GETT APP IS INSTALLED ON IOS

UIApplication *myApp = UIApplication.sharedApplication;
NSURL *gettAppURL = [NSURL URLWithString:@"gett://"];
if ([myApp canOpenURL:gettAppURL]) {
    // Gett is installed; launch it
    [myApp openURL:gettAppURL];
} else {
    // Gett not installed; open App Store
    NSURL *gettAppStoreURL = [NSURL URLWithString:@"https://itunes.apple.com/us/app/gett-nyc-black-car/id449655162?mt=8"];
    [myApp openURL:gettAppStoreURL];
}
// If Gett is not installed, send the user to the Apple App Store
let myApp = UIApplication.sharedApplication()
let gettAppURL = NSURL(string: "gett://")!
if myApp.canOpenURL(gettAppURL) {
  // Gett is installed; launch it
  myApp.openURL(gettAppURL)
} else {
  // Gett not installed; open App Store
  let gettAppStoreURL = NSURL(string: "https://itunes.apple.com/us/app/gett-nyc-black-car/id449655162?mt=8")!
  myApp.openURL(gettAppStoreURL)
}

Note that if your app is built using the iOS 9 SDK, you must add an entry to your Info.plist with the key LSApplicationQueriesSchemes with an Array type that contains the String item Gett.

CHECKING IF THE GETT APP IS INSTALLED ON ANDROID

public class Example extends Activity {

    private static final String TAG = "gett:Example";
    private static final String GETT_PACKAGE = "com.gettaxi.android";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.example);

        findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                deepLinkIntoGett();
            }
        });
    }

    private void deepLinkIntoGett() {
        if (isPackageInstalled(this, GETT_PACKAGE)) {
            //This intent will help you to launch if the package is already installed
            openLink(this, "gett://");

            Log.d(TAG, "Gett is already installed on your phone, deeplinking.");
        } else {
            openLink(this, "https://play.google.com/store/apps/details?id=" + GETT_PACKAGE);

            Log.d(TAG, "Gett is not currently installed on your phone, opening Play Store.");
        }
    }

    static void openLink(Activity activity, String link) {
        Intent playStoreIntent = new Intent(Intent.ACTION_VIEW);
        playStoreIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        playStoreIntent.setData(Uri.parse(link));
        activity.startActivity(playStoreIntent);
    }

    static boolean isPackageInstalled(Context context, String packageId) {
        PackageManager pm = context.getPackageManager();
        try {
            pm.getPackageInfo(packageId, PackageManager.GET_ACTIVITIES);
            return true;
        } catch (PackageManager.NameNotFoundException e) {
            // ignored.
        }
        return false;
    }
}

SUPPORTED DEEPLINKS

The following link will open the app and place the user on the map screen.

gett://order?pickup=my_location&dropoff_latitude=32.117831&dropoff_longitude=34.798379&product_id=0c1202f8-6c43-4330-9d8a-3b4fa66505fd