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

Open app after accept call #157

Open
hatemragab opened this issue Jan 2, 2025 · 2 comments
Open

Open app after accept call #157

hatemragab opened this issue Jan 2, 2025 · 2 comments

Comments

@hatemragab
Copy link

hatemragab commented Jan 2, 2025

can i Open app after accept call from a notifiaction of call ?

  • platfrom android
    i have used code like
@pragma('vm:entry-point')
Future<void> onCallAcceptedWhenTerminated(CallEvent callEvent) async {
  print("--------------------------------------------------------");
  print("BK onCallAcceptedWhenTerminated $callEvent");
  print("--------------------------------------------------------");
    BgLauncher.bringAppToForeground(
    action: 'FBI-OPEN-UP',
    extras: {
      "title": "FBI OPEN UP",
      "message": "The FBI is open up!",
      "color": "#FF0000",
      "priority": "high",
      "visibility": "public",
      "notificationId": "1",
    },
  );
  BackgroundToForeground.bringToForeground();
  // the call was accepted
  const packageName = 'com.example.example';
  const intent = AndroidIntent(
    action: 'android.intent.action.MAIN',
    package: packageName,
    flags: <int>[Flag.FLAG_ACTIVITY_NEW_TASK],
    componentName: 'com.example.example.MainActivity',
  );
  await intent.launch();
}

all of this failed

@hatemragab
Copy link
Author

@TatankaConCube
please help

@CubeRomanMagellan
Copy link

please have a look at similar issue #113

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

No branches or pull requests

2 participants