Populate a ds_map with the information related to the first local notification queued.


GML Code Example


Argument Description
map The ds_map ID to use.

Returns: Real


This function will populate a pre-made ds_map with a series of key/value pairs for the first local push notification in the queue to be shown. It returns -1 if there are no notifications queued, or a real value otherwise representing the ID for the notification. This ID can then be used to cancel the notification using the function push_cancel_local_notification().

The ds_map will hold the following 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

NOTE: This function is limited to the iOS and Android target modules.

Example :

GML Code Example

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"
    ntf = push_get_next_local_notification(map);

The above code creates a ds_map and then requests data for the first available notification in the queue. If a notification exists, the map is populated and the code then checks the "data" key for a specific string. If the string is found, the notification is cancelled and moves on to check the next notification until all in the queue have been checked.

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here