docs: public NavigationResult navigate(Context context) {
      PackageManager pm = context.getPackageManager();
      Bundle finalAppLinkData = buildAppLinkDataForNavigation(context);
  
      Intent eligibleTargetIntent = null;
      for (AppLink.Target target : getAppLink().getTargets()) {
        Intent targetIntent = new Intent(Intent.ACTION_VIEW);
        if (target.getUrl() != null) {
          targetIntent.setData(target.getUrl());
        } else {
          targetIntent.setData(appLink.getSourceUrl());
        }
        targetIntent.setPackage(target.getPackageName());
        if (target.getClassName() != null) {
          targetIntent.setClassName(target.getPackageName(), target.getClassName());
        }
        targetIntent.putExtra(AppLinks.KEY_NAME_APPLINK_DATA, finalAppLinkData);
  
        ResolveInfo resolved = pm.resolveActivity(targetIntent, PackageManager.MATCH_DEFAULT_ONLY);
        if (resolved != null) {
          eligibleTargetIntent = targetIntent;
          break;
        }
      }
  
      Intent outIntent = null;
      NavigationResult result = NavigationResult.FAILED;
      if (eligibleTargetIntent != null) {
        outIntent = eligibleTargetIntent;
        result = NavigationResult.APP;
      } else {
        // Fall back to the web if it's available
        Uri webUrl = getAppLink().getWebUrl();
        if (webUrl != null) {
          JSONObject appLinkDataJson;
          try {
            appLinkDataJson = getJSONForBundle(finalAppLinkData);
          } catch (JSONException e) {
            sendAppLinkNavigateEventBroadcast(context, eligibleTargetIntent, NavigationResult.FAILED, e);
            throw new RuntimeException(e);
          }
          webUrl = webUrl.buildUpon()
              .appendQueryParameter(AppLinks.KEY_NAME_APPLINK_DATA, appLinkDataJson.toString())
              .build();
          outIntent = new Intent(Intent.ACTION_VIEW, webUrl);
          result = NavigationResult.WEB;
        }
      }
  
      sendAppLinkNavigateEventBroadcast(context, outIntent, result, null);
      if (outIntent != null) {
        context.startActivity(outIntent);
      }
      return result;
    }