PLSQL Apple推送notifiactions [英] PLSQL APPLE push notifiactions
本文介绍了PLSQL Apple推送notifiactions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有通知的问题。
我使用的Oracle APEX休息服务。
I have a problem with notifications. I'm using Oracle apex with rest services.
如何从PL / SQL发送推送通知APN iphone?
您是否使用的数据库中的Java?
How to send push notifications to APN iphone from pl/sql? Are you using Java in database?
推荐答案
我们成功实施具有的 Java的APNS
We successfully implemented the solution in our java code with java-apns
您创建一个服务:
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);
您需要把这个code到A PL / SQL存储过程中,它会正常工作。
You need to put this code to a PL/SQL stored procedure and it will work.
这篇关于PLSQL Apple推送notifiactions的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文