GSM Notification Data
Sử dụng các api để lấy được các data của push notification được gửi kèm khi push từ trên GSM
Last updated
Sử dụng các api để lấy được các data của push notification được gửi kèm khi push từ trên GSM
Last updated
public static void GetNotificationDatas(Action<List<NotificationDataItem>> onSuccess, Action<long, string> errorCallBack = null)GSMNotificationData.GetNotificationDatas((items) =>
{
//Hiển thị hoặc xử lý dữ liệu các notification
items.ForEach(item =>
{
Debug.Log($"id: {item.id}");
Debug.Log($"title: {item.title}");
Debug.Log($"body: {item.body}");
Debug.Log($"imageUrl: {item.imageUrl}");
Debug.Log($"data: {item.customData}");
});
}, (statusCode, error) => {
//Xử lý khi có lỗi
});public static void ClaimNotificationData(string notificationId, Action<NotificationDataItem?> onSuccess, Action<long, string> errorCallBack = null)GSMNotificationData.ClaimNotificationData(<Id Notification>, (notificationData) =>
{
if (notificationData != null)
{
//Xử lý data
}
}, (statusCode, error) =>
{
//Xử lý khi có lỗi
});public static void ClaimNotificationDatas(string[] notificationIds, Action<List<NotificationDataItem>> onSuccess, Action<long, string> errorCallBack = null)GSMNotificationData.ClaimNotificationDatas(new string[] { <notificationId1>, <notificationId2>,<notificationId3> }, (items) =>
{
//Hiển thị hoặc xử lý dữ liệu các notification
items.ForEach(item =>
{
Debug.Log($"id: {item.id}");
Debug.Log($"title: {item.title}");
Debug.Log($"body: {item.body}");
Debug.Log($"imageUrl: {item.imageUrl}");
Debug.Log($"data: {item.customData}");
});
}, (statusCode, error) =>
{
//Xử lý khi có lỗi
});