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

feat(android_alarm_manager_plus): we can now send extra data to alarm manager and receive it in our callback #1014

Merged

Conversation

smartdevelopers-ir
Copy link
Contributor

Description

Now we can send extra data to alarm manager as Map and also we can receive them in our function callback. For example we can do this :

AndroidAlarmManager.oneShot( Duration(minutes: interval), 25, alarmManagerCallback
      , allowWhileIdle: true, exact: true, rescheduleOnReboot: true,
      params: <String,dynamic>{
    "title":alarmModel.title,
    "message":alarmModel.subTitle,
      });

and in our alarmManagerCallback we can receive the extra params :

@pragma('vm:entry-point')
void  alarmManagerCallback(int id,Map<String,dynamic> params) async{
  print("alarm manager callback title is :${params["title"]}");
}

Related Issues

Issue 990

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process.

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
  • All existing and new tests are passing.
  • I updated the version in pubspec.yaml and CHANGELOG.md.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the [Flutter Style Guide].
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@miquelbeltran
Copy link
Member

Hey! Due to changes in our contributor guidelines, all PRs should now:

  • Have a title that follows the Conventional Commits format. e.g. feat(package_name)!: feature description
  • DO NOT modify the CHANGELOG.md or the version in the pubspec.yaml. This is going to be an automated process now.

We would ask you kindly to update the PR following these changes.

Thanks!

Copy link
Member

@miquelbeltran miquelbeltran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution, I understand what is the goal this new feature is trying to accomplish, but I am not sure if the implementation will open for a lot of more bugs (and alarm_manager_plus is already very unstable unfortunately).

Now on the main branch there are integration tests for alarm_manager_plus. I'd like to ask you to merge main into your working branch and give it a go at adding new integration tests that cover this new functionality.

…plus.dart

Co-authored-by: Joachim Nohl <43643339+nohli@users.noreply.github.com>
@nohli nohli changed the title feat(android_alarm_manager_plus) : we can now send extra data to alarm manager and receive it in our callback feat(android_alarm_manager_plus): we can now send extra data to alarm manager and receive it in our callback Oct 15, 2022
smartdevelopers-ir and others added 9 commits October 16, 2022 00:50
…_test.dart

Co-authored-by: Joachim Nohl <43643339+nohli@users.noreply.github.com>
…plus.dart

Co-authored-by: Joachim Nohl <43643339+nohli@users.noreply.github.com>
…plus.dart

Co-authored-by: Joachim Nohl <43643339+nohli@users.noreply.github.com>
…plus.dart

Co-authored-by: Joachim Nohl <43643339+nohli@users.noreply.github.com>
…plus.dart

Co-authored-by: Joachim Nohl <43643339+nohli@users.noreply.github.com>
…plus.dart

Co-authored-by: Joachim Nohl <43643339+nohli@users.noreply.github.com>
Copy link
Member

@nohli nohli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A little nit-picking, but in my opinion the code style should be consistent. Plus the method name that has a typo and could be improved and the test description.

Thanks for fixing, I think we can merge very soon 🙏🏽🥳

@nohli nohli merged commit 5272c94 into fluttercommunity:main Oct 20, 2022
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.

4 participants