这个函数以一系列键值对儿(key/value pairs)的形式返回一个 ds_map 作为本地通知队列中下一个被显示的通知。返回 -1 代表之后已没有通知,返回其他的真值为通知的ID。使用这个ID可以通过调用push_cancel_local_notification()来取消通知。You should call the function push_get_first_local_notification to get the first notification in the queue and then use this function to continue through it.
ds_map 将包含以下的键值对儿(key/value pairs):
- "title" - The title of the notification (this will only be available on the Android platform as iOS does not store the title information)
- "message" - The message body text
- "data" - The data package string
注意: This function is limited to the iOS and Android target modules.
push_get_next_local_notification(map);
参数 描述 map ds_map 的ID 。
Real(实数)
var map = ds_map_create();
var ntf = push_get_first_local_notification(map);
while(ntf >= 0)
{
var data = ds_map_find_value(map, "data");
if data == "Daily_Reward"
{
push_cancel_local_notification(ntf);
}
ntf = push_get_next_local_notification(map);
}
ds_map_destroy(map);
上面的代码创建了一个 ds_map ,然后请求数据队列中第一个可用的通知。If a notification exists, the map is populated and the code then checks the "data" key for a specific string. 如果找到该字符串,则通知取消,继续检查队列中的下一个通知,直到所有通知都被检查。