Custom IOS Plugins (Using Cocoa Pods)


#1

Hey everybody,

I’m trying to get started developing a few iOS plugins based of of Cocoa Pods (the first one being for the square card reader).

I have a working version of the seed plugin example, but the documentation doesn’t show how to interact with any 3rd party libraries, just the native iOS commands (ie NSBundle).

I have a typescript/js background, but limited iOS experience.

I’ve looked over the documentation and couldn’t find anything that made sense from the Cocoa Pods perspective.

I’ve also seen https://github.com/NathanWalker/nativescript-square, but the documentation is links straight to square’s, so I have no idea how to use it (although it is made by @wwwalkerrun, so maybe it works?).

Anything from a youtube video of someone making and explaining how to use a cocoa pod library, an explanation, or even a sample plugin would help.

Thanks!


#2

Hi @fchack93 - I cover a lot of details in this course:
https://egghead.io/courses/use-objective-c-swift-and-java-api-s-in-nativescript-for-angular-ios-and-android-apps
Since the process is rather detailed, it’s hard to reiterate in a post answer.
There’s some other resources like this:
https://nativescripting.com/course/nativescript-plugins-creating-custom-view-components
Which also covers some CocoaPod integration but the egghead course is more detailed.

There’s nothing implemented here: https://github.com/NathanWalker/nativescript-square - it was a placeholder on a TODO list of mine for when I can get to it. Excited to build that but have not had the time thus far. Exciting you may try the integration. Feel free to create a new plugin for that using this seed:
https://github.com/NativeScript/nativescript-plugin-seed
To set things up for yourself. If you got it going, I would delete my repo since it would no longer be needed :slight_smile: