fix(android_alarm_manager_plus): Fix showIntent not being set correctly in setAlarmClock #2778
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The issue
Currently the android_alarm_manager_plus does not set the
showIntent
argument properly when setting an alarm clock usingsetAlarmClock
. According to android docs, this is supposed to set a pending intent that shows the user details of the alarm, or the ability to edit the alarm. This is usually done by launching the relevant app that set the alarm. This intent is used when the user clicks on the quick setting alarm tile, or most other system UIs showing the next alarm (notification are, lock screen etc.). In the image below, the alarm tile is in the bottom left.Currently,
showIntent
is set as the intent that triggers the alarm isolate. This means that whenever the user taps the above mentioned system UIs, the code inside the alarm isolate runs, which is not what was expected.The fix
This PR sets the
showIntent
such that it launches the app, as well as passing the alarmid
andparams
as extras to this intent. No new parameters have been added.These extras can be used by the app to direct the user to the relevant alarm, and the relevant screen. An example of how these extras can be used in the receiving dart code using the receive_intent package.
Related Issues
Fix #2766
Checklist
CHANGELOG.md
nor the plugin version inpubspec.yaml
files.flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?
!
in the title as explained in Conventional Commits).