Search in sources :

Example 1 with TransactionDetails

use of com.anjlab.android.iab.v3.TransactionDetails in project Phonograph by kabouzeid.

the class App method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    app = this;
    // default theme
    if (!ThemeStore.isConfigured(this, 1)) {
        ThemeStore.editTheme(this).activityTheme(R.style.Theme_Phonograph_Light).primaryColorRes(R.color.md_indigo_500).accentColorRes(R.color.md_pink_A400).commit();
    }
    // Set up Crashlytics, disabled for debug builds
    Crashlytics crashlyticsKit = new Crashlytics.Builder().core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()).build();
    if (!BuildConfig.DEBUG) {
        Fabric.with(this, crashlyticsKit, new Answers());
    } else {
        // crashlytics kit is disabled here
        Fabric.with(this, crashlyticsKit);
    }
    // Set up dynamic shortcuts
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
        new DynamicShortcutManager(this).initDynamicShortcuts();
    }
    // automatically restores purchases
    billingProcessor = new BillingProcessor(this, App.GOOGLE_PLAY_LICENSE_KEY, new BillingProcessor.IBillingHandler() {

        @Override
        public void onProductPurchased(String productId, TransactionDetails details) {
        }

        @Override
        public void onPurchaseHistoryRestored() {
        // Toast.makeText(App.this, R.string.restored_previous_purchase_please_restart, Toast.LENGTH_LONG).show();
        }

        @Override
        public void onBillingError(int errorCode, Throwable error) {
        }

        @Override
        public void onBillingInitialized() {
        }
    });
}
Also used : Answers(com.crashlytics.android.answers.Answers) DynamicShortcutManager(com.kabouzeid.gramophone.appshortcuts.DynamicShortcutManager) BillingProcessor(com.anjlab.android.iab.v3.BillingProcessor) TransactionDetails(com.anjlab.android.iab.v3.TransactionDetails) Crashlytics(com.crashlytics.android.Crashlytics)

Aggregations

BillingProcessor (com.anjlab.android.iab.v3.BillingProcessor)1 TransactionDetails (com.anjlab.android.iab.v3.TransactionDetails)1 Crashlytics (com.crashlytics.android.Crashlytics)1 Answers (com.crashlytics.android.answers.Answers)1 DynamicShortcutManager (com.kabouzeid.gramophone.appshortcuts.DynamicShortcutManager)1