0

I have been working on a Cordova project for both iOS and Android. As part of the project as we will need to build a number of projects from a basic template.

I have done this by creating a template for the actual cordova project and also as part of it I pulled the cordova-ios-master code base for when we add the iOS platform. So we use our own cordova-ios-master due to some small modifications we needed to add.

With some of the plugins we have added / created we need to access SDK's / API's from some third party developers (this is mainly for some push notification services). Normally when we create the project and have added the platform we then need to add the linked frameworks using Xcode.

However I can see that within the cordova-ios-master there is the template Xcode project. I was hoping I could add the linked frameworks within this project so that they are already added when we first create the project and add the custom iOS platform.

What seems to be happening though is if I add the linked library into the template Xcode project and then save it. Once I then re-add that platform to the cordova project instead of the Xcode project being named after the cordova project name, it seems to have messed the re-naming of the Xcode project.

Below shows how the Xcode project normally appears when you add the libraries manually after adding the platform

cordova xcode project without modified Xcode template

So if i modify the Xcode template in cordova-ios-master, shown below....

enter image description here

You can see it already has a libCordova.a added. I add one more and re-save the project.

But then when I add the platform to my project again from this source, i open the Xcode project for it and whilst my library is added, the project was named "myproject" but i can't choose to run it as the project selection seems to appear as "PROJECT_NAME" as opposed to being named and usable as "my project"....

enter image description here

Im fairly new to mac's and Xcode so maybe I'm doing something basic wrong.

Any suggestions or ideas would really help, I hope this post makes sense, it is a bit complex.

Thanks again Rhys

1 Answers1

1

Right I found a solution. I think I was looking at the problem the wrong way round. So if I need to add a framework for a particular plugin, rather than edit the Xcode project to add the framework. Cordova actually gives you the option to add certain frameworks from within the plugin.xml. Found this answer here....

How to copy a custom ios framework using plugin.xml on Phonegap 3

so I have added a required framework like so....

<framework src="src/ios/OtherLevels/OtherLevels.framework" custom="true" />

My bad!

-Rhys

Community
  • 1
  • 1
  • I am having almost the same problem as you had. Are you kind to provide the command that will generate the framework? I have a generated with plugman plugin (src & www & plugin.xml & package.json) and I have added Alamofire as a framework in the plugin.xml `` I need to use it in a Ionic/Cordova project that adds this plugin that will have this Alamofire framework. – Alex Jun 15 '17 at 07:21