本文整理汇总了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();
}
示例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);
}
示例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();
}
示例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));
}
}
示例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;
}
示例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);
}
示例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);
}
示例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();
}
示例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());
}
示例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();
}
示例11: getApis
import com.google.android.gms.appinvite.AppInvite; //导入依赖的package包/类
@Override
public List<Api> getApis() {
return Arrays.asList(new Api[]{
AppInvite.API
});
}