本文整理匯總了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();
}