是否可以在 Google App Engine 应用程序中实现 iPhone 推送通知?

发布于 2024-08-12 06:53:50 字数 644 浏览 4 评论 0原文

我正处于 iPhone 应用程序的规划阶段,正在考虑将 Google App Engine 用于我的服务器组件由于其可扩展性的特点。

推送通知使用二进制接口发送到 gateway.push.apple.com:2195

不过,服务器的 JRE 只允许使用以下标准类,其中不包括 Socket 类。可以使用 URLConnection 来执行此操作吗?

考虑到 Google App Engine 应用程序的限制,是否有办法实现推送通知?

我想避免使用第三方服务,例如 AppNotifyUrbanAirship(如果可能)。

I'm in the planning phase of an iPhone application and am considering using Google App Engine for my server component due to its scalability features.

Push notifications are sent using a binary interface to gateway.push.apple.com:2195.

However, the JRE for the server is only allowed to use the following standard classes, which does not include the Socket classes. Can URLConnection be used somehow to do this?

Is there a way to implement push notifications given the restrictions on Google App Engine applications?

I'd like to avoid using a third-party service such as AppNotify or UrbanAirship if possible.

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

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

发布评论

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

评论(5

鲜血染红嫁衣 2024-08-19 06:53:50

没有。 Google App Engine 禁止本机套接字连接。您要么需要使用第三方服务(如您提到的服务),要么拥有另一个专用服务器来发送通知。

编辑:请注意,GAE 对套接字和传出调用的限制不仅仅是库限制。 Google 服务器实际上会阻止所有出站网络连接;它们只允许通过 URL 获取服务器进行 HTTP 请求。

如果您愿意,可以给问题 1164:添加对 Apple 推送通知服务的支持加注星标

Nope. Google App Engine forbids native socket connections. You either need to use a third party service (like the ones you mentioned) or have another dedicated server for sending notifications.

EDIT: Please note that the limitation of GAE on sockets and outgoing calls isn't a library limitation only. Google servers actually block all outbound network connections; they only allow HTTP requests through URL Fetching servers.

If you like, you can star Issue 1164: Add Support for Apple Push Notification Service.

北斗星光 2024-08-19 06:53:50

现在,有了 Appengine 1.7.7 版,一切皆有可能!

Now with Appengine Release 1.7.7 its possible!

月竹挽风 2024-08-19 06:53:50

您使用第 3 方库 notnoop/java-apns。它很容易使用。您可能遇到的唯一问题是GAE上的线程限制

您可以参考这个答案:https:// /stackoverflow.com/a/24900789/474002

You use the 3rd-party library notnoop/java-apns. It is easy to use. The only problem you could meet is the thread limitation on the GAE

You could refer to this answer: https://stackoverflow.com/a/24900789/474002

凉宸 2024-08-19 06:53:50

这是绝对有可能的。查看 java-apns-gae

它是一个开源 Java APNS 库,专门设计用于在 Google App Engine 上工作(和使用)。

It is absolutely possible. Check out java-apns-gae.

It's an open-source, Java APNS library that was specifically designed to work (and be used) on Google App Engine.

温柔戏命师 2024-08-19 06:53:50

最近,Google 正式支持在 iOS 上发送推送通知。您可以查看此示例代码

有关更多详细信息,请查看 Google 的 帖子

Lately, Google officially supports to send push notification on iOS. You can take a look at this sample code.

For more detail, checkout this Google's post.

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