PLSQL APPLE push notifiactions

淺唱寂寞╮ 提交于 2019-12-06 15:44:46

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!