schellmax
schellmax

Reputation: 6094

How to set plugin variables in PhoneGap Build

I'm using PhoneGap Build to create a hybrid app in html/js.

When installing the ipa file from PhoneGap Build on my iPhone (iOS 11), spaces in the app name (on the homescreen, below the app icon) are stripped ('Myappnamecontainingspaces').

The app name is set inside the config.xml file as follows:

...
<widget id="com.phonegap.helloworld" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
    <name>My app name containing spaces</name>
...

After some research i found a cordova plugin with the following description: "I created this plugin to address the issue of spaces in the names of my Cordova apps." Nice!

According to the plugin description, the app name is set when installing the plugin:

cordova plugin add cordova-plugin-app-name --variable APP_NAME="Look <Ma> I Got Spaces and Stuff!"

BUT: I can't install any plugins for usage in PhoneGap Build, all plugins need to be listed in the config.xml file, so I tried:

<plugin name="cordova-plugin-app-name">
    <variable name="APP_NAME" value="My app name containing spaces" />
</plugin>

But this doesn't have any effect, the plugin is listed in PhoneGap Build, but the spaces in the app name are still gone.

Is this to correct way to provide plugin variables for PhoneGap Build?

Upvotes: 1

Views: 762

Answers (1)

jcesarmobile
jcesarmobile

Reputation: 53341

In Phonegap Build you have to use the param tag

<plugin name="cordova-plugin-app-name">
  <param name="APP_NAME" value="My app name containing spaces" />
</plugin>

Anyway, that plugin uses hooks, and Phonegap Build doesn't support hooks, so it's useless. If you want to use spaces in the app name, try using &#x2007; as separator

Upvotes: 1

Related Questions