Just wondering if this module supports a broadcast to specific site users/device tokens?

I am looking at building a site where a user can select categories of messages they are interested in and then a push notification relating to that category can be pushed to only the users who have selected that category...

Comments

krem’s picture

Hi there,

There is another module on GitHub doing what you want but it is Drupal 6 only. I posted some (very simple) directions to make it work for Drupal 7, https://github.com/kostajh/Urban-Airship-API/issues/3 . Have a try ;)

Once installed you can use from your custom module the methods from urbanairship :

function mymodule_node_insert($node) {
	if($node->type == 'notification'){
		$notification = array('badge' => 1, 'alert' => 'test notification', 'sound' => 'default');
		json_encode($notification);
		urbanairship_api_broadcast($notification);
	}
}

Above is an example code to broadcast to all users a notification. I haven't implemented yet the call to send notifications to specific users but another function exists named 'urbanairship_api_push', which should do it.

I hope it helps ;)

Good luck,
Clem