Repository navigation
test: integration tests against the real Facebook SDK on emulator and simulator - #525
Merged
Merged
Conversation
.idea/, android/.idea/ and the .iml file are machine-specific, and because they were tracked they were also published to pub.dev. The local files stay on disk.
Meta retired Facebook Analytics in 2021; the pubspec description and podspec summary still named it.
A test checks that pubspec, podspec and the newest CHANGELOG entry agree on the version, that the Graph API pin is the same in Kotlin, Swift and the README, and that all three Facebook SDK ranges follow one major. The publish job also refuses a tag that differs from pubspec.
…stale runs - Dart checks now run on Flutter 3.41 (floor) as well as stable, with flutter analyze on both and a dart format check on stable. - A new push to a pull request cancels the runs of its older commits. - Runs on main queue instead of overlapping.
- iOS logPurchase and logProductItem passed any string to the SDK as a currency, while Android rejected unknown codes. iOS now validates against the ISO 4217 list and returns INVALID_ARGUMENT too. - Both platforms accept currency codes in any letter case; Android only accepted upper case. - Android logPushNotificationOpen failed on payload values a Bundle cannot hold (lists), while iOS accepted them. The SDK only reads the fb_push_payload string, so Android now leaves such values out.
Flutter 3.50 reports the example's package:flutter/material.dart import as a deprecation info. Its replacement is not available on the 3.41 floor, so infos cannot be fatal while both are supported.
Adds a cell that builds with the oldest Xcode expected to work with Facebook iOS SDK v19, plus a temporary probe on 26.3 that is expected to fail, to confirm where the floor is before documenting it.
plugin_test.dart drives the plugin inside the example app on a device: the deferred-initialization gate, getters, user data, events, purchases, product items, push payloads and the privacy toggles. sdk_start_failure_test.dart covers an Android SDK that failed to start (issue #516) and needs a build without the client token.
… platforms The iOS SDK subscripts the fb_push_payload entry as a dictionary and calls length on its campaign without checking types, so a JSON string (how FCM delivers the entry, and the form the Android SDK wants) raised an Objective-C exception and crashed the app. The iOS handler now parses a string entry and drops one it cannot bring into shape. The Android SDK reads the entry as a JSON string and ignored a nested map; the Android handler now serializes a map to JSON.
…ator The Flutter stable cells of the Android and iOS (SwiftPM) jobs now run example/integration_test on a device. The Android cell runs a second pass without the client token in the manifest, to cover an SDK that failed to start.
It failed as expected with the SDK's .swiftinterface parse errors, while the Xcode 26.4 cell built. The 26.4 cell stays.
DennisAlund
marked this pull request as ready for review
November 17, 2026 02:50
The earlier commit with this intent only added the .gitignore entries; the files themselves stayed tracked.
This was referenced Nov 17, 2026
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.
Stacked on #524, #523 and #522; merge those first.
Problem
Nothing executed the Kotlin and Swift handlers before release. The tests in
test/mock the method channel, and CI only compiled the native code. That is how issue #516 reached users, and why its fix (#518) was merged without ever having run.Change
example/integration_test/plugin_test.dart(13 tests) runs the plugin inside the example app, against the real Facebook SDK:initializeSdk(): iOS rejects calls withsdkNotInitialized, Android answers them,setGraphApiVersionworks on both;initializeSdk(), app id, anonymous id, flush behavior;invalidArgument(fix(native): iOS push payload crash, and currency/payload parity across platforms #523);example/integration_test/sdk_start_failure_test.dart(3 tests, Android) covers an SDK that failed to start, the situation in #516: calls reportsdkNotInitialized, andinitializeSdk()reportssdkInitializationFailedwith the SDK's reason.CI runs them in the existing Flutter stable cells:
The tests set the flush behavior to explicit-only first and never flush, so no test events are sent to Meta. Initializing the SDK still contacts Meta, as it does whenever the example app runs.
Result
First CI run on this PR: 13 passed on Android, 13 on iOS, 3 start-failure tests passed on Android. This is the first time the #518 behavior and the #523 changes have executed on a device.
Cost
The Android stable cell goes from about 5 to about 10 minutes, and the iOS SwiftPM stable cell gains a simulator build.
Limits
plugin_test.darttests.