查询索引深层链接

时间:2015-10-12 20:54:46

标签: android deep-linking

是否有api来查询已在应用内编入索引的深层链接?有一个API可以索引深层链接,但我找不到任何用于查询这些索引深层链接的文档。

以下是深度链接的google开发示例:

import com.google.android.gms.appindexing.Action;
import com.google.android.gms.appindexing.AppIndex;
import com.google.android.gms.common.api.GoogleApiClient;
...
public class MainActivity extends Activity {

  static final Uri APP_URI = Uri.parse("android-app://com.example.android.recipes/http/recipe-app.com/recipes");
  static final Uri WEB_URL = Uri.parse("http://recipe-app.com/recipes/");
  private GoogleApiClient mClient;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    ...
    mClient = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build();
    ...
  }

  @Override
  public void onStart() {
    super.onStart();
    ...

    // Connect your client
    mClient.connect();

    // Define a title for your current page, shown in autocompletion UI
    String title = "App Indexing API Title";

    // Construct the Action performed by the user
    Action viewAction = Action.newAction(Action.TYPE_VIEW, title, WEB_URL, APP_URI);

    // Call the App Indexing API start method after the view has completely rendered
    AppIndex.AppIndexApi.start(mClient, viewAction);
    ...
  }

  @Override
  public void onStop() {
    ...
    // Call end() and disconnect the client
    String title = "App Indexing API Title";
    Action viewAction = Action.newAction(Action.TYPE_VIEW, title, WEB_URL, APP_URI);
    AppIndex.AppIndexApi.end(mClient, viewAction);
    mClient.disconnect();
    ...

    super.onStop();
  }
}

我没有看到任何关于如何从googleApiClient中提取这些深层链接的文档。

0 个答案:

没有答案