Skip to content

UMP Dialog fails to open in "add to app" scenario #1284

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rckrd-proguitar opened this issue Mar 18, 2025 · 3 comments
Open

UMP Dialog fails to open in "add to app" scenario #1284

rckrd-proguitar opened this issue Mar 18, 2025 · 3 comments
Assignees
Labels
platform-ios iOS applications specifically

Comments

@rckrd-proguitar
Copy link

The UMP dialog fails to open on iOS when the plugin is running in a Flutter module.

This is the same issue described in Issue #700, but it specifically affects the User Messaging Platform (UMP) dialog. When the UMP dialog is loaded and show is called, the plugin attempts to use the rootViewController. However, since Flutter is running as a module in a view controller that was pushed by the root view controller, the root view controller is no longer on top. As a result, it cannot present a new view controller.

The fix should be the same as the one used in Issue #700.

Here is the bug: (using a view controller that is not on top):
https://github.com/googleads/googleads-mobile-flutter/blob/main/packages/google_mobile_ads/ios/Classes/UserMessagingPlatform/FLTUserMessagingPlatformManager.m#L47

Error message:

"The provided view controller is already presenting another view controller"

Proposed fix (make sure to use the topmost view controller also for UMP dialogs):
https://github.com/googleads/googleads-mobile-flutter/blob/main/packages/google_mobile_ads/ios/Classes/FLTGoogleMobileAdsPlugin.m#L228

@malandr2 malandr2 added the platform-ios iOS applications specifically label Mar 18, 2025
@malandr2
Copy link
Collaborator

Hi @rckrd-proguitar thank you for flagging this. Before we make a fix, can you share a video or something reproducible of the issue you're encountering? To confirm the issue. Thanks.

@malandr2 malandr2 added the feedback required Further information is requested label Mar 19, 2025
@rckrd-proguitar
Copy link
Author

Hi @malandr2,

I've updated the MCVE for issue #700 to also demonstrate the problem with the UMP dialog:
https://github.com/rckrd-proguitar/googleads-mobile-flutter-issue-700

Here's a video of a run session using the example:
https://drive.google.com/file/d/1A9SPuxf-Esip6GZEwZP5YAP7me-atLil/view?usp=drive_link

As you can see, the UMP dialog does not appear. Instead, we encounter the following error:
"The provided view controller is already presenting another view controller."

@github-actions github-actions bot removed the feedback required Further information is requested label Mar 20, 2025
@malandr2
Copy link
Collaborator

Thanks @rckrd-proguitar, I've shared this with @LTPhantom to take a closer look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-ios iOS applications specifically
Projects
None yet
Development

No branches or pull requests

3 participants