cordova-plugin-themeablebrowser icon indicating copy to clipboard operation
cordova-plugin-themeablebrowser copied to clipboard

In ionic themeablebrowser works fine with android platform, but nothing happens when put it into ios platform

Open Nekopedia28 opened this issue 10 years ago • 10 comments

Hi, I'm trying to add a custom inappbrowser into my app so I choose the themeablebrowser. It works well on android, but when I test it on ios emulator(6 and 6s) and iphone 4s, no page comes out after I click corresponding link. Ionic and cordova are both updated to the latest version. By the way, at first I tried cordova-plugin-inappbrowser, if I used window.open(link,'_blank',location) the page could show. So I think there may be something wrong in themeablebrowser's ios part. Could I get some help?

Nekopedia28 avatar Jul 15 '15 23:07 Nekopedia28

What's the iOS version (not device profile) that you tested on? Do you see any console messages in Safari debugger and Xcode console?

initialxy avatar Jul 16 '15 04:07 initialxy

I tested on 7.0.4 and 8. No console message in Xcode. If I create a new project and add this plugin, it can work. Therefore I guess the issue is not about IOS version, but more likely to be the conflict between plugins, or the themeablebrowser is not just loaded in my current project...

Nekopedia28 avatar Jul 16 '15 17:07 Nekopedia28

Hm so it has something to do with Ionic then. Could you please follow this guide to hook up your app in simulator with Safari debugger, and let me know if you see anything fishy from Safari's JavaScript console.

initialxy avatar Jul 17 '15 01:07 initialxy

My friend helped me find out the reason why themeablebrowser cannot work on IOS platform. We added Parse into our application, and it somehow caused that themeablebrowser is always not loaded when user clicks the button to open new window. The version of parse I used is 1.4.2, not sure about the latest version (1.5.0), but for the one I mentioned, it must have conflict with themeablebrowser in ionic. Maybe you can try it as well, if I'm right then you can add this as warning into introduction.

Nekopedia28 avatar Jul 17 '15 20:07 Nekopedia28

When you say themeablebrowser not loaded, you mean cordova.themeablebrowser is undefined? Did you make sure to call plugins after receiving deviceready event?

initialxy avatar Jul 17 '15 21:07 initialxy

No I didn't see that error, there's nothing in console. And I'm sure that deviceready event is reached.

Nekopedia28 avatar Jul 17 '15 23:07 Nekopedia28

@FadedWill I'm not able to reproduce this issue. I created an ionic 1.6.1 project, imported parse-1.4.2.js, and added cordova-plugin-themeablebrowser. Everything works fine for me.

Did you load parse-1.4.2.js in index.html or did you install one of the parse push notification PhoneGap plugin like this one.

What's the order of JavaScript being loaded in your index.html? Is it ionic.bundle.js, cordova.js, parse-1.4.2.js, app.js or something different?

You mentioned that you didn't see anything in console. Is that Xcode console or Safari debugger JavaScript console? It's extremely valuable to know what Safari debugger JavaScript console prints out.

Thanks.

initialxy avatar Jul 28 '15 05:07 initialxy

Hi How add loader or prograssbar in themebrowser i want to show laoder in themebrowser untill its open www.google.com.for now its taking some time to open and untill it opens its showing empty white screen.

this is my code (ima using ionic)

$scope.themebrowser = function() {

                    var ref = cordova.ThemeableBrowser.open('http://www.eenadu.net/andhra-pradesh-news.aspx', '_blank',
                    {
                        statusbar: {
                        color: '#ffffffff'
                    },
                    toolbar: {
                        height: 44,
                        color: '#f0f0f0ff'
                    },
                    title: {
                        color: '#003264ff',
                        showPageTitle: true
                    },
                    backButton: {
                        image: 'back',
                        imagePressed: 'back_pressed',
                        align: 'left',
                        event: 'backPressed'
                    },
                    forwardButton: {
                        image: 'forward',
                        imagePressed: 'forward_pressed',
                        align: 'left',
                        event: 'forwardPressed'
                    },
                    closeButton: {
                        image: 'close',
                        imagePressed: 'close_pressed',
                        align: 'right',
                        event: 'closePressed'
                    }
                    /*,
                    customButtons: [
                    {
                    image: 'share',
                    imagePressed: 'share_pressed',
                    align: 'right',
                    event: 'sharePressed'
                    }
                    ],
                    menu: {
                    image: 'menu',
                    imagePressed: 'menu_pressed',
                    title: 'Test',
                    cancel: 'Cancel',
                    align: 'right',
                    items: [
                    {
                    event: 'helloPressed',
                    label: 'Hello World!'
                    },
                    {
                    event: 'testPressed',
                    label: 'Test!'
                    }
                    ]
                    }*/
                    ,
                    "browserProgress": {
                    "showProgress": true,
                    "progressBgColor": "#016585",
                    "progressColor": "#FFAA16"
                    },
                    backButtonCanClose: true,
                    fullscreen:true
                    }).addEventListener('backPressed', function(e) {
                        $ionicHistory.goBack();
                    //alert('back pressed');
                    }).addEventListener('helloPressed', function(e) {
                    //alert('hello pressed');
                    }).addEventListener('sharePressed', function(e) {
                    //alert(e.url);
                    }).addEventListener(cordova.ThemeableBrowser.EVT_ERR, function(e) {
                        console.error(e.message);
                    }).addEventListener(cordova.ThemeableBrowser.EVT_WRN, function(e) {
                    //alert(e.message);
                    });



                    ref.addEventListener('loadstart', function(event) {
                        console.log('loadstart');
                        $ionicLoading.show({
                        content: 'Loading',
                        animation: 'fade-in',
                        showBackdrop: true,
                        maxWidth: 200,
                        showDelay: 0
                      });
                    //$scope.progressbar = ngProgressFactory.createInstance();
                    //$scope.progressbar.start();
                    });
                    ref.addEventListener('loadstop', function(event) {
                        $ionicLoading.hide();
                    //alert('loadstop');
                    //$scope.progressbar.stop();
                    $ionicLoading.hide();
                    });
                    ref.addEventListener('event_getURL', function(event) {
                    //alert('event_getURL');
                    });
                    ref.addEventListener('exit', function(event) {
                    //alert('exit');
                    });



 }

if add loader in on event load 'start' its not showing laoder in themble Browser its showing in my actuall view(before page)

how solve this please help me

anilk533 avatar Oct 10 '15 01:10 anilk533

Cannot read property 'ThemeableBrowser' of undefined,how to sovle it?

cailiuyang avatar Jan 05 '17 09:01 cailiuyang

Cannot read property 'ThemeableBrowser' of undefined,how to solve it?

cailiuyang avatar Jan 05 '17 09:01 cailiuyang