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

White page on Android #23

Closed
gau1991 opened this issue Jun 22, 2015 · 13 comments
Closed

White page on Android #23

gau1991 opened this issue Jun 22, 2015 · 13 comments

Comments

@gau1991
Copy link

gau1991 commented Jun 22, 2015

Hi,
I was playing with WordPress-hybrid-client 1.2.0,
With devserver its working fine, but on android app, its showing only white page, tested on three different devices having different android version.

@shprink
Copy link
Collaborator

shprink commented Jun 22, 2015

Could you please dump console errors. It is hard to tell what's wrong without it, it could be anything.

https://github.com/shprink/wordpress-hybrid-client/blob/develop/BUILD.md#debug

@gau1991
Copy link
Author

gau1991 commented Jun 22, 2015

Sorry, I missed logs,
Here are are complete error:

 Uncaught TypeError: Cannot read property 'getPreferredLanguage' of undefined 

Showing error for following block:

          getPreferredLanguage: function () {
            var q = $q.defer();

            navigator.globalization.getPreferredLanguage(function (result) {
                q.resolve(result);
              },
              function (err) {
                q.reject(err);
              });
            return q.promise;
          },

@shprink
Copy link
Collaborator

shprink commented Jun 22, 2015

Ok then you miss a plugin https://github.com/shprink/wordpress-hybrid-client/blob/develop/package.json#L104

Re install it

cordova plugin rm org.apache.cordova.globalization
cordova plugin add org.apache.cordova.globalization

It happens often that plugins are not correctly installed with Cordova.

@gau1991
Copy link
Author

gau1991 commented Jun 22, 2015

Thanks now app is working, but getting this error now:

Request URL: http://example.com/wp-json/posts?filter%5Borderby%5D=desc&filter%5Bpost_status%5D=publish&filter%5Bposts_per_page%5D=6&page=1
Request Method:GET
Status Code:404 Not Found (from cache)

Note: Here http://example.com/wp-json/posts?filter%5Borderby%5D=desc&filter%5Bpost_status%5D=publish&filter%5Bposts_per_page%5D=6&page=1 is working fine in browser.
Is it cache issue?

@shprink
Copy link
Collaborator

shprink commented Jun 22, 2015

Give me a link to your WP blog. http://example.com can't be it!

@gau1991
Copy link
Author

gau1991 commented Jun 22, 2015

@shprink
Copy link
Collaborator

shprink commented Jun 22, 2015

Ok so if I understand correctly the request works on the browser but not on Android?

Are you sure your device is online? I am not sure what can cause that.

@gau1991
Copy link
Author

gau1991 commented Jun 22, 2015

Ok so if I understand correctly the request works on the browser but not on Android?

Yes, on browser works fine, but on android getting this error.

Are you sure your device is online?

Yes my device is online, my device and laptop are connected to same wifi

I also observed server logs, request is not coming to server. I fear that it might the android cache issue as on chrome logs its showing

Status Code:404 Not Found (from cache)
Request Headers

@shprink
Copy link
Collaborator

shprink commented Jun 22, 2015

I have never had this problem. I would appriate if you investigate further and let me know what you can find. Thanks @gau1991 :)

@shprink
Copy link
Collaborator

shprink commented Jun 22, 2015

It could be related to the domain white list but I specified *

https://github.com/shprink/wordpress-hybrid-client/blob/develop/config.xml.dist#L11

@gau1991
Copy link
Author

gau1991 commented Jun 22, 2015

Hi, Following steps worked for me:

cordova plugin add cordova-plugin-whitelist

and add <allow-navigation href="http://*/*" /> into config.xml

@shprink
Copy link
Collaborator

shprink commented Jun 22, 2015

I created #24 for this problem. Thanks for your help :)

@shprink shprink closed this as completed Jun 22, 2015
@shprink
Copy link
Collaborator

shprink commented Jun 24, 2015

@gau1991

I am having problems installing this plugin on iOS:

Fetching plugin "cordova-plugin-whitelist" via npm
Installing "cordova-plugin-whitelist" for android
Installing "cordova-plugin-whitelist" for ios
Failed to install 'cordova-plugin-whitelist':CordovaError: Plugin doesn't support this project's cordova-ios version. cordova-ios: 3.7.0, failed version requirement: >=4.0.0-dev
    at checkEngines (/Users/shprink/Sites/wordpress-hybrid-client/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:116:29)
    at /Users/shprink/Sites/wordpress-hybrid-client/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:289:16
    at _fulfilled (/Users/shprink/Sites/wordpress-hybrid-client/node_modules/cordova/node_modules/q/q.js:787:54)
    at self.promiseDispatch.done (/Users/shprink/Sites/wordpress-hybrid-client/node_modules/cordova/node_modules/q/q.js:816:30)
    at Promise.promise.promiseDispatch (/Users/shprink/Sites/wordpress-hybrid-client/node_modules/cordova/node_modules/q/q.js:749:13)
    at /Users/shprink/Sites/wordpress-hybrid-client/node_modules/cordova/node_modules/q/q.js:557:44
    at flush (/Users/shprink/Sites/wordpress-hybrid-client/node_modules/cordova/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:419:13)
Plugin doesn't support this project's cordova-ios version. cordova-ios: 3.7.0, failed version requirement: >=4.0.0-dev

I will have to find another solution.

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