feat: add Objective-C wrapper for Facebook integration #9
+193
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds Objective-C compatibility to the Facebook Swift integration by introducing a wrapper class that exposes the existing
FacebookIntegrationto Objective-C projects. This allows Objective-C apps to seamlessly integrate Facebook App Events with RudderStack using the device mode integration.The wrapper class
ObjCFacebookIntegration(exposed asRSSFacebookIntegrationin Objective-C) provides a complete interface for track, identify, and screen events while maintaining proper error handling patterns expected in Objective-C code.Type of change
Implementation Details
ObjCFacebookIntegration.swiftcontaining the Objective-C wrapper classObjCIntegrationPluginandObjCStandardIntegrationprotocols from RudderStackAnalytics SDKinit()- Initializes the underlying FacebookIntegrationgetDestinationInstance()- Returns the Facebook App Events SDK instancecreateWithDestinationConfig:error:- Creates and configures the Facebook SDK with NSError-based error handlingupdateWithDestinationConfig:error:- Updates configuration with NSError-based error handlingreset()- Clears user ID and user data from Facebook App Eventstrack:- Processes track events by converting ObjCTrackEvent to TrackEventidentify:- Processes identify events by converting ObjCIdentifyEvent to IdentifyEventscreen:- Processes screen events by converting ObjCScreenEvent to ScreenEvent@objc(RSSFacebookIntegration)attribute to expose the class with a user-friendly name in Objective-CChecklist
How to test?
Breaking Changes
None. This is a purely additive change that does not affect existing Swift implementations.
Maintainers Checklist
Screenshots (if applicable)
N/A - No UI changes
Additional Context