hello i m confused, in the past i had a running v2 version.
now i tried out the stable and after my splash i get a white screen.
does anyone have an idea what the problem could be?
hello i m confused, in the past i had a running v2 version.
now i tried out the stable and after my splash i get a white screen.
does anyone have an idea what the problem could be?
Try to disable push state
You get a white screen because it doesnât load your default route.
because of the push state??
Because it is wrong configured. In phonegap/cordova app the default URL is not just â/
â
okay so the pushState can be on true but i have to change the â/â routes on my routes.js and on my index.html?
do you know the default path?
do the console.log(document.location.href)
when it run in cordova app. If it is something like file:///Users/something/someapp/www/index.html
then you need to specify
pushStateRoot: '/Users/something/someapp/www/'
And the init URL set on view and in routes must be index.html
then instead of just /
the adress is âfile:///android_asset/www/index.htmlâ but i thing on ios it will be different.
some dynamic option would be good hm
pushStateRoot: Framework7.device.ios ? 'ios-url-here' : 'android-url-here'
okay now it work i added /index.html and /index.html to index.html and routes.js
maybe we can remove file:/// and index.html from document.location.href for dynamic out of box work?
why it is needed now and on the f7 v1.* not.
it is not really easy anymore, because now i have to add all the possible devices
/data/com.adobe.phonegap.app/files/phonegapdevapp/www/ is not working for the phongap dev app
/data/com.adobe.phonegap.app/files/phonegapdevapp/www (without slash is broken âŚ)
ps must it /index.html or without slash (only working with leading slash on android)
You can just try set it to document.location.pathname.split(âindex.htmlâ)[0]
document.location.pathname.split(âindex.htmlâ)[0]
works also great for ios phone / tablet. maybe we can make a cordova property which make this automaticlly. i think everyone need this with pushState + cordova!
Hello, thank God I have found this post coz I have been scratching my head all week on this.
Unfortunately, I canât seem to get this to work. I do not think I quite follow you guys on where to add this line of code.
document.location.pathname.split(âindex.htmlâ)[0]
Where does it go?
Thanks
It goes to pushStateRoot
parameter under the view for which you have enabled pushState
:
...
pushState: true,
pushStateRoot: document.location.pathname.split(âindex.htmlâ)[0]
...
Guys i will advise you to DISABLE push state in cordova apps! Why do you need it there? Only to be able to go back with hardware back button on Android devices only? There is more flexible solutions for this using backbutton
event:
$(document).on('backbutton', function (e) {
e.preventDefault();
// for example, based on what and where view you have
mainView.router.back();
});
I do not enable pushstate. Is it enabled by default?
Then you have some missconfiguration of routes
This is my route configuration:
var routes = [
{
path: â/â,
url: â./index.htmlâ,
name: âhomeâ,
},
{
path: â/question/:id/â,
componentUrl: â./pages/question.htmlâ,
},
{
path: â/answer/:id/â,
componentUrl: â./pages/answer.htmlâ,
}
]
More details, Cordova or web app? Platform iOS or Android? Any webview plugins like WKWebView? Any errors in developer console?