Closed ladanazita closed 6 years ago
Tested end to end here: https://github.com/segmentio/analytics-test-apps/tree/firebase_staticLib
Steps to implement this solution:
Podfile
target 'AnalyticsIOSTestApp' do
pod 'Analytics'
pod 'Firebase'
pod 'Segment-Firebase/StaticLibWorkaround'
end
Run pod install
In your app, you will see that Pods > Segment-Firebase is empty.
Right click and Show in Finder
You will see the Classes > SEGFirebaseIntegration files. Drag and drop them into the top level of your iOS App Make sure Create groups is selected
Then update your bridging header:
#import "SEGFirebaseIntegrationFactory.h"
And follow the normal steps to import the integration into your AppDelegate.swift:
#import "SEGFirebaseIntegrationFactory.h"
config.use(SEGFirebaseIntegrationFactory.instance())
If the customer has to copy the files for this integration into their project, what purpose does pod 'Segment-Firebase/StaticLibWorkaround', :path => '../'
serve?
I think they could just copy those files and do pod 'Firebase'
and it would still work without pod 'Segment-Firebase/StaticLibWorkaround', :path => '../'
?
@f2prateek It's just convenient and still allows them to "pull in" the files from a Cocoapods pod install
vs navigating to the Github repo
Gotcha.
🎉 Congrats
Do we need the full pod 'Firebase'
or is pod 'Firebase/Core'
enough?
This workaround to Cocoapods Static Library/Framework.
The limitation occurs when an application is built in Swift, you are including
use_frameworks!
in your podfile, and are using a transitive dependency that is provided as a static library or framework.The current workaround (as outlined in this subspec) is to copy the integration code manually into your project, then depend on Firebase directly. Instead of importing the integration from our library you would import the integration from your local copy. This eliminates the transitive dependency from the App -> Segment-Firebase -> Firebase to App -> Firebase.
Tested with the following configurations
Without
use_frameworks!
With
use_frameworks!
CC @TeresaNesteby