protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            try
            {
                _connectionHelper              = new InAppBillingConnectionHelper(this, Config.BazarKey);
                _connectionHelper.OnConnected += async(sender, e) =>
                {
                    _billingHelper = _connectionHelper.BillingHelper;
                };

                _connectionHelper.Connect();
            }

            catch (Exception er)
            {
                var d = er.Message;
            }
        }
Esempio n. 2
0
        public void OnServiceDisconnected(ComponentName name)
        {
            Connected     = false;
            Service       = null;
            BillingHelper = null;

            RaiseOnDisconnected();
        }
Esempio n. 3
0
        private void HandleOnConnected(object sender, EventArgs e)
        {
            _billingHelper = _serviceConnection.BillingHelper;

            #if DEBUG
            if (_billingHelper != null)
            {
                Toast.MakeText(this, "Connected to in app billing service", ToastLength.Short).Show();
            }
            else
            {
                Toast.MakeText(this, "Connected to in app billing service but helper is null", ToastLength.Short).Show();
            }
            #endif

            ToggleAdIfNeeded();
            InvalidateOptionsMenu();
        }
 void HandleOnConnected(object sender, EventArgs e)
 {
     _billingHelper = _serviceConnection.BillingHelper;
 }
Esempio n. 5
0
        private void HandleOnConnected(object sender, EventArgs e)
        {
            _billingHelper = _serviceConnection.BillingHelper;

            #if DEBUG
            if (_billingHelper != null)
            {
                Toast.MakeText(this, "Connected to in app billing service", ToastLength.Short).Show();
            }
            else
            {
                Toast.MakeText(this, "Connected to in app billing service but helper is null", ToastLength.Short).Show();
            }
            #endif

            ToggleAdIfNeeded();
            InvalidateOptionsMenu();
        }