EAS update build phase (managed workflow)

Hello, I am trying to build an iOS app with this package https://github.com/bitwala/react-native-idnow using EAS on a managed workflow. It requires me to update the podfile, which I’m currently using a local plugin for it :white_check_mark:, but it also requires me to add a .h and .m files (taken from here) to the project (In Xcode I would be dragging those files to the project). I’m also able to create those files with the plugin but I think I’m missing the part where I add them to the build phases of the project.
Is this possible to do dynamically with EAS plugins?

Thank you

It’s possible to modify build phases with mods.ios.xcodeproj, but the way I understand those instructions is that you only need to follow Additional required steps: section

manual section describes steps that would be necessary for old react-native versions that do not have auto-linking

Yes indeed, the only step that I’m missing is the * Add RNIdnow.handRNIdnow.m files to the ios project(see demo app) step.
I will look into this mods section. Thanks!

Is there an example where I can see files being added to the XCode project file? Using mods.ios.xcodeproj or withXcodeProject methods?

I’m also interested in this. I had a look yesterday in the usual places (expo/expo and expo/config-plugins repositories on GitHub) but didn’t find an example.

I haven’t yet worked out how to use mods directly as opposed to withProjectBuildGradle etc., but I imagine you should get access to the parsed file which you can then manipulate with the xcode npm module. The docs for that seem a bit lacking, though.

I successfully added the files to the project. I searched for the withXcodeProject method in Expo repo https://github.com/expo/expo/search?q=withXcodeProject&type=code
and found this example expo/withNotificationsIOS.ts at 35f78160a9ec1758ca73eb9e079a1c278c9b1bb1 · expo/expo · GitHub

These are the steps I followed:

  • added the path to a local plugin on expo.plugins array in app.json
  • created a plugin similar to the withNotificationsIOS.ts plugin.
  • imported IOSConfig from @expo/config-plugins and checked the methods in IOSConfig.XcodeUtils. There are methods such as addBuildSourceFileToGroup or addFileToGroupAndLink that will update the project as if you did it with XCode.

I hope this helps.

1 Like

I must have made a mistake when I was searching because as you say there are indeed examples in the expo/expo repository :slight_smile:

Thanks.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.