How moengage/moengage-ios-sdk works
Main Components
• SDK Core: At the heart is the MoEngage-iOS-SDK module (and likely MoEngageCore.podspec) which manages the common functionalities required for various features.
• Feature Modules: You have several submodules indicated by separate podspec files and SPM directories. These include:
– Analytics: MoEngageAnalytics.podspec
– Cards: MoEngageCards.podspec and Sources/MoEngageCardsSPM
– Geofence: MoEngageGeofence.podspec and Sources/MoEngageGeofenceSPM
– InApps: MoEngageInApps.podspec and Sources/MoEngageInAppSPM
– Inbox: MoEngageInbox.podspec and Sources/MoEngageInboxSPM
– Messaging: MoEngageMessaging.podspec
– Real-Time Trigger: MoEngageRealTimeTrigger.podspec and Sources/MoEngageRealTimeTriggerSPM
– Rich Notification: MoEngageRichNotification.podspec and Sources/MoEngageRichNotificationSPM
– Security: MoEngageSecurity.podspec
– Trigger Evaluator: MoEngageTriggerEvaluator.podspec and Sources/MoEngageTriggerEvaluatorSPM
– Objective-C Utilities: MoEngageObjCUtils.podspec
• Supporting Utilities: The Utilities directory contains scripts (pod_publish.rb, post_build.rb, spec.rb) that handle build, testing, or deployment tasks.
• Documentation: The docs folder contains auto-generated documentation (using Jazzy judging by the filenames) along with packaged docsets.
• External Configuration: There’s also a GitHub workflows directory (.github/workflows) that shows CI/CD integration.
Relationships and Interactions
• The clients (iOS apps integrating the SDK) interact with the SDK’s public API provided by MoEngage-iOS-SDK.
• The core module likely exposes shared services such as event logging, API communication, and configuration management.
• The feature modules (Cards, Geofence, etc.) plug into the core, each handling distinct functionalities. They might internally communicate with the core module and, possibly, among themselves if there are shared dependencies.
• Build and packaging utilities ensure that both the CocoaPods and SPM distributions are built, tested, and published consistently.
Architectural Patterns
• Modularity: Emphasize that each functional area (cards, inbox, inapp, etc.) is separated, making it easier to maintain, update, or even swap out components.
• Multi-distribution: The project is designed for both CocoaPods and Swift Package Manager, so include notes about dual distribution channels.
• CI/CD and Automated Documentation: The inclusion of GitHub workflows and comprehensive docs suggest an automated dev and deployment process.
• Clear separation between API (public interfaces for integration) and internal implementations.
Relevant Technologies and Frameworks
• CocoaPods and SPM distribution methods.
• Likely native iOS frameworks (UIKit, Foundation) as dependencies.
• Automated documentation generators (Jazzy).
• Build automation scripts in Ruby (see the Utilities folder).