Question

I have developed an application for iPad and now I want to adapt it to iPhone, then I realized that I have two options: I can create an iPhone Environment or create a skin for iPhone.

The point is that if I create iPhone and iPad environments and I upload both .ipa to the application center, the user will find two applications with the same name available for download. I have not found the way to avoid this in Application Center. I can only add the platform in the description.

What is the best option? What is the difference between iPad and iPhone Environments?

EDIT: I'm not being able to create a skin in the iPad Environment, the getSkinName function is not executed.

Was it helpful?

Solution

The Xcode projects generated by Worklight Studio for the iPhone and iPad environments are both created with the Universal application setting. Their codebase (Worklight-framework related) is mostly the same...

You can change the generated project from being Universal to being device-specific. This is a setting that you can tweak in Xcode.

After doing so, the App Center management console will be able to distinguish between the iPad and iPhone app. You can then simply edit the upload entry and give it a different label. This label change only affects what you see in the management console, not the app name itself, so all is good.


  • If you want to keep your app size to a minimum, then I would go for seperate environments rather than using Skins.

  • This will also help by giving you more control over your users (using Direct Update, Remote Disable, etc...) in case you have an issue only in the iPhone or iPad app.

I have also confirmed that Worklight Skins do work in the iPad environment.

  1. Created a new Worklight project ("test") and application ("test")
  2. Added the iPad environment
  3. Added a skin ("ipad.skin")
  4. Added a new appName.js (for Worklight 5.0.6/6.0, or main.js for Worklight 6.1) file in the ipad.skin\js folder with:

    alert ("test");

  5. Edited ipad\js\skinLoader.js file to use:

    function getSkinName() {
      return "ipad.skin";
    }
    
  6. Built and deployed

  7. Opened and ran in Xcode

Result: the app opened in the iOS Simulator with an alert stating "test". Ergo, works...
Please make sure you have followed these steps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top