Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12897] CLI: iOS, Mobile Web should allow App IDs with dashes

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-03-11T08:25:11.000+0000
Affected Version/sRelease 3.1.0
Fix Version/sRelease 3.1.0, 2013 Sprint 05 JS, 2013 Sprint 05
ComponentsCLI
Labelscli-review, module_cli, qe-manualtest, qe-port
ReporterJamie Buckley
AssigneeChris Barber
Created2013-02-28T19:15:22.000+0000
Updated2014-08-07T16:49:11.000+0000

Description

When the user attempts to create an app with app id that contains a dash studio will not accept it. "I found that the regex that validates the app ids doesn't work for ids that contains a dash (com.trip-speed.owners). The id is valid and published to appstore, but when I wanted to do an update I got this error. The fix is in the_sdk_path/node_modules/titanium-sdk/lib/titanium.js line 156, change the regex to
    if (!/^([a-zA-Z_]{1}[a-zA-Z0-9_]*(\.[a-zA-Z0-9_-]*)*)$/.test(tiapp.id)) {
before was
    if (!/^([a-zA-Z_]{1}[a-zA-Z0-9_]*(\.[a-zA-Z0-9_]*)*)$/.test(tiapp.id)) {
Tests cases: Project creation:

should fail

ti create --name test --id com.appc.test_app --platforms ios --workspace-dir .

should fail

ti create --name test --id com.appc.test-app --platforms android --workspace-dir .

will work, but shows warning that app id not compatible with android

ti create --name test --id com.appc.test-app --platforms ios --workspace-dir .

will work, but shows warning that app id not compatible with ios

ti create --name test --id com.appc.test_app --platforms android --workspace-dir .

should fail

ti create --name test --id com.appc.1testapp --platforms android --workspace-dir .

should fail

ti create --name test --id com.appc.final --platforms android --workspace-dir .

will work, but shows warning that app id not compatible with android

ti create --name test --id com.appc.1testapp --platforms ios,mobileweb --workspace-dir .

will work, but shows warning that app id not compatible with android

ti create --name test --id com.appc.final --platforms ios,mobileweb --workspace-dir .

should fail

ti create --name test --platforms ios --workspace-dir . app id prompt> com.appc.test_app

should fail

ti create --name test --platforms android --workspace-dir . app id prompt> com.appc.test-app

will work, but shows warning that app id not compatible with android

ti create --name test --platforms ios --workspace-dir . app id prompt> com.appc.test-app

will work, but shows warning that app id not compatible with ios

ti create --name test --platforms android --workspace-dir . app id prompt> com.appc.test_app

will work, but shows warning that app id not compatible with android

ti create --name test --platforms ios,mobileweb --workspace-dir . app id prompt> com.appc.1testapp

will work, but shows warning that app id not compatible with android

ti create --name test --platforms ios,mobileweb --workspace-dir . app id prompt> com.appc.final
Building an app:

should fail

set <id> in tiapp.xml to com.appc.test_app

ti build -p ios

should fail

set <id> in tiapp.xml to com.appc.test-app

ti build -p android

should fail

set <id> in tiapp.xml to com.appc.1testapp

ti build -p android

should fail

set <id> in tiapp.xml to com.appc.final

ti build -p android

Comments

  1. Michael Xia 2013-02-28

    Studio does allow dash in the Titanium project creation wizard unless Android platform is selected. The description here looks to refer to the CLI code where the dash isn't allowed.
  2. Chris Barber 2013-02-28

    Android does not allow you to put dashes in the package name (http://developer.android.com/guide/topics/manifest/manifest-element.html). Titanium does not let you compile an app for Android if it contains a dash. This is works correctly. iOS allows dashes in the CFBundleIdentifier (http://developer.apple.com/library/ios/#documentation/general/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-SW1). Titanium does NOT allow dashes in app ids. This is incorrect and we'll fix this. Mobile Web doesn't care and allows whatever your heart desires for the app id.
  3. Chris Barber 2013-03-03

    Master pull request: https://github.com/appcelerator/titanium_mobile/pull/3928
  4. Olga Romero 2013-03-14

    Closing as fixed. Created an app with dash in app id for ios and mobileweb. Tested with: Titanium Studio, build: 3.0.3.201302201202 Titanium SDK, build: 3.1.0.v20130313215655 CLI 3.0.25

JSON Source