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


Java AppInvite类代码示例

本文整理汇总了Java中com.google.android.gms.appinvite.AppInvite的典型用法代码示例。如果您正苦于以下问题:Java AppInvite类的具体用法?Java AppInvite怎么用?Java AppInvite使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AppInvite类属于com.google.android.gms.appinvite包,在下文中一共展示了AppInvite类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.google.android.gms.appinvite.AppInvite; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.deep_link_activity);

    // Button click listener
    findViewById(R.id.button_ok).setOnClickListener(this);

    // Note: for simplicity, this sample uses the 'enableAutoManage' feature of
    // GoogleApiClient.  This sample does not handle all possible error cases that
    // can arise when using enableAutoManage, so consult the documentation before
    // using enableAutoManage in a more complicated application
    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .enableAutoManage(this, 0, this)
            .addApi(AppInvite.API)
            .build();
}
 
开发者ID:rokity,项目名称:GCM-Sample,代码行数:19,代码来源:DeepLinkActivity.java

示例2: updateInvitationStatus

import com.google.android.gms.appinvite.AppInvite; //导入依赖的package包/类
/** Update the install and conversion status of an invite intent **/
// [START update_invitation_status]
private void updateInvitationStatus(Intent intent) {
    String invitationId = AppInviteReferral.getInvitationId(intent);

    // Note: these  calls return PendingResult(s), so one could also wait to see
    // if this succeeds instead of using fire-and-forget, as is shown here
    if (AppInviteReferral.isOpenedFromPlayStore(intent)) {
        AppInvite.AppInviteApi.updateInvitationOnInstall(mGoogleApiClient, invitationId);
    }

    // If your invitation contains deep link information such as a coupon code, you may
    // want to wait to call `convertInvitation` until the time when the user actually
    // uses the deep link data, rather than immediately upon receipt
    AppInvite.AppInviteApi.convertInvitation(mGoogleApiClient, invitationId);
}
 
开发者ID:rokity,项目名称:GCM-Sample,代码行数:17,代码来源:DeepLinkActivity.java

示例3: GoogleInviteApi

import com.google.android.gms.appinvite.AppInvite; //导入依赖的package包/类
@Inject
GoogleInviteApi(Context context) {
  client = new GoogleApiClient.Builder(context)
      .addConnectionCallbacks(this)
      .addOnConnectionFailedListener(this)
      .addApi(AppInvite.API)
      .build();
}
 
开发者ID:ashdavies,项目名称:eternity,代码行数:9,代码来源:GoogleInviteApi.java

示例4: onCreate

import com.google.android.gms.appinvite.AppInvite; //导入依赖的package包/类
@Override protected void onCreate(Bundle savedInstanceState) {
    setTheme(R.style.AppTheme);
    super.onCreate(savedInstanceState);
    if (savedInstanceState == null) {
        getSupportFragmentManager()
                .beginTransaction()
                .replace(R.id.container, DeviceAppsView.newInstance(), DeviceAppsView.TAG)
                .commit();
        getPresenter().onHandleShortcuts(this, getIntent());
        AppInvite.AppInviteApi.getInvitation(getGoogleApiClient(), this, false).setResultCallback(getPresenter());
    }
    drawerLayout.setStatusBarBackground(R.color.primary_dark);
    setToolbarIcon(R.drawable.ic_menu);
    getPresenter().onActivityStarted(savedInstanceState, this, bottomNavigation, navigation);
    if (null != savedInstanceState) getBadgeProvider().restore(savedInstanceState);
    if (navType == MainMvp.FOLDERS) {
        fab.show();
    } else {
        fab.hide();
    }
    if (PrefConstant.showIntroScreen()) {
        startActivity(new Intent(this, IntroPagerView.class));
        PrefConstant.setIntroScreen();
    }
    if (PrefConstant.showWhatsNew()) {
        PrefConstant.setWhatsNewVersion();
        startActivity(new Intent(this, WhatsNewView.class));
    }
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:30,代码来源:MainView.java

示例5: getGoogleApiClient

import com.google.android.gms.appinvite.AppInvite; //导入依赖的package包/类
private GoogleApiClient getGoogleApiClient() {
    if (mGoogleApiClient == null) {
        mGoogleApiClient = new GoogleApiClient.Builder(this)
                .enableAutoManage(this, this)
                .addApi(AppInvite.API)
                .build();
    }
    return mGoogleApiClient;
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:10,代码来源:MainView.java

示例6: updateInvitationStatus

import com.google.android.gms.appinvite.AppInvite; //导入依赖的package包/类
private void updateInvitationStatus(Intent intent) {
    // Extract invitation Id
    String invitationId = AppInviteReferral.getInvitationId(intent);

    // Update invitation installation status and also convert the invitation.
    GoogleApiClient gac = getFragment().getGoogleApiClient();
    if (AppInviteReferral.isOpenedFromPlayStore(intent)) {
        AppInvite.AppInviteApi.updateInvitationOnInstall(gac, invitationId);
    }

    AppInvite.AppInviteApi.convertInvitation(gac, invitationId);
}
 
开发者ID:googlearchive,项目名称:easygoogle,代码行数:13,代码来源:AppInvites.java

示例7: updateInvitationStatus

import com.google.android.gms.appinvite.AppInvite; //导入依赖的package包/类
/**
 * Mark invitation as successful.
 *
 * @param invitationIntent Intent to update invitation installation success.
 */
private void updateInvitationStatus(Intent invitationIntent) {
    String invitationId = AppInviteReferral.getInvitationId(invitationIntent);
    if (AppInviteReferral.isOpenedFromPlayStore(invitationIntent)) {
        AppInvite.AppInviteApi.updateInvitationOnInstall(googleApiClient, invitationId);
    }
    AppInvite.AppInviteApi.convertInvitation(googleApiClient, invitationId);
}
 
开发者ID:tjyu1040,项目名称:GallyShuttle,代码行数:13,代码来源:HomeActivity.java

示例8: googleApiClient

import com.google.android.gms.appinvite.AppInvite; //导入依赖的package包/类
@Provides
@ApplicationScope
GoogleApiClient googleApiClient(Application application) {
    return new GoogleApiClient.Builder(application)
            .addApi(AppInvite.API)
            .build();
}
 
开发者ID:tjyu1040,项目名称:GallyShuttle,代码行数:8,代码来源:ApplicationModule.java

示例9: onNewIntent

import com.google.android.gms.appinvite.AppInvite; //导入依赖的package包/类
@Override protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    getPresenter().onHandleShortcuts(this, intent);
    AppInvite.AppInviteApi.getInvitation(getGoogleApiClient(), this, false).setResultCallback(getPresenter());
}
 
开发者ID:k0shk0sh,项目名称:FastAccess,代码行数:6,代码来源:MainView.java

示例10: setupGoogleClient

import com.google.android.gms.appinvite.AppInvite; //导入依赖的package包/类
private void setupGoogleClient() {
    googleApiClient = new GoogleApiClient.Builder(this)
            .addApi(AppInvite.API)
            .enableAutoManage(this, this)
            .build();
}
 
开发者ID:malmstein,项目名称:yahnac,代码行数:7,代码来源:NewsActivity.java

示例11: getApis

import com.google.android.gms.appinvite.AppInvite; //导入依赖的package包/类
@Override
public List<Api> getApis() {
    return Arrays.asList(new Api[]{
        AppInvite.API
    });
}
 
开发者ID:googlearchive,项目名称:easygoogle,代码行数:7,代码来源:AppInvites.java


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