Created
July 26, 2011 01:03
-
-
Save adeel/1105682 to your computer and use it in GitHub Desktop.
Example of sending Apple push notifications with Clojure.
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
; Depends on [com.notnoop.apns/apns "0.1.6"]. | |
(:import ('com.notnoop.apns APNS)) | |
(defn send-push-notification [device-token message] | |
(let [service (.build (.withSandboxDestination | |
(.withCert (APNS/newService) "resources/apns-dev-cert.p12" "password"))) | |
payload (.build (.alertBody (APNS/newPayload) message))] | |
(.push service device-token payload))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
good times with
alertBody