0

Our application is based on Ionic 4 (with Capacitor & Angular) and shipped with different styles, a style per customer. Every customer has his dedicated app on the store (different bundle ids, icons, splashes...).

During the Angular build, a property file is generated containing the bundle id, the assets name, ... I use a preprocessor for the Plist file that takes care of the bundle version and build number, but I cannot customize the id and the assets name. Indeed, either Xcode complains that there is no certificate for my application, or the app is archived, but the bundle id is empty.

Is there a way with Xcode 10/11 to achieve this? ideally it should work on Ionic AppFlow and customized by a script reading a property file.

I know that appflow uses Fastlane and has a plugin to customize this id, but there is no documentation explaining if we can use our own Fastlane configuration on AppFlow?


First attempt, injecting the bundle id via a pre-processor. The file Info.plist contains:

<key>CFBundleIdentifier</key> <string>EMA_APP_ID</string>

The preprocessor contains:

echo "#define EMA_APP_ID ${APP_ID}" >> $PRE_PROCESSING_FILE

The error looks like: https://photos.app.goo.gl/Qn9iXWeUAyWAegSM7


Thank you, Sébastien.

sebge2
  • 383
  • 2
  • 11

2 Answers2

0

Looks like you are running into certificate issues. Have you registered the bundle ID on the Apple Developer portal? Have you created and downloaded a provisioning profile for the release to the App Store, and is it linked to the certificate you have on your computer?

Xcode should complain about certificate issues if it is not yet set up. You will need to do this before you can publish your app to the app store.

If you are sure that this is correct, please supply a screenshot of the error in Xcode.

vrwim
  • 13,020
  • 13
  • 63
  • 118
  • If the bundle id is manually set, the application is properly signed and it's successfully uploaded on TestFlight. The certificate issue only happens when I used a variable in my PList file like $(PRODUCT_BUNDLE_IDENTIFIER), or MY_APP_ID replaced by a preprocessor. – sebge2 Jan 20 '20 at 08:57
  • Huh, weird. Do you have Xcode signing set to automatic? (In the project overview there's a checkmark). If it's set to automatic, I can't really understand why changing the bundle id would cause Xcode to fail. Can you add a screenshot of the Xcode certificate error to your question? – vrwim Jan 20 '20 at 09:01
  • I have modified the question those details – sebge2 Jan 20 '20 at 16:16
0

I finally found the solution. In the pre-processor of the Info.plist, the bash script generates an xcconfig file. This file contains:

  • PRODUCT_BUNDLE_IDENTIFIER
  • ASSETCATALOG_COMPILER_APPICON_NAME
  • ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME
  • ASSETCATALOG_COMPILER_SPLASH_NAME (name I have invented)

This file is ignored on git and used to configured my app.

sebge2
  • 383
  • 2
  • 11