Hi ionicers,
I have some question that may be difficult to answer…
There is a product called Worklight. Worklight provides a way to create Hybrid apps which has Cordova at its core. There is also the ability to preview your app.
Anyway,
When previewing the Android environment - all works.
When previewing the iPhone environment, this fails with the error:
Uncaught InvalidCharacterError: Failed to execute ‘add’ on ‘DOMTokenList’: The token provided (‘platform-ios - iphone’) contains HTML space characters, which are not valid in tokens.
You can see a related question here: ibm mobilefirst - IBM Worklight v6.1.0.1 : Error when using Ionic Framework with Worklight and run on IOS environment - Stack Overflow
To over come this issue I provided a hack in ionic.bundle.js:
for(var i = 0; i < ionic.Platform.platforms.length; i++) {
if (ionic.Platform.platforms[i] = "ios - iphone") {
document.body.classList.add('platform-ios');
// or maybe platform-iphone', I don't know...
} else {
document.body.classList.add('platform-' + ionic.Platform.platforms[i]);
}
}
Now, this removes the error, but the preview still fails with a blank screen.
So I guess my question is: what is ionic expecting to get as the platform value there? Perhaps there is something else required that prevents the app from working. I couldn’t fully follow it through while debugging in Chrome.
Thanks,