从 app-Engine 上的 java 类向 Android 客户端发送推送通知

发布于 2024-12-27 15:06:23 字数 485 浏览 2 评论 0 原文

我需要从我的 java 类向 Android 客户端发送推送通知。该类是使用以下网址提供的指南编写的:http://www.vogella。 de/articles/AndroidCloudToDeviceMessaging/article.html(第 2.4 节 - 发送消息)这在 JBOSS 和 Weblogic 等标准应用程序服务器上运行良好。

但应用程序需要移至 google app-engine,但该类会抛出编译错误:“GAE 的 Java 运行时环境不支持类 javax.net.ssl.HostnameVerifier”。 “SSLSession”类也会引发类似的错误。

有没有办法克服这个问题?或者是否有其他方法可以从应用程序引擎上运行的 Java 类发送推送通知?

谢谢, 维奈

I have the requirement to send a PUSH notification to an android client from my java class. The class has been written using the guidelines provided at the url : http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html (Section 2.4 - Send Messages) This works fine on the standard application servers like JBOSS and Weblogic.

But the application needs to be moved to google app-engine but the class throws a compilation error saying : 'The class javax.net.ssl.HostnameVerifier is not supported by GAE's Java runtime environment'. Similar error is thrown for 'SSLSession' class too.

Is there a way this can be overcome ? Or is there is any other way to send PUSH notifications from Java classes running on the app-engine ?

Thanks,
Vinay

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

皓月长歌 2025-01-03 15:06:23

它无法直接克服,这意味着您无法让这些课程在 GAE 上运行。至于解决方案,我不确定您为什么要使用自定义 HostnameVerifier,因此只需尝试不使用它:使用 HttpURLConnection 而不是 HttpsURLConnection 并删除所有“主机名验证器”部分。

编辑:您还可以使用 App Engine 的 fetch API,这是肯定支持的。

It can't be overcome directly, meaning you can't make those classes run on GAE. As for a solution, I'm not sure why you would want to use a custom HostnameVerifier, so just try without it: use HttpURLConnection instead of HttpsURLConnection and remove all the "hostnameVerifier" parts.

Edit: you can also use App Engine's fetch API, that is supported for sure.

尐籹人 2025-01-03 15:06:23

关于您的问题是否有其他方法可以从应用程序引擎上运行的Java类发送PUSH通知?,答案是肯定的,第三方服务,例如BeaconpushSpire.io 可以与应用程序引擎,在某些情况下可能会便宜得多与使用 App Engine Channel API 相比,成本方面。

Regarding your question Is there is any other way to send PUSH notifications from Java classes running on the app-engine?, the answer is yes, third party services such as Beaconpush or Spire.io could be integrated well with app engine, and in some cases could be much cheaper in terms of cost compared to using the App Engine Channel API.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文