Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions audio_service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.18.19

* Fix onNewIntentListener always returns true (@relaxedSoul)
It prevents other plugins to handle new intents from the OS while the app is running.

## 0.18.18

* Fix setPlaybackState entitlement issue on iOS.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public void onAttachedToActivity(ActivityPluginBinding binding) {
// We do this to avoid using the old intent.
activity.setIntent(new Intent(Intent.ACTION_MAIN));
}
sendNotificationClicked();
handleIntent(activity.getIntent());
}

@Override
Expand Down Expand Up @@ -393,17 +393,17 @@ private void disconnect() {
private void registerOnNewIntentListener() {
activityPluginBinding.addOnNewIntentListener(newIntentListener = (intent) -> {
clientInterface.activity.setIntent(intent);
sendNotificationClicked();
return true;
return handleIntent(intent);
});
}

private void sendNotificationClicked() {
Activity activity = clientInterface.activity;
if (audioHandlerInterface != null && activity.getIntent().getAction() != null) {
boolean clicked = activity.getIntent().getAction().equals(AudioService.NOTIFICATION_CLICK_ACTION);
audioHandlerInterface.invokeMethod("onNotificationClicked", mapOf("clicked", clicked));
private boolean handleIntent(Intent intent) {
if (audioHandlerInterface != null && intent.getAction() != null) {
boolean handled = intent.getAction().equals(AudioService.NOTIFICATION_CLICK_ACTION);
audioHandlerInterface.invokeMethod("onNotificationClicked", mapOf("clicked", handled));
return handled;
}
return false;
}

private static class ClientInterface implements MethodCallHandler {
Expand Down
2 changes: 1 addition & 1 deletion audio_service/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: audio_service
description: Flutter plugin to play audio in the background while the screen is off.
version: 0.18.18
version: 0.18.19
repository: https://github.com/ryanheise/audio_service/tree/minor/audio_service
issue_tracker: https://github.com/ryanheise/audio_service/issues
topics:
Expand Down