appcelerator module for existing ios project sdk - ios

I want to use into my titanium project the functionalities provided by an existing sdk (deezer sdk).
I know I must deal with modules, so I found a lot of tutorials that explain well how to create a titanium module from scratch. But I didn't find something about to explain how to "wrap" an existing ios project within a titanium module. I just need the login/signup functionality and to retrieve the logged user (functionalities provided by the deezer ios sdk, of course).
can anybody help me on how to proceed?
thanks in advance
Dario

After creating the vanilla module, you have to include the framework you are wrapping (so deezer SDK) inside the bundle. Then follow these steps to add the framework to the compiler directives. Essentially you just add this:
OTHER_LDFLAGS=$(inherited) -framework DeezerSDK
To the module.xconfig file. Just check what the exact name is of the SDK.
After that, you can use the DeezerSDK just like you would in regular native Xcode development.
EDIT:
If the library is just a *.a file, then you can model what Titanium did for the Google Admob module. Its best to just inspect their project, bt essentially all that you need to do is create the vanilla titanium module, drop in the *.a file, and the headers, and then use it just like a native project.

Related

How to include libsignal-protocol-c in my Swift iOS app?

I would like to write something like import SignalProtocol at the top of one of my Swift files and then be able to call the C functions from libsignal-protocol-c.
libsignal-protocol-c's README says: "When integrating into actual applications, you should not need anything beyond CMake. Alternatively, you may integrate the code using a build system of your choice."
I think I'd like to use the Swift Package Manager to integrate libsignal-protocol-c into my Swift iOS app. Is there a way to automatically generate a manifest file, ie, Package.swift, and a module map, ie, a module.modulemap file, from libsignal-protocol-c's CMake files? Or if I need to create these files manually, what should they include? Otherwise, how would I do this with CMake?
How to import and use libsignal-protocol-c in an existing .xcodeProj? is a similar question but for Objective-C projects.
I'm not sure its an answer but I'm going to start using https://github.com/christophhagen/LibSignalProtocolSwift. Seems like a good start.

How to manage dependencies' conflicts between a framework that I'm making and the main app?

I'm making a framework (an SDK) that will be made public. I'm thinking about a situation when it's not distributed via Cocoapods / Carthage, but rather via a simple Downloads page.
In the SDK I need to provide users an opportunity to login and share via Facebook, so I would like to use appropriate Facebook SDKs (FBSDKLoginKit / ShareKit, I assume). But if the end user of my SDK will also have these Facebook SDKs (or any other duplicate dependency), there will be a conflict.
What is the proper way to handle this situation without using Cocoapods / Carthage? I believe, one way is to avoid including / statically linking dependencies into my framework, but rather have end users download dependencies separately, but maybe there is another way around it? Making people download tons of libs from different sources isn't very convenient.
The question isn't about Facebook SDKs in particular, but about a general situation with third-party dependencies when developing a framework / library.
P.S. I found this question: Integrate Facebook SDK inside my iOS Framework. But it's specifically about Facebook, and it might be outdated (a lot of stuff happened in the iOS world since 2014).
UPDATE: the SDK will be closed source.
You could do a combination of the two ideas you suggested:
Don't include the other SDKs directly in your framework, but have them in the same project when the user downloads it. That way, if the user doesn't already have them, they can copy over all of the frameworks that they need. And if the user does already have them, then they can just copy your SDK by itself and have it just work in their project.
This combination also allows you to include tests and samples in the download. Then users end up downloading a complete, functioning project that they can try out before integrating it with their own code.

Module support in iOS Static Library

I have multiple static iOS libraries (Objective-C) that I would like to add module support to.
By that I mean the use of #import statements instead of needing to use a bridging header to support swift.
Facebook, and Parse have recently added this feature to their SDKs but I can't find any documentation as to how they did it. Keep in mind that these SDKs STILL target iOS 7 so they are not simply dynamic frameworks (which would only support iOS8).
Can anyone explain exactly how I can go about doing this?

iOS: Duplicate interface definition for class 'EAGLView'

I am developing an iOS project where i'm using Cocos2d,3d and also Augmented reality based Metaio SDK Metaio SDK link in an iOS project.
This Metaio integration uses a file EAGLView.mm and EAGLView.h. Cocos2d is already having EAGLView.m and EAGLView.h. If i build, i get
`Duplicate interface definition for class 'EAGLView'`
How can i make both files working in this project? Please advise!
Thank you!
You can refractor one of the class names. I think the would be the quickest, easiest way. Xcode has an option similar to ^click>refractor and choose name.
I also recommend saying yes, when Xcode asks you if you want to take a snapshot of the project first, just in case.

iOS Facebook SDK: show progress of received data with FBURLConnection

I'm using the Facebook-SDK to make some FQL queries. Now I want to know how much of the requested data has already been transferred to the app to visualize the loading process in a progressbar.
So I used this https://github.com/nyankichi820/FBRequestConnection-FBRequestConnection_progress plugin which extends the FBURLConnection class to provide the progress of a data transfer.
The problem is, that I included the Facebook-SDK as an XCode framework into the project and the header file FBURLConnection.h which is necessary for the plugin is not published in the framework and cannot be found.
So how can I include the header file FBURLConnection.h into the frameworks visible headers so that I can access it? I dont't want to include all the FB-SDK files, I wanted to do this by relying on the XCode framework structure. Thanks in advance.
You should probably include the source of the framework yourself manually or much more simply using cocoapods.
Here is the github link to the SDK source: https://github.com/facebook/facebook-ios-sdk
The official cocoapod is named "Facebook-iOS-SDK", if you decide to go that route. I recommend doing this as it is much simpler to install the SDK and update it later on. Cocoapods are very nice for external components in general and will almost certainly save you time and frustration in the long run.

Resources