plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

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

Open smartdevelopers-ir opened this issue 2 years ago • 0 comments

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.

  • [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • [x] My PR includes unit or integration tests for all changed/updated/fixed behaviors (See [Contributor Guide]).
  • [x] All existing and new tests are passing.
  • [x] I updated the version in pubspec.yaml and CHANGELOG.md.
  • [x] I updated/added relevant documentation (doc comments with ///).
  • [x] The analyzer (flutter analyze) does not report any problems on my PR.
  • [x] I read and followed the [Flutter Style Guide].
  • [x] 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).
  • [x] No, this is not a breaking change.

smartdevelopers-ir avatar Aug 10 '22 19:08 smartdevelopers-ir