Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-12897

CLI: iOS, Mobile Web should allow App IDs with dashes

    Details

      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
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                cbarber Chris Barber
                Reporter:
                jbuckley Jamie Buckley
                Reviewer:
                Bryan Hughes
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-15771
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration