本文整理汇总了Java中com.anjlab.android.iab.v3.BillingProcessor.isIabServiceAvailable方法的典型用法代码示例。如果您正苦于以下问题:Java BillingProcessor.isIabServiceAvailable方法的具体用法?Java BillingProcessor.isIabServiceAvailable怎么用?Java BillingProcessor.isIabServiceAvailable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.anjlab.android.iab.v3.BillingProcessor
的用法示例。
在下文中一共展示了BillingProcessor.isIabServiceAvailable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkPayment
import com.anjlab.android.iab.v3.BillingProcessor; //导入方法依赖的package包/类
private void checkPayment(String productId) {
boolean isAvailable = BillingProcessor.isIabServiceAvailable(mContext);
if (isAvailable) {
billingProcessor.purchase(mContext, productId);
} else {
Toast.makeText(mContext, R.string.ui_error, Toast.LENGTH_LONG).show();
}
}
示例2: onResume
import com.anjlab.android.iab.v3.BillingProcessor; //导入方法依赖的package包/类
@Override
protected void onResume() {
super.onResume();
if (Config.get().donationEnabled() && BillingProcessor.isIabServiceAvailable(this)) {
bp = new BillingProcessor(this, Config.get().donationLicenseKey(), this);
}
}
示例3: makePurchase
import com.anjlab.android.iab.v3.BillingProcessor; //导入方法依赖的package包/类
private void makePurchase(int product) {
String sku = null;
switch (product) {
case 0:
sku = SupporterHelper.SKU_TWO_DOLLAR;
break;
case 1:
sku = SupporterHelper.SKU_SIX_DOLLAR;
break;
case 2:
sku = SupporterHelper.SKU_TWELVE_DOLLAR;
break;
case 3:
sku = SupporterHelper.SKU_THIRTY_DOLLAR;
break;
}
//Get Product from SKU
Products products = SupporterHelper.getProduct(sku);
Analytics.from(this).sendAddToCartEvent(products, sku);
//Initiate purchase
if (BillingProcessor.isIabServiceAvailable(this)) {
Analytics.from(this).sendStartCheckout(products);
bp.purchase(this, sku);
} else {
SnackbarHandler.showErrorSnackbar(this, coordinatorLayout, "Issues connecting to Google Play Billing");
}
}
示例4: isIabServiceAvailable
import com.anjlab.android.iab.v3.BillingProcessor; //导入方法依赖的package包/类
private Boolean isIabServiceAvailable() {
return BillingProcessor.isIabServiceAvailable(_reactContext);
}
示例5: onCreate
import com.anjlab.android.iab.v3.BillingProcessor; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int m_theme;
final Context context = this;
m_theme = R.style.BaseAppTheme;
setTheme(m_theme);
setContentView(R.layout.activity_support);
ButterKnife.bind(this);
if (SupporterHelper.isSupporter()) {
purchaseButton.setText("You again? Sure!");
enterReveal(supportThankYou);
} else {
purchaseButton.setText("Become a Supporter");
}
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
toolbar.setTitle("");
isAvailable = BillingProcessor.isIabServiceAvailable(context);
if (isAvailable) {
// continue
bp = new BillingProcessor(this, getResources().getString(R.string.rsa_key), this);
} else {
SnackbarHandler.showErrorSnackbar(this, coordinatorLayout, "Google Play billing services not available.");
}
nestedScrollView.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
@Override
public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
if (scrollY == (v.getChildAt(0).getMeasuredHeight() - v.getMeasuredHeight())) {
fabSupporter.hide();
} else {
if (!fabSupporter.isShown()){
fabSupporter.show();
}
}
}
});
}