Notifications for iOS

The iRidium notification system MUST NOT be used as the main one! iRidium notifications about important and potentially dangerous situations can be used as an auxiliary system to SMS, e-mail, notifications of the security system, etc.

At the moment notifications for the background mode (minimized or closed application) are not supported.

1. Notify about disconnecting from equipment (Offline)
/***** online notification ****/
IR.AddListener(IR.EVENT_OFFLINE, IR.GetDevice("My Driver"), function() 
{
	IR.GetItem("Page 1").GetItem("Item 1").Text = IR.GetVariable("System.Time.24") + " System Offline";  // notification
	IR.GetItem("Page 1").GetItem("Item 1").GetState(0).TextColor = 0xFF0000FF;  // text color
});
3. Automatic opening of the popup when activating a channel
/***** event notification (Tag Change) ****/
var old_value1 = -1;  // do not show notification if the previous state is the same  
var old_value2 = -1; 

IR.AddListener(IR.EVENT_START, 0, function()
{
	IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetDevice("My Driver"), function(name, value)
	{
	if (name == 'Channel 10' && value == 1 && value != old_value1){ // Check the Value = 1 in Feedback "Channel 10"
		IR.ShowPopup("Notify_danger");
		IR.GetItem("Popup 1").GetItem("Item_Display").Text = IR.GetVariable("System.Time.24") + " Lamp in Garden broken";  
		old_value1 = value;  
	}

	else if (name == 'Channel 10' && value == 2 && value != old_value2){  // Check the feedback "Channel 10'"
		IR.ShowPopup("Notify_important");
		IR.GetItem("Popup 1").GetItem("Item_Display").Text = IR.GetVariable("System.Time.24") + " Lamp in Garden Response Failed. Please Check";  
		old_value2 = value;
	}  
});
4. Play a sound at channel activation
/***** event notification (Tag Change) ****/
IR.AddListener(IR.EVENT_START, 0, function()
{
	IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetDevice("My Driver"), function(name, value)
	{
	if (name == 'Channel 11' && value == 1){ // Check the Value = 1 in Feedback "Channel 11"
	IR.PlaySound('BEEP1.WAV',1,70); // Play Sound ('name',slot,volume)
	IR.GetItem("Page 1").GetItem("Item 5").Text = IR.GetVariable("System.Time.24") + " Incoming Call";  
}  
});

Is this article helpful for you?