FCM integration in IOS swift framework - ios

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.

Related

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.

Is that a good idea to keep CommunicationManager framework in my iOS project

I have an old iOS app where it is using Communication Manager framework to communicate with my server. Since communication framework library files architectures are 32bit and I can not change the app architecture to 64bit because of these lib files. So I removed the communication manager framework totally and added AFNetworking for this app.
In my other old app, it is also using communication manager framework but that app is not using those 32bit lib files directly. Project is finding these lib files by library search path, but it's not included in the project 'Linked Framework and Libraries' section. Somehow communication framework is using AFNetworking framework, which is also used in this 2nd project. And this project architecture is 64bit.
NOW, is that a good idea to remove the communication manager framework totally from my 2nd project as well and use AFNetworking or just keep it as it is since it is not causing any problem now and app architecture is 64bit. I know from next iOS release Apple is going to support 64bit architecture app only.
Note: I didn't develop any of these apps from scratch.

Could adding a framework to an iOS project block/hide access to other files in the project?

After adding the Dropbox SDK Framework to my Xcode project (iOS) my project fails to build due to errors shown in image 1 below:
Prior to adding the Dropbox Framework, or reverting to the previous commit, results in the project building and running with out issue. I have also tested the same Dropbox SDK Framework package in a seperate demo project to ensure it is not corrupted - and that demo project builds and runs just fine, accessing the Dropbox SDK as expected.
Is it possible that the Dropbox SDK Framework is hiding or blocking access to the GLKit Framework within my main project?
Or is there something else at play here? The second error shown in screenshot claims the bridging header also 'Failed to import' which is an error I have not seen before, usually it is 'not found'.
The Dropbox SDK Framework is being added by drag-and-dropping into Xcode and checking the copy if needed box. Immediately after adding the Dropbox SDK Framework the project no longer builds and reports these errors.
I am answering my own question for anyone else who might have similar problems. While I did not find the root cause of the problem, I did get around it with the following solution.
I ended up removing all third party frameworks from my project which were:
ResearchKit Framework
Dropbox SDK Framework
Charts Framework
And in addition I removed all the XCode supplied frameworks from the project in the left hand file list: 'Project Title -> General -> Linked Frameworks and Libraries'
I then installed and setup CocoaPods with the project, and used CocoaPods to install and manage my third party frameworks (ResearchKit, Dropbox SDK and Charts)
The project is now able to build and run successfully and has access to the GLKit framework along with all other XCode supplied frameworks, bridging header and Dropbox SDK.
I assume this issue was due to a setting in XCode that was preventing access to GLKit after the Dropbox SDK had been added, and using CocoaPods to manage the integration of the third party frameworks skirted this issue.
If anyone has any further insight I'd be very interested to hear you explanation.

Cocoa Touch Framework library - versions and memory distribution

I am going to create a Cocoa Touch Framework library and I am confused how they work on iOS. What would happen if there are different apps installed on a device that use different versions of that library?
Would each app has access to its own version of the framework or they will share some single version of it?
How would that single version would be determined then?
Logically thinking each app should own its own version, but I am not sure how frameworks and dynamic libraries work on iOS. Thanks for the help.

Packing a 3rd party framework into my own library/framework on iOS

I'm trying to build an SDK for other developers to use. On this SDK I'm using other 3rd parties frameworks.
I can deliver the SDK with the 3rd party Frameworks but I want the integration would be as simple as possible so it would be really nice if I could pack it all into one framework file.
I've succeeded to pack the device and simulator .a file using aggregate and lipo, But I can't find how to add 3rd party frameworks to this package.
Please help.
I've used this code:
https://github.com/kstenerud/iOS-Universal-Framework
Using "Fake Framework" solved all my problems!

Resources