Skip to content

Instantly share code, notes, and snippets.

@edorcutt
Created September 1, 2010 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edorcutt/560954 to your computer and use it in GitHub Desktop.
Save edorcutt/560954 to your computer and use it in GitHub Desktop.
ruleset a169x92 {
meta {
name "iphone-push-notification"
description <<
Demo of iPhone push notification.
>>
author "Ed Orcutt http://edorcutt.org"
logging on
}
dispatch {
domain "example.com"
}
global {
}
rule send_notification is active {
select when pageview ".*" setting ()
http:post("https://username:apisecret@api.notifo.com/v1/send_notification") setting(resp)
with params = {
"title": "Greetings From Aculis",
"uri": "http%3A%2F%2Fwww.kynetx.com%2F",
"msg": "This is a demo of push notification from a Kynetx application"
}
and autoraise = "notification_response";
}
rule notification_response is active {
select when http post label "notification_response"
pre {
content = event:param("content");
status_code = event:param("status_code");
}
notify("notifo response", "(" + status_code + ") " + content)
with sticky = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment