PLSQL APPLE 推送通知 [英] PLSQL APPLE push notifiactions

查看:40
本文介绍了PLSQL APPLE 推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到通知问题.我将 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

您创建了一个服务:

InputStream resourceAsStream = Thread
    .currentThread()
    .getContextClassLoader()
    .getResourceAsStream("Certificate.p12");

ApnsService service = APNS.newService()
    .withCert(resourceAsStream, "CERTNAME")
    .withProductionDestination()
    .build();

然后你创建一个负载:

String payload = APNS.newPayload()
    .sound("default")
    .alertBody(generatePushMessageBody(...))
    .customField("title", generateTitleForPushMessage(user))
    .customField("startDate", formatDateForPushMessage(...)
    .customField("username", user.getUserName())
    .build();

然后发送推送通知:

service.push(registrationId, payload);

您需要将此代码放到 PL/SQL 存储过程中,它才会起作用.

You need to put this code to a PL/SQL stored procedure and it will work.

这篇关于PLSQL APPLE 推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆