Full screen not working
Closed this issue · 2 comments
Hi, you wrote this below a year ago. However, I tried it, and I expected a full screen native activity to appear when a background FCM notification is received but it just shows the normal drop-down notification and you have to tap on a button to see the full screen native activity.
How can a full screen activity be displayed when a background FCM notification is received? Thanks
Your message:
- Add the full screen intent permission
-
Add the activity to the Android Manifest:
<activity android:name=".IncomingCallActivity" android:exported="true" android:showOnLockScreen="true" />
-
Build the activity that will be showed when displaying the call. I used Android Studio for this.
public class IncomingCallActivity extends Activity ...
-
Trigger showing the screen, this can be done from a background isolate (e.g. Firebase handleBackgroundMessage as well!)
await CallKeep.displayCustomIncomingCall(
'com.yourcompany.yourapp', // Change this
'IncomingCallActivity',
icon: 'notification_icon', // Make sure you have this icon in your assets
extra: <String, dynamic>{
// Here you can pass any key value pairs that you can read usinggetIntent().getStringExtra("key")
in the native activity
},
)
Hi @jenniestrongbow. The default behavior in Android 10 and up is to not show full screen notifications anymore unless the phone is locked. Do you get your full screen activity if you lock the phone?
Package has been significantly updated since this issue was last active, if the issue still presists please feel free to re-open.
But as Alek has explained, that's the intended behavior on Android.