Java 类com.badlogic.gdx.pay.PurchaseSystem 实例源码

项目:space-travels-3    文件:Services.java   
public void setupPurchaseManager()
{
    PurchaseSystem.onAppRestarted();
    if (PurchaseSystem.hasManager())
    {
        PurchaseManagerConfig purchaseManagerConfig = getPurchaseManagerConfig();
        PurchaseSystem.install(new PurchaseObserver(), purchaseManagerConfig);
    }
}
项目:space-travels-3    文件:Services.java   
public void purchaseSku(String sku)
{
    if (PurchaseSystem.hasManager())
    {
        PurchaseSystem.purchase(sku);
    }
}
项目:gdx-pay    文件:IAP.java   
@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);
        }
    }
}
项目:gdx-pay    文件:AndroidGooglePlayPurchaseManager.java   
@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);
}
项目:space-travels-3    文件:Services.java   
public void restorePurchase()
{
    PurchaseSystem.purchaseRestore();
}
项目:gdx-pay    文件:IAP.java   
@Override
public void dispose () {
    // dispose the purchase system
    PurchaseSystem.dispose();
}