isPushPlotline static method

Future<bool> isPushPlotline(
  1. Map<String, dynamic> remoteMessage
)

Checks whether a received FCM push payload is a Plotline notification.

Android only; returns false on every other platform. On iOS, push is integrated natively (AppDelegate / Notification Service Extension), where the app checks using the native PlotlinePush.isPushPlotline(request:) method directly, so this bridge is not required there. In the future, when FCM on iOS is supported, we can add this bridge method for iOS as well.

Implementation

static Future<bool> isPushPlotline(Map<String, dynamic> remoteMessage) async {
  if (defaultTargetPlatform != TargetPlatform.android) {
    return false;
  }
  try {
    final bool? isPlotlinePush =
        await plotlineChannel.invokeMethod<bool>('isPushPlotline', remoteMessage);
    return isPlotlinePush ?? false;
  } catch (e) {
    plotlineDebugLog("Error in isPushPlotline: $e");
    return false; // Default fallback
  }
}