FCM doesn't wake up android device in Flutter

Viewed 381

I want to wake up the device after sending FCM notification. I was able to send notifications to android devices using admin sdk in Cloud Functions. However, I cannot wake up the device while it is locked(Only sounds come). Other apps, such as Gmai, can wake up the device. Also, it works fine on iOS.

Here are the codes in Cloud Functions.

try {
    const options = {
      priority: "high",
    };

    const payload: admin.messaging.MessagingPayload = {
      notification: {
        title: message.title,
        body: message.body,
        click_action: 'FLUTTER_NOTIFICATION_CLICK',
        badge: `${message.badgeNum}`,
      },
    };
    await admin.messaging().sendToDevice(message.fcmToken, payload, options);
  } catch (e) {
    console.error(e.message);
    throw e;
  }
0 Answers
Related