4

I'm trying to send a push notification to apple device (iphone) using Scala, and Notnoop APNS, but when i ran this code:

import com.notnoop.apns._
val service = APNS.newService().withCert("certfile.p12", "passphrase").withAppleDestination(true).build()

service.start()

val payload = APNS.newPayload().alertBody("nomnomnom").sound("default")

service.push("deviceToken", payload.build())

service.stop()

i always stuck on this, ssl handshake error:

Thread-20, handling exception: javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

based on this question, i may have invalid certificate, but I'm sure this certificate works, because using this PHP sample, i can send a push notification correctly.

Any idea where's my process gone wrong?

Community
  • 1
  • 1
chipz
  • 704
  • 1
  • 6
  • 11

0 Answers0