-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: platform-viewsEmbedding Android/iOS views in Flutter appsEmbedding Android/iOS views in Flutter appsf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-iosiOS applications specificallyiOS applications specificallyteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
Steps to reproduce
Description
Rich media ads served through Google Ad Manager stop responding to click events after a ListView is scrolled, provided that the scroll starts from the ad widget. This issue occurs specifically in Flutter apps but does not appear in fully native iOS applications.
Steps to Reproduce
- Create campaign in GAM with provided ad code.
- Embed ad from Google Ad Manager inside a Flutter ListView.
- Ensure that text inside the ad is updated correctly when interacting with button inside the ad without scrolling the listview
- Scroll the ListView, starting the gesture from the ad widget.
- Try clicking the button with in the ad
Affected Platforms
✅ iOS (Flutter app & iOS platform views)
❌ Does not occur on fully native iOS apps
Observations
- Touchend event is not triggered on flutter app when touch is stopped. Once user taps background of the ad the touchend event is triggered.
- On fully native iOS app the touchend event is triggered once the user interaction stops.
Tested on
Flutter version: 3.29.0
Platform: iOS (18.4)
Expected results
Expected Behavior
- The text should update correctly when clicking the button in the ad (indicating that click event listener is triggered).
Actual results
Actual Behavior
- The ad’s click event listener no longer works after scrolling if the touch started on the ad widget.
- The issue also occurs when rendering the ad inside a Flutter plugin using a platform view on iOS.
Code sample
Test Ad Script for GAM campaign:
<script>
var newDiv = document.createElement('div');
var textSpan = document.createElement('span');
var newContent = document.createTextNode('Initial state');
textSpan.appendChild(newContent);
newDiv.appendChild(textSpan);
newDiv.appendChild(document.createElement('br'));
document.body.appendChild(newDiv);
var button1 = document.createElement('button');
button1.textContent = 'Example button';
button1.style.cssText = 'width: 200px; height: 100px; margin-bottom: 25px;';
newDiv.appendChild(button1);
button1.addEventListener('click', function () { textSpan.textContent = 'Clicked'; });
button1.addEventListener('touchstart', function () { textSpan.textContent = 'Touch Started'; });
button1.addEventListener('touchend', function () { textSpan.textContent = 'Touch Ended'; });
</script>
Screenshots or Video
Screenshots / Video demonstration
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.0, on macOS 14.2 23C64 darwin-arm64, locale fi-FI)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 15.4)
! CocoaPods 1.15.2 out of date (1.16.2 is recommended).
CocoaPods is a package manager for iOS or macOS platform code.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/to/platform-plugins
To update CocoaPods, see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.2)
[✓] VS Code (version 1.98.0)
[✓] Connected device (4 available)
! Device emulator-5554 is offline.
[✓] Network resources
! Doctor found issues in 1 category.joao-paulo-one, marcelokorjenioski, pastre, raj06665, Tiago-Rocha and 9 morejoao-paulo-one, pastre, NKjoep, jacssa and EArminjon
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: platform-viewsEmbedding Android/iOS views in Flutter appsEmbedding Android/iOS views in Flutter appsf: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-iosiOS applications specificallyiOS applications specificallyteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team