Hello,
We are experiencing issues with the User Messaging Platform (UMP) in our Flutter app. Below are the details of the issue:
Framework: Flutter
Package: google_mobile_ads (version: ^4.0.0)
Environment: Production
Issue Description: We are encountering intermittent exceptions related to UMP, with error messages such as "Exception: Error making request." and "Exception: The server timed out." Approximately 5 to 10% of our users are facing this issue on a daily basis.
Stack Trace
Non-fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: Exception: The server timed out.
at FirebaseCrashlytics.recordError(firebase_crashlytics.dart:119)
at LandingScreenState._requestConsent.<fn>(landing_view.dart:101)
at UserMessagingChannel.requestConsentInfoUpdate(user_messaging_channel.dart:54)
Dart Implementation Details
_requestConsent(FirebaseAnalytics firebaseAnalytics, FirebaseCrashlytics firebaseCrashlytics) {
try {
// Production code
final params = ConsentRequestParameters();
ConsentInformation.instance.requestConsentInfoUpdate(
params,
() async {
if (await ConsentInformation.instance.isConsentFormAvailable()) {
ConsentForm.loadConsentForm(
(ConsentForm consentForm) async {
var status = await ConsentInformation.instance.getConsentStatus();
if (status == ConsentStatus.required) {
consentForm.show((formError) {
if (formError == null) {
firebaseAnalytics.logEvent(name: eConsentShown);
} else {
firebaseAnalytics.logEvent(name: eConsentNotShown);
}
});
if (mounted) {
firebaseAnalytics.logEvent(name: eConsentRequested);
}
}
},
(FormError formError) {
firebaseCrashlytics.recordError(
Exception('Message: ${formError.message} ErrorCode: ${formError.errorCode.toString()}'),
null);
},
);
}
},
(FormError error) {
firebaseCrashlytics.recordError(Exception(error.message), null);
},
);
} catch (error, stack) {
firebaseCrashlytics.recordError(error, stack);
}
}
Statistics:
On a particular day, we observed the following statistics, which seem contradictory to the above error:
eConsentShown: 3497
eConsentNotShown: 4
eConsentRequested: 3556
We requested consent for around 3556 users, but it was displayed for only 3497 users. On the same day, we recorded 164 instances of "Error in making request."
We would appreciate any insights or solutions to address this issue.
Thank you.