feat: SDKE-608 iOS to Flutter initialization signaling#56
Draft
denischilik wants to merge 5 commits intodevelopmentfrom
Draft
feat: SDKE-608 iOS to Flutter initialization signaling#56denischilik wants to merge 5 commits intodevelopmentfrom
denischilik wants to merge 5 commits intodevelopmentfrom
Conversation
- Update minimum iOS version from 12.0 to 13.0 - Required for compatibility with mParticle-Rokt and Rokt-Widget dependencies
- Add EventChannel in iOS (AppDelegate.swift) to notify Flutter when mParticle is initialized - Subscribe to mParticleDidFinishInitializing notification in native layer - Listen for initialization events in Flutter (main.dart) before using mParticle SDK - Add proper cleanup in dispose method This allows Flutter to wait for mParticle initialization from iOS native layer before making SDK calls.
- Add prerequisites section (Flutter SDK, Xcode, CocoaPods, iOS 13.0+) - Add step-by-step setup instructions for Flutter installation - Add iOS dependencies installation steps - Document configuration changes (iOS deployment target update) - Add troubleshooting section for common issues - Include instructions for running on iOS simulator and device
Contributor
Author
|
That is Example app update to show how we can wait until sdk will be fully initialized |
Contributor
Author
|
Do not merge |
- iOS: Use EventChannel-based signaling from native layer - Android/other platforms: Use direct initialization with null check - Add isInitialized flag in AppDelegate to handle late subscriptions - Add debug logging for initialization events
0f0207b to
b4dad6a
Compare
thomson-t
approved these changes
Nov 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Background
Flutter layer needs to wait for mParticle SDK initialization from iOS native layer before making SDK calls. Implements EventChannel-based signaling mechanism to notify Flutter when mParticleDidFinishInitializing fires.
What Has Changed
Checklist
Additional Notes
POC implementation for initialization synchronization pattern between native iOS and Flutter layers.
Integration Guide: iOS-Flutter EventChannel for SDK Initialization
iOS (Native Layer) - AppDelegate.swift
Add FlutterStreamHandler protocol to your AppDelegate
Create variables for EventSink and initialization flag
Register EventChannel in didFinishLaunchingWithOptions
Subscribe to SDK initialization notification
Implement FlutterStreamHandler methods
Handle notification and send event to Flutter
Flutter Layer - main.dart
Create EventChannel with the same name
Create subscription variable and initialization flag
Add platform check and subscribe to events
Unsubscribe from events on dispose
Use _isInitialized flag to block UI or SDK calls until initialization completes
Result
Flutter layer will now wait for actual SDK initialization from native iOS layer before using SDK methods.
Reference Issue (For employees only. Ignore if you are an outside contributor)