本文介紹了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 推送通知的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!