Closed samatzp closed 2 years ago
Hm, I don't think you can show a form when consent is not required.
But for testing and debugging, you can use ConsentDebugSettings
:
await UserMessagingPlatform.instance.requestConsentInfoUpdate(
ConsentRequestParameters(
debugSettings : ConsentDebugSettings(
geography: DebugGeography.EEA,
),
),
);
Also, see the docs for ConsentDebugSettings.testDeviceIds.
I tried without and with VPN
Below is the code that I am using:
try {
var info = await UserMessagingPlatform.instance
.requestConsentInfoUpdate(ConsentRequestParameters(
debugSettings: ConsentDebugSettings(
geography: DebugGeography.EEA,
testDeviceIds: ['MyDeviceId']
)));
print(info.consentStatus);
print(info.formStatus);
//error
var test = await UserMessagingPlatform.instance.showConsentForm();
print(test.consentStatus);
print(test.formStatus);
}catch (err){
print('Error tt');
print(err);
}
In that case, I'm not sure what's the problem. Just to make sure, did you configure messages in AdMob under Privacy & messaging?
Yes
But Approval status is --> Getting ready Could this affect?
Work after --> Approval status = Ready Thanks!
Thanks for the update! Glad it worked itself out.
D/HwDragEnhancementImpl(21763): Start long press for hw drag enhancement.
D/WebViewDragEnhancement(21763): dragReset.
D/WebViewDragEnhancement(21763): dragReset cacheSize = 0
V/AudioManager(21763): querySoundEffectsEnabled...
I/AudioManager(21763): querySoundEffectsEnabled fail id: 0
W/UserMessagingPlatform(21763): No available form can be built.
E/flutter (21763): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: FormException(message: No available form can be built., code: FormErrorCode.invalidOperation)
E/flutter (21763): #0 UserMessagingPlatform.showConsentForm (package:user_messaging_platform/user_messaging_platform.dart:375:7)
E/flutter (21763): <asynchronous suspension>
E/flutter (21763):
When I get an error using the official demo, how do I solve it?
Hi! Thanks for package!
I have with problem showing consent form
consentStatus = ConsentStatus.notRequired formStatus = FormStatus.unavailable
Error: FormException(message: No available form can be built., code: FormErrorCode.invalidOperation)