Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom button Themeable Browser not worikng IOS #183

Open
manhlh opened this issue Sep 28, 2018 · 2 comments
Open

Custom button Themeable Browser not worikng IOS #183

manhlh opened this issue Sep 28, 2018 · 2 comments

Comments

@manhlh
Copy link

manhlh commented Sep 28, 2018

I use Ionic 3 and Themeable Browser library, I custom button in toolbar Themeable Browser and first time click SitePointSitePressed() not run BUT click second time then run 2 event.
My Code
` const me = this;
this.ref = cordova.ThemeableBrowser.open(this.productUrl, '_blank', options)
.addEventListener('loadstart', function () {
console.log('loadstart')
me.viewProduct = false;
}).addEventListener('loadstop', function (event) {
console.log('load done');
}).addEventListener('loaderror', function (event) {
console.log('load error');
}).addEventListener('exit', function (x) {
console.log('exit app');
me.clear();
})
.addEventListener('SitePointSitePressed', function (x) {
me.dialogs.confirm(
"", // title
me.transText['addOrder'], // message
['OK', me.transText['quit']] // buttonLabels,
).then(onConfirm);

    function onConfirm(buttonIndex) {
      me.categoryService.getAllUsingGET().subscribe(data => {
        me.categorys = data;
      })
      if (buttonIndex == 1) {
        me.showloading(null)
        const link_product = x.url + '';
        me.productController.getProductionInfomationUsingPOST(link_product.replace('m.1688.com', 'detail.1688.com')).subscribe(data => {
          console.log('data form link: ', data)
          me.hideLoading();
          me.product = data;
          if (me.product.shopConfig.max == 0) {
            navigator.notification.alert("Sản phẩm đã hết hàng", null, me.transText['notiTitle']);
          } else {
            me.getProductColor(me.product)
            me.ref.hide();
          }
        }, error => {
          alert(me.transText['getInfoProductError']);
          me.hideLoading();
          if (me.viewProduct == false) {
            me.ref.show();
          }
        })
      }
    }
  });`
@jinshuokang
Copy link

I also met, did you solve it?

@manhlh
Copy link
Author

manhlh commented Dec 24, 2019

I also met, did you solve it?

Yep, i can fix it. You download and replace "cordova-plugin-themeablebrowser" plugin in plugin folder.
step: remove plugin themeable > remove platform > add platform > replace themeable > build

Download here: https://drive.google.com/file/d/1SMC9-xggI1gA-Z9reHE2nnfnVdrrfFUm/view?usp=sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants