我有一个网站,使用户可以进行搜索查询.查询可能需要一些时间才能完成(几分钟到几天),我希望用户能够通过发送带有用户链接的电子邮件来下载Android应用并在那里收到答案.
无论用户是否安装了应用程序,我都希望这种机制能够运行; 换一种说法:
https://play.google.com/store/apps/details?id=com.bar.foo&referrer=BlahBlah
),让用户安装它,并使用identifier参数打开应用程序.有没有办法形成一个链接,打开一个带有参数的Android应用程序,无论是否安装该应用程序都可以使用?
我在我的设备上本地开发了一个Android应用程序(app尚未在Android Play商店中).我有以下逻辑来在MainActivity中获得深层链接.
GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this)
.enableAutoManage(this, null)
.addApi(AppInvite.API)
.build();
// Check if this app was launched from a deep link. Setting autoLaunchDeepLink to true
// would automatically launch the deep link if one is found.
boolean autoLaunchDeepLink = false;
AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, autoLaunchDeepLink)
.setResultCallback(
new ResultCallback<AppInviteInvitationResult>() {
@Override
public void onResult(@NonNull AppInviteInvitationResult result) {
if (result.getStatus().isSuccess()) {
// Extract deep link from Intent
Intent intent = result.getInvitationIntent();
String deepLink = AppInviteReferral.getDeepLink(intent);
Toast.makeText(getApplicationContext(), deepLink, Toast.LENGTH_LONG).show();
// Handle the deep link. …
Run Code Online (Sandbox Code Playgroud)