Skip to content
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

Merged
merged 2 commits into from
Apr 17, 2022
Merged

Remove decide later button in explainer dialog #28

merged 2 commits into from
Apr 17, 2022

Conversation

untp
Copy link
Contributor

@untp untp commented Apr 17, 2022

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).

v7GokkrtuxKhV5lYTjfANyoi3Q3O1UlDTQBV.png

I updated readme, documentation and example code with this change.

@@ -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();
Copy link
Contributor Author

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 {
Copy link
Contributor Author

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.

@deniza
Copy link
Owner

deniza commented Apr 17, 2022

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.

@deniza deniza closed this Apr 17, 2022
@untp
Copy link
Contributor Author

untp commented Apr 17, 2022

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.

@deniza deniza reopened this Apr 17, 2022
@deniza
Copy link
Owner

deniza commented Apr 17, 2022

Thanks for the effort

@deniza deniza merged commit a44ac96 into deniza:master Apr 17, 2022
@untp untp deleted the custom-dialog branch April 17, 2022 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants