Created
September 1, 2010 16:28
-
-
Save edorcutt/560954 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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:[email protected]/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