当前位置: 首页>>代码示例>>Java>>正文


Java AppInviteReferral.getDeepLink方法代码示例

本文整理汇总了Java中com.google.android.gms.appinvite.AppInviteReferral.getDeepLink方法的典型用法代码示例。如果您正苦于以下问题:Java AppInviteReferral.getDeepLink方法的具体用法?Java AppInviteReferral.getDeepLink怎么用?Java AppInviteReferral.getDeepLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.gms.appinvite.AppInviteReferral的用法示例。


在下文中一共展示了AppInviteReferral.getDeepLink方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processReferralIntent

import com.google.android.gms.appinvite.AppInviteReferral; //导入方法依赖的package包/类
private void processReferralIntent(Intent intent) {
    if (!AppInviteReferral.hasReferral(intent)) {
        Log.e(TAG, "Error: DeepLinkActivity Intent does not contain App Invite");
        return;
    }

    // Extract referral information from the intent
    String invitationId = AppInviteReferral.getInvitationId(intent);
    String deepLink = AppInviteReferral.getDeepLink(intent);

    // Display referral information
    // [START_EXCLUDE]
    Log.d(TAG, "Found Referral: " + invitationId + ":" + deepLink);
    ((TextView) findViewById(R.id.deep_link_text))
            .setText(getString(R.string.deep_link_fmt, deepLink));
    ((TextView) findViewById(R.id.invitation_id_text))
            .setText(getString(R.string.invitation_id_fmt, invitationId));
    // [END_EXCLUDE]

    if (mGoogleApiClient.isConnected()) {
        // Notify the API of the install success and invitation conversion
        updateInvitationStatus(intent);
    } else {
        // Cache the invitation ID so that we can call the AppInvite API after
        // the GoogleAPIClient connects
        Log.w(TAG, "Warning: GoogleAPIClient not connected, can't update invitation.");
        mCachedInvitationIntent = intent;
    }
}
 
开发者ID:rokity,项目名称:GCM-Sample,代码行数:30,代码来源:DeepLinkActivity.java

示例2: onResult

import com.google.android.gms.appinvite.AppInviteReferral; //导入方法依赖的package包/类
@Override public void onResult(@NonNull AppInviteInvitationResult result) {
    if (result.getStatus().isSuccess()) {
        Intent intent = result.getInvitationIntent();
        String deepLink = AppInviteReferral.getDeepLink(intent);
        Uri data = intent.getData();
        String userId = data.getQueryParameter(BuildConfig.SHARED_URI);
        Logger.e(deepLink, data, userId);
        if (!InputHelper.isEmpty(userId)) {
            if (isAttached()) getView().onRestoreFromUserId(userId);
        }
    } else {
        Logger.e("no deep link found.");
    }
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:15,代码来源:MainPresenter.java

示例3: processReferralIntent

import com.google.android.gms.appinvite.AppInviteReferral; //导入方法依赖的package包/类
private void processReferralIntent(Intent intent) {
    // Confirm receipt of the invitation
    if (getFragment().isConnected()) {
        updateInvitationStatus(intent);
    } else {
        Log.w(TAG, "GoogleAPIClient not connected, can't update invitation.");
        mCachedInvitationIntent = intent;
    }


    // Notify the listener of the received invitation
    String invitationId = AppInviteReferral.getInvitationId(intent);
    String deepLink = AppInviteReferral.getDeepLink(intent);
    getListener().onInvitationReceived(invitationId, deepLink);
}
 
开发者ID:googlearchive,项目名称:easygoogle,代码行数:16,代码来源:AppInvites.java

示例4: processReferral

import com.google.android.gms.appinvite.AppInviteReferral; //导入方法依赖的package包/类
/**
 * Process app invitation referral.
 *
 * @param intent Invitation intent to process.
 */
private void processReferral(Intent intent) {
    if (AppInviteReferral.hasReferral(intent)) {

        String invitationId = AppInviteReferral.getInvitationId(intent);
        String deepLink = AppInviteReferral.getDeepLink(intent);
        Timber.i("Invite referral: Invitation Id=%s, Deep link=%s", invitationId, deepLink);

        new AlertDialog.Builder(this, R.style.GallaudetTheme_AlertDialog)
                .setTitle(getString(R.string.invite_dialog_title))
                .setMessage(R.string.invite_dialog_message)
                .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        dialog.dismiss();
                    }
                })
                .create()
                .show();

        if (googleApiClient.isConnected()) {
            updateInvitationStatus(intent);
        } else {
            Timber.w("googleApiClient not connected, cannot update invitation.");
            cachedInvitationIntent = intent;
        }
    }
}
 
开发者ID:tjyu1040,项目名称:GallyShuttle,代码行数:33,代码来源:HomeActivity.java


注:本文中的com.google.android.gms.appinvite.AppInviteReferral.getDeepLink方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。