-
Notifications
You must be signed in to change notification settings - Fork 28
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
Remove decide later button in explainer dialog #28
Conversation
@@ -17,39 +25,32 @@ class _HomePageState extends State<HomePage> { | |||
@override | |||
void initState() { | |||
super.initState(); | |||
// Can't show a dialog in initState, delaying initialization | |||
WidgetsBinding.instance!.addPostFrameCallback((_) => initPlugin()); | |||
initPlugin(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WidgetsBinding.instance!.addPostFrameCallback
is not necessary, awaiting AppTrackingTransparency.trackingAuthorizationStatus
already delays showCustomTrackingDialog
.
} | ||
|
||
// Platform messages are asynchronous, so we initialize in an async method. | ||
Future<void> initPlugin() async { | ||
// Platform messages may fail, so we use a try/catch PlatformException. | ||
try { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PlatformException can not occur, because we are not using any result(FlutterError(...))
statement in platform code. System exceptions crashes the app, so flutter framework can not handle them to return PlatformException.
Hi, @untp I published an updated version to pub.dev just before realizing your PR. It seems that we both did nearly the same minor modifications. Thank you. |
I also removed PlatformException check and WidgetsBinding.instance!.addPostFrameCallback, because they are not needed. You can reopen this PR for these changes if you want. |
Thanks for the effort |
Apple does not allow Decide later button in explainer dialog (#27). Also Google updated their guide to include only a Continue button (https://support.google.com/admob/answer/10115027?hl=en).
I updated readme, documentation and example code with this change.