plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[Request]: Add support for background activity launch

Open dimiltagline opened this issue 3 months ago • 0 comments

Plugin

android_intent_plus

Use case

targeting Android 15 or higher will default to no longer implicitly granting background activity launch (BAL) privileges to PendingIntents they create. Explicit opt-in is required

due to this activity launch fails without any error, there should be way to opt in for BAL, native android allows it using:

val options = ActivityOptions.makeBasic()
options.setPendingIntentBackgroundActivityStartMode(
    ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOW_ALWAYS
)
context.startActivity(intent, options.toBundle())

Proposal

final AndroidIntent intent = AndroidIntent(
    action: '....',
    data: '....',
     /// Add option to pass 
    backgroundActivityStartMode: ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED
  );
  await intent.launch();

dimiltagline avatar Sep 26 '25 10:09 dimiltagline