What is the expected 'platform' for iOS?


#1

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: http://stackoverflow.com/questions/23821136/ibm-worklight-v6-1-0-1-error-when-using-ionic-framework-with-worklight-and-run

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,


#2

I do believe the answer to your question is

platform-ready

and the proof comes if you run “ionic serve” for your app and see the Inspect Element in Chrome (not the page source), which shows you the following on the body tag -

class=“grade-a platform-ready”

Hope that helped. Cheers!


#3

While class=“platform-ready grade-a” is there, nothing displays still.
Perhaps something else is amiss as well.

Thanks for replying.


#4

The console doesn’t show you an error? Increase the number of things you log to the console and maybe we’ll get a hint about what’s up…