本文整理汇总了Java中com.badlogic.gdx.pay.PurchaseSystem类的典型用法代码示例。如果您正苦于以下问题:Java PurchaseSystem类的具体用法?Java PurchaseSystem怎么用?Java PurchaseSystem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PurchaseSystem类属于com.badlogic.gdx.pay包,在下文中一共展示了PurchaseSystem类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupPurchaseManager
import com.badlogic.gdx.pay.PurchaseSystem; //导入依赖的package包/类
public void setupPurchaseManager()
{
PurchaseSystem.onAppRestarted();
if (PurchaseSystem.hasManager())
{
PurchaseManagerConfig purchaseManagerConfig = getPurchaseManagerConfig();
PurchaseSystem.install(new PurchaseObserver(), purchaseManagerConfig);
}
}
示例2: purchaseSku
import com.badlogic.gdx.pay.PurchaseSystem; //导入依赖的package包/类
public void purchaseSku(String sku)
{
if (PurchaseSystem.hasManager())
{
PurchaseSystem.purchase(sku);
}
}
示例3: onActivityResult
import com.badlogic.gdx.pay.PurchaseSystem; //导入依赖的package包/类
@Override
public void onActivityResult (int requestCode, int resultCode, Intent data) {
// forward to corresponding Android IAP-system
PurchaseManager manager = PurchaseSystem.getManager();
if (manager != null) {
try {
// this might fail which is OK! --> some implementations will not require this...
Method method = manager.getClass().getMethod("onActivityResult", int.class, int.class, Intent.class);
method.invoke(manager, requestCode, resultCode, data);
} catch (Exception e) {
Log.d(TAG, "Failed to invoke onActivityResult(...) on purchase manager.", e);
}
}
}
示例4: AndroidGooglePlayPurchaseManager
import com.badlogic.gdx.pay.PurchaseSystem; //导入依赖的package包/类
@SuppressWarnings("unused") // Unit tested with reflection. (as in IAP.java)
public AndroidGooglePlayPurchaseManager(Activity activity,
AndroidFragmentApplication application,
int activityRequestCode) {
PurchaseResponseActivityResultConverter converter = new PurchaseResponseActivityResultConverter(this);
AsyncExecutor executor = new NewThreadSleepAsyncExecutor();
ApplicationProxy.FragmentProxy proxy = new ApplicationProxy.FragmentProxy(activity, application);
googleInAppBillingService = new V3GoogleInAppBillingService(proxy, activityRequestCode, converter, executor);
PurchaseSystem.setManager(this);
}
示例5: restorePurchase
import com.badlogic.gdx.pay.PurchaseSystem; //导入依赖的package包/类
public void restorePurchase()
{
PurchaseSystem.purchaseRestore();
}
示例6: dispose
import com.badlogic.gdx.pay.PurchaseSystem; //导入依赖的package包/类
@Override
public void dispose () {
// dispose the purchase system
PurchaseSystem.dispose();
}