I've imported a plug-in into my Ionic 2 project and made some changes to it to see if that would solve a problem I had with it. Is there a way to update that plug-in's implementation in the added platforms?
on that note, is there a way to make my own plug-in without having to publish it on Cordova?
Related
I have an iOS project that uses a Carthage framework which I created for myself. For convenience let's name them as following.
MAIN_ PROJECT
MY_FRAMEWORK
I make changes to MY_FRAMEWORK often that each time I change it I need to run carthage update on MAIN_PROJECT which take quite a time.
I wonder if there is a way to make changes to MY_FRAMEWORK and affect changes to MAIN_PROJECT without calling carthage update but still keeping MY_FRAMEWORK a separated repository framework so I can be used from other projects.
If it is an option to integrate it into your project using Swift Package Manager then Apple has a solution for you:
Swift packages are a convenient and lightweight solution for creating a modular app architecture and reusing code across your apps or with other developers. Over time, you may want to develop your published Swift package in tandem with your app, or create a sample app to showcase its features. To develop a Swift package in tandem with an app, you can leverage the behavior whereby a local package overrides a package dependency with the same name:
Add the Swift package to your app as a package dependency instead of a local package, as described in Editing a Package Dependency as a Local Package.
Develop your app and your Swift package in tandem, and push changes to their repositories.
If you release a new version of your Swift package or want to stop using the local package, remove it from the project to use the package dependency again.
Also have a look at detailled instructions with links to related topics.
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
So if i modify the Xcode template in cordova-ios-master, shown below....
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"....
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
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
I have a directory of "Today Extension" project.
I want to add the project to my Cordova project, one may know the platform directory in the Cordova project when I run the command
CLI: "cordova platform add ios"
is automatically generated and couldn't be added through Xcode.
Adding a target to an existing XCode project is something that can be done using node with the xcode package or through ruby using xcodeproj. The exact method on how to do so, however, is something I haven't figured out yet and I'm also very interested in.
So far, I have found one resource where they actually add a watchkit extension, but I haven't had the time to look into this in much depth. Also I think I myself lack the skill to generalize this into a plugin.
I'm creating my first Cordova plugin and I'm confused to the structure of building it. I have a fresh Cordova project and I've added the iOS platform. I was looking at this for guidance (specifically the Echo iOS plugin example part):
https://cordova.apache.org/docs/en/5.1.1/guide/platforms/ios/plugin.html
but I'm quite new to this and I'm a little bamboozled by what I'm actually supposed to be doing. It tells me to use plugin.xml to inject a feature specification to the local platform's config.xml file. Is the plugin.xml a file I need to create or is it the one in project> plugins> cordova-plugin-whitelist > plugin.xml? Either way how do I use it to inject this feature? I presume it's something it reads from when it builds the project but I'm still unsure how to do it.
Thanks.
As far as i know to create custom plugins, you gotta create a plugin folder as per the specifications and ensure that the plugin is referred in the fetch.json file under plugins folder. Then removing and re-adding the platform should take care of plugin installation in respective folder. You can refer any of the existing plugins to replicate the same folder structure.
The detailed info on custom plugin creation is available in cordova official documentation.Hope it helps
I'm working on a Cordova project that requires me to replace my main.m file with a .mm file and - along with adding a custom build phase script. When I do this I can no longer use the cordova cli commands or cleanly upgrade my cordova project when new versions are released.
I can't seem to find any documentation on editing things at this level. Can anyone point me in the right direction? I've looked into the cordova hooks but I'm not sure whether that would work or where to hook my code to ensure a proper build.
Fork the Cordova-iOS and maintain your changes there. Merge commits from the original apache repo from time to time.
Use cordova platform add your-fork-git-url#branch-or-tag to add platform
I hope it can help