I have a problem with notifications. I'm using Oracle apex with rest services.
How to send push notifications to APN iphone from pl/sql? Are you using Java in database?
I have a problem with notifications. I'm using Oracle apex with rest services.
How to send push notifications to APN iphone from pl/sql? Are you using Java in database?
We successfully implemented the solution in our java code with java-apns
You create a service:
InputStream resourceAsStream = Thread
.currentThread()
.getContextClassLoader()
.getResourceAsStream("Certificate.p12");
ApnsService service = APNS.newService()
.withCert(resourceAsStream, "CERTNAME")
.withProductionDestination()
.build();
Then you create a payload:
String payload = APNS.newPayload()
.sound("default")
.alertBody(generatePushMessageBody(...))
.customField("title", generateTitleForPushMessage(user))
.customField("startDate", formatDateForPushMessage(...)
.customField("username", user.getUserName())
.build();
And then send the push notification:
service.push(registrationId, payload);
You need to put this code to a PL/SQL stored procedure and it will work.