sendNotificationToUser static method

Future<void> sendNotificationToUser(
  1. IdType type,
  2. String id,
  3. String title,
  4. String content, {
  5. String? bigTitle,
  6. String? bigContent,
  7. String? imageUrl,
  8. String? iconUrl,
  9. String? notificationIcon,
  10. dynamic customContent,
})

Sending notification from this device to another device which is registered as a user of this app. type is the type of unique id which you are passing id is the id of the type type title is the title of the notification content is the content of the notification bigTitle is the complete title of the notification bigContent is the complete content of the notification imageUrl is the url of the image which notification can contain iconUrl is the url of the notification icon customContent is the custom json you send along with the notification message which can be received as the notification customContent in the target device

Implementation

static Future<void> sendNotificationToUser(
    IdType type, String id, String title, String content,
    {String? bigTitle,
    String? bigContent,
    String? imageUrl,
    String? iconUrl,
    String? notificationIcon,
    dynamic customContent}) async {
  if(!Platform.isAndroid) return;
  String idType = type.toString();
  await _channel.invokeMethod('Pushe.sendUserNotification', {
    "type": idType,
    "id": id,
    "title": title,
    "content": content,
    "bigTitle": bigTitle,
    "bigContent": bigContent,
    "imageUrl": imageUrl,
    "iconUrl": iconUrl,
    "notifIcon": notificationIcon,
    "customContent": jsonEncode(customContent)
  });
  return;
}