Search code examples
firebase-cloud-messagingcordova-ios

cordova-ios: plist file not copied from Resources to xcarchive


I'm putting a custom plist file (GoogleService-Info.plist) into my Resources directory, but it isn't getting copied into my built project. I can go into XCode and manually add it through "Copy Bundle Resources", but I need to get this running without manual steps.

I can't just use <resource-file src="src/GoogleService-Info.plist" /> in my plugin.xml because I'm building for a couple different widgetIds - I have 2 versions of this file that I switch out, depending on my widgetId. I have the copying and renaming automated with a hook to get the right file into Resources/GoogleService-Info.plist.

How can I get the file I put into Resources included?


Solution

  • The cordova-ios project has code to get the resource files included in the XCode project files, and you could replicate that, but I ended up with a workaround:

    1. Copied my file to a consistent name in a before_prepare hook
    2. Used a resource-file tag for the new name in my plugin.xml