sendNotificationToUser static method
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;
}