Add multiple shared modules to ios app with KMM - kotlin-multiplatform

Is there any opportunity to create two or more shared modules in KMM app and use it in ios app?
here is two kmm modules: shared and feature
for example can i create lib for each module(shared and feature) and add as frameworks in ios app via cocoapods
enter image description here

Related

How to embed local .xcframework to Flutter IOS plugin?

I'm totally new in IOS development, so I only have basic knowledge on how Pod/Podspec, but I don't really know how it works
Basically I have this flutter plugin project that uses external dependency in .aar(android) and .xcframework(iOS). I wanted to embed this .xcframework into my plugin, so I imported the file into my ios plugin directory, and add it in the Framework & Library in xcode.
But when I use the plugin in my app flutter project, the library in .xcframework is not recognized, unless I do the same thing again, which is importing the .xcframework file, and add it to Framework & Library in xcode...
I tried to set the Embed options to Embed & Sign and Embed without Signing, does not work!
Can I just embed the .xcframework in the plugin, so other project can simply add the plugin in the pubspec and works, just like .aar in Android library? Thank you

How to add a framework to iOS library project?

I have very little experience in native iOS development but my current job is to wrap some specific native iOS framework to use it in React Native.
Preliminary data: common React Native tools generate an empty iOS library project and an example iOS app project that utilizes this library.
First I've tried to add the needed framework directly to the example app using CocoaPods - and it works fine, the framework became a part of linked libPods.a file, then if I add
#import MyTargetFramework;
to AppDelegate.m I can access different methods of the framework from it.
Next I switched to my iOS library project, applied the same setup (created a Podfile, added the same pod MyTargetFramework to it), then added the same #import MyTargetFramework to *.m file - but got a build error:
Module 'MyTargetFramework' not found
Also I've noticed that there is no libPods.a for iOS library project, all the pods are merged to a Pods.framework instead.
So my question is - what am I doing wrong? Why does it work for iOS app project, but not for iOS library project? How can I properly link my target framework to my own iOS library? I've already spent some time googling, but found nothing about app vs lib differences from this point.

Distribute an iOS framework with 3rd party libraries

I'm currently developing a custom framework that makes use of different dependencies such as Moya, RxSwift, ObjectMapper etc. The only issue is that whilst developing the framework I set the search path to the Carthage folder so it knows where the files are when I'm developing the framework.
So the issue is when it comes to distribution because there are so many 3rd parties getting the user to download frameworks and/or link them themselves seems like a long task and I'm unable to distribute the framework via Carthage or CocoaPods.
So I'm currently looking for advice/guidance on how to distribute my own framework and embed these third parties within it whilst still being able to prevent duplicate symbols if the user includes the library within their project i.e. My framework uses RxMoya and the user adds RxMoya as a dependency within the project via Carthage, CocoaPods or manually.

FCM integration in IOS swift framework

how to do FCM integration in ios framework. I have did and tested in application but i want to do in framework so that i can sell to someone to use my code. The problem i'm facing when u create xcode project on touch framework you cannot enable APNS option. Can anypne get me out of this. Thank You
First thing is first:
As you already stated that, you've successfully integrated FCM into your cocoa touch library, here one thing i wanted to suggest.
If you're shipping your solution as framework to third party. I'm assuming you are using Cocoapod. Declare the Firebase related pods (which you are using) as Dependencies. Cocoapod will automatically manage this dependency tree. If you are preparing just plain framework and included Firebase related frameworks within it, it's wrong. Because the third party developer cannot update the Firebase related frameworks while new SDKs are released. Another thing that, the third party developer may use firebase's other services which required them to integrate firebase sdks within their app. In that case duplicate class declaration error may arise.
Enabling APNS
Yes you cannot enable APNS from capability for touch framework. Instruct your third party developer to enable required fields for their project. Include it in your integration guide or README.md what ever you are using to help third party developer integrating your cocoa touch framework.
From https://github.com/firebase/firebase-ios-sdk/blob/master/docs/firebase_in_libraries.md
Conclusions:
The Firebase SDKs may be used from an embedded dynamic framework in your project (e.g. for code reuse purposes) only when Firebase is not used from the app directly.
The Firebase SDKs should never be used from vendor dynamic frameworks because the version of Firebase compiled into the dynamic framework will conflict with the versions compiled into the app or included in any app bundles.
Conclusions:
Using the Firebase SDKs in static frameworks and libraries is safe, meaning there will be no symbol collisions, for both vendor and in-app internal libraries.
If the static framework is used from an app and its extensions, then it will be copied to each target, increasing the app download size.
If the static framework is used from an app and its dynamic dependencies, then it will be copied in both the app and its dependencies, which will result in undefined behavior.

iOS Framework which can support iOS7

I have very simple requirement for my iOS SDK
-Support iOS 7 and above.
-Include some swift code to my SDK
Problems:
-With iOS 8, Xcode allowed us to develop cocoa touch frameworks, but they can only be run on iOS 8 and above.
-If I create a static library, I cannot include swift code.
-I was using using Real Framework, but Real Framework does not get installed with Xcode 7.
So, What does a poor developer do ?
You can always have an alternative distribution method for your SDK for users that are targeting iOS 7.
You can offer an SDK in a single concatenated file, that is simply merging all your project source files, which user can drop into project tree and compile together with all the other source files. This applies only when you have either Swift-only or Objective-C only SDK
If SDK user uses workspaces, he may embed your SDKs .xcodeproj directly in his project
Anyway both methods require source code distribution as the user needs to compile the code from within his project. Dependency maintenance is also more difficult.
For a reference you can check how it is done in:
https://github.com/SwiftyJSON/SwiftyJSON
It is a Swift library, but integration with iOS 7 based projects is the same.
I could not find any solution for this. I compromised:
I am NOT using swift code.
I am distributing static library (.a file and a .h header file) instead of a framework. (this is to support iOS 7)

Resources