Urgent.News

What's breaking now, across thousands of outlets.

Tech

Meta App Events in Flutter for iOS: Setup, Tracking, and Attribution

I had already added Meta App Events to the Android side of a Flutter booking app. Getting the same booking funnel onto iOS required more than copying the Dart calls: iOS needs its own native SDK, app delegate setup, URL handling, and privacy configuration. The app uses a Flutter MethodChannel for both mobile platforms, but the iOS side maps those calls to Meta's native Swift SDK. First, line up…

Meta App Events are being integrated into a Flutter booking app on iOS. The Android side already had Meta App Events set up, but the iOS implementation required a native SDK, app delegate setup, URL handling, and privacy configuration. The Flutter app uses a MethodChannel for calls on both platforms, but iOS maps those calls to Meta's native Swift SDK.

To set up Meta App Events on iOS, the iOS app ID and Client Token must be obtained from Meta for Developers. The Bundle ID of the iOS app must match the Runner target in Xcode. CocoaPods is required for the iOS plugins and Meta SDK. An iPhone simulator or device is needed for testing.

The Meta iOS Core SDK is installed with CocoaPods in the Runner target. The Podfile specifies the FBSDKCoreKit dependency and runs pod install. Info.plist is configured with the Meta App ID, display name, and Client Token. The Client Token is retrieved from the .env file and copied into the built app's Info.plist. The app register the Meta URL scheme and query schemes for SDK callback URLs.

The SDK is initialized in AppDelegate.swift, setting the Graph API version and activating the app delegate. App Events are activated in the applicationDidBecomeActive method of the app delegate. Automatic app-event logging is disabled, so the SDK must be activated manually.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Friday 20 November →