Skip to content

Instantly share code, notes, and snippets.

@johnptoohey
Forked from adeel/push-notifications.clj
Created July 4, 2013 19:57
Show Gist options
  • Select an option

  • Save johnptoohey/5929909 to your computer and use it in GitHub Desktop.

Select an option

Save johnptoohey/5929909 to your computer and use it in GitHub Desktop.
; 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