segmentio / analytics-ios

The hassle-free way to integrate analytics into any iOS application.
https://segment.com/libraries/ios
MIT License
399 stars 334 forks source link

Internal classes in SPM #1053

Closed miquelalvarado closed 1 year ago

miquelalvarado commented 1 year ago

Hi,

Currently we are trying to migrate our dependencies from Cocoapods to SPM. During the process to migrate Segment sdk to SPM's we've discovered that some classes previously accessible (SEGState and FileStorage), now are no longer accessible with SPM. We need to access those classes to be able to modify and save a new annonymousId under certain GDPR scenarios. Without that we cannot complete the transition to SPM. Would you consider exposing those classes or would you accept a PR doing that change?

Thank you

cc/ @bsneed

miquelalvarado commented 1 year ago

@bsneed Any chance you (or a teammate) consider this issue? 🙏

Thanks!

bsneed commented 1 year ago

Hi @miquelalvarado, I recommend you move to Analytics-Swift. It should be a very easy migration for you. If you can do that, let me know and I can make any changes needed for your use-case there. Is this a possibility?

miquelalvarado commented 1 year ago

Hi @bsneed and thank you for your response. I would really like to migrate to the Swift version of the SDK but sadly i don't see this happening anytime soon. The migration would be more complex than you would think since we had to build several pieces around our Segment wrapper to adjust to some specific GDPR related use cases. Migrating would mean to ensure that those pieces still work in the Swift version and that some others don't get broken. That's why we would need for now and for the sake of the dependency manager migration to just be able to access the same classes/methods as we were being able to with the ObjC version.

bsneed commented 1 year ago

@miquelalvarado no problem! The libraries are largely compatible with each other at call points. The configuration is slightly different, and middleware from analytics-ios is accomplished via plugins in Analytics-Swift. GDPR is important to us, so I'm happy to dive in with you and make any changes on our end to accomplish the goal.

In the meantime if you're unable to do that, I'd recommend making a fork of Analytics-iOS and making any changes you need there. That library is going to be End-of-life soon, and is already on a "fix critical issues only" list internally, but those rarely pop up.