I am building an App for Android and iPhone. This app needs to receive notification for new messages in user's inbox. Being a total noob in app dev, I was wondering if any of you guys could suggest the best way to implement what I need here.
我正在为Android和iPhone开发一个应用程序。该应用程序需要接收用户收件箱中新消息的通知。作为应用程序开发中的一个新手,我想知道你们中是否有人能提出实现我在这里需要的最佳方法。
I have read up more on Android than iPhone so my understanding of latter may be wanting. Based on what I have read and understood, I believe that I will need to start a service when my app launches for the first time (or instruct the device to start the service every time the device starts or something). This service will then interface with a server to receive notifications and display them. Clicking on the notification will launch the app.
我在Android上读到的东西比iPhone多,所以我对后者的理解可能有点欠缺。基于我所读和理解的内容,我相信当我的应用程序第一次启动时,我需要启动一个服务(或者指示设备每次启动或其他设备启动时启动服务)。然后,该服务将与服务器交互以接收和显示通知。单击通知将启动应用程序。
My options are
我的选择是
-
C2DM or APNS
C2DM或前置
-
Urban Airship
城市飞艇
-
My own server using mostly idle TCP connection with client.
我自己的服务器主要使用空闲的TCP连接与客户端。
Depending upon the option I choose, my client side implementation as well as server side implementation changes.
根据我选择的选项,我的客户端实现和服务器端实现都将发生更改。
What will you guys recommend? Is there any other way to do what I need done?
你们有什么推荐吗?还有其他的方法来做我需要做的吗?
Any help is greatly appreciated.
非常感谢您的帮助。
Update:
更新:
Building on jbat100 answer. The fact that Apple does not allow me to write my own server to communicate directly with my app for notifications means that APNS must be used. So option 3 is out altogether. This means we are left with either Urban Airship or interfacing directly with APNS and C2DM. Based on my research, the effort involved in both cases is comparable so it does not make sense to shell out 4-5K /mo extra just to support notification. So I plan to implement option 1. If any of you think otherwise, please leave comments below.
基于jbat100回答。苹果不允许我编写自己的服务器直接与我的应用程序进行通知,这意味着必须使用APNS。所以选项3完全过时了。这意味着我们要么拥有城市飞艇,要么直接与APNS和C2DM接口。根据我的研究,这两种情况下所涉及的努力是可以比较的,所以仅仅为了支持通知而额外支付4-5K /mo是没有意义的。所以我计划执行选项1。如果你们有其他想法,请在下面留言。
Thanks.
谢谢。
6 个解决方案
#1
2
They will have to be handled separately. In the case of iOS push notifications, you will have to go through the Apple Push Notification Service (Programming Guide here), they have a very specific protocol your server will have to conform to which is described in the Provider Communication with Apple Push Notification Service. Don't know about Android, it will probably be quite different, less centralized.
他们必须分开处理。在iOS推送通知的情况下,您必须通过Apple推送通知服务(编程指南在这里),它们有一个非常特定的协议,您的服务器必须遵守,这在与Apple推送通知服务的提供商通信中有描述。不了解Android,它可能会很不一样,不那么集中。
#2
1
Building on jbat100 answer. The fact that Apple does not allow me to write my own server to communicate directly with my app for notifications means that APNS must be used. So option 3 is out altogether. This means we are left with either Urban Airship or interfacing directly with APNS and C2DM. Based on my research, the effort involved in both cases is comparable so it does not make sense to shell out 4-5K /mo extra just to support notification. So I plan to implement option 1. If any of you think otherwise, please leave comments below.
基于jbat100回答。苹果不允许我编写自己的服务器直接与我的应用程序进行通知,这意味着必须使用APNS。所以选项3完全过时了。这意味着我们要么拥有城市飞艇,要么直接与APNS和C2DM接口。根据我的研究,这两种情况下所涉及的努力是可以比较的,所以仅仅为了支持通知而额外支付4-5K /mo是没有意义的。所以我计划执行选项1。如果你们有其他想法,请在下面留言。
#3
0
C2DM would be the easiest perhaps. But, I think you can also try Urban Ship. Implementing your own server is a pain.
C2DM可能是最简单的。但是,我认为你也可以试试市区船。实现您自己的服务器是一件痛苦的事情。
#4
0
My situation is very similar, and I released my Android app first, and am now working on an iOS app. For Android, I implemented push notifications using C2DM, and I send the notifications from my Google App Engine (GAE) app. C2DM basically requires sending HTTP messages to Google's server. So, you send an HTTP POST to the URL https://android.apis.google.com/c2dm/send.
我的情况非常相似,我首先发布了我的Android应用,现在正在开发一个iOS应用。对于Android,我使用C2DM实现推送通知,并从我的谷歌app Engine (GAE)应用发送通知。所以,你发送一个HTTP POST到URL https://android.apis.google.com/c2dm/send。
iOS however, requires a dedicated TCP connection on a proprietary port, and GAE environment doesn't allow any external protocol except HTTP over port 80. So, I have researched a lot and Urban Airship seems to be the answer. They provide an HTTP interface, which I can access from my GAE environment, and they convert that to the protocol that Apple's servers understand. Their pricing seems confusing though - 1 million free notifications per month, and a tenth of a cent per notification after that. That's bizzare because they're giving away $1000 free a month? Very economically weird. I'm considering trying them out, but I think the best high-volume alternative is to just use your own implementation, and deploy it on Amazon's AWS or buy other cheap 3rd party hosting.
然而,iOS需要在专用端口上建立专用的TCP连接,而且GAE环境不允许任何外部协议,除了端口80上的HTTP。所以,我做了很多研究,城市飞艇似乎是答案。它们提供了一个HTTP接口,我可以从GAE环境中访问该接口,并将其转换为苹果服务器理解的协议。他们的定价似乎让人困惑——每月100万份免费通知,之后是千分之一。那是bizzare,因为他们每月免费赠送1000美元?经济非常奇怪。我正在考虑试用它们,但我认为最好的大容量选择是使用您自己的实现,并将其部署到Amazon的AWS上,或者购买其他便宜的第三方托管。
#5
0
Important: C2DM has been officially deprecated as of June 26, 2012. This means that C2DM has stopped accepting new users and quota requests. No new features will be added to C2DM. However, apps using C2DM will continue to work. Existing C2DM developers are encouraged to migrate to the new version of C2DM, called Google Cloud Messaging for Android (GCM). See the C2DM-to-GCM Migration document for more information. Developers must use GCM for new development.
重要提示:C2DM在2012年6月26日被正式弃用。这意味着C2DM已经停止接受新用户和配额请求。C2DM不会增加任何新功能。然而,使用C2DM的应用程序将继续发挥作用。现有的C2DM开发人员被鼓励迁移到新版本的C2DM,称为谷歌云消息传递给Android (GCM)。有关更多信息,请参见c2dmto - gcm迁移文档。开发人员必须使用GCM进行新的开发。
#6
0
I can't shed any light on the Android side of the equation, but I can tell you that I recently setup an incredibly simple Rails app on Heroku that sends push notifications to my iOS app via APNS. I used the houston gem and was receiving push notifications in my iOS app in less than 20 minutes from when I started the effort.
我无法解释这个等式的Android方面,但我可以告诉你,我最近在Heroku上安装了一个非常简单的Rails应用,它通过APNS向我的iOS应用程序发送推送通知。我使用了houston gem,并且在我的iOS应用中收到了推送通知,距离我开始这项工作还不到20分钟。
#1
2
They will have to be handled separately. In the case of iOS push notifications, you will have to go through the Apple Push Notification Service (Programming Guide here), they have a very specific protocol your server will have to conform to which is described in the Provider Communication with Apple Push Notification Service. Don't know about Android, it will probably be quite different, less centralized.
他们必须分开处理。在iOS推送通知的情况下,您必须通过Apple推送通知服务(编程指南在这里),它们有一个非常特定的协议,您的服务器必须遵守,这在与Apple推送通知服务的提供商通信中有描述。不了解Android,它可能会很不一样,不那么集中。
#2
1
Building on jbat100 answer. The fact that Apple does not allow me to write my own server to communicate directly with my app for notifications means that APNS must be used. So option 3 is out altogether. This means we are left with either Urban Airship or interfacing directly with APNS and C2DM. Based on my research, the effort involved in both cases is comparable so it does not make sense to shell out 4-5K /mo extra just to support notification. So I plan to implement option 1. If any of you think otherwise, please leave comments below.
基于jbat100回答。苹果不允许我编写自己的服务器直接与我的应用程序进行通知,这意味着必须使用APNS。所以选项3完全过时了。这意味着我们要么拥有城市飞艇,要么直接与APNS和C2DM接口。根据我的研究,这两种情况下所涉及的努力是可以比较的,所以仅仅为了支持通知而额外支付4-5K /mo是没有意义的。所以我计划执行选项1。如果你们有其他想法,请在下面留言。
#3
0
C2DM would be the easiest perhaps. But, I think you can also try Urban Ship. Implementing your own server is a pain.
C2DM可能是最简单的。但是,我认为你也可以试试市区船。实现您自己的服务器是一件痛苦的事情。
#4
0
My situation is very similar, and I released my Android app first, and am now working on an iOS app. For Android, I implemented push notifications using C2DM, and I send the notifications from my Google App Engine (GAE) app. C2DM basically requires sending HTTP messages to Google's server. So, you send an HTTP POST to the URL https://android.apis.google.com/c2dm/send.
我的情况非常相似,我首先发布了我的Android应用,现在正在开发一个iOS应用。对于Android,我使用C2DM实现推送通知,并从我的谷歌app Engine (GAE)应用发送通知。所以,你发送一个HTTP POST到URL https://android.apis.google.com/c2dm/send。
iOS however, requires a dedicated TCP connection on a proprietary port, and GAE environment doesn't allow any external protocol except HTTP over port 80. So, I have researched a lot and Urban Airship seems to be the answer. They provide an HTTP interface, which I can access from my GAE environment, and they convert that to the protocol that Apple's servers understand. Their pricing seems confusing though - 1 million free notifications per month, and a tenth of a cent per notification after that. That's bizzare because they're giving away $1000 free a month? Very economically weird. I'm considering trying them out, but I think the best high-volume alternative is to just use your own implementation, and deploy it on Amazon's AWS or buy other cheap 3rd party hosting.
然而,iOS需要在专用端口上建立专用的TCP连接,而且GAE环境不允许任何外部协议,除了端口80上的HTTP。所以,我做了很多研究,城市飞艇似乎是答案。它们提供了一个HTTP接口,我可以从GAE环境中访问该接口,并将其转换为苹果服务器理解的协议。他们的定价似乎让人困惑——每月100万份免费通知,之后是千分之一。那是bizzare,因为他们每月免费赠送1000美元?经济非常奇怪。我正在考虑试用它们,但我认为最好的大容量选择是使用您自己的实现,并将其部署到Amazon的AWS上,或者购买其他便宜的第三方托管。
#5
0
Important: C2DM has been officially deprecated as of June 26, 2012. This means that C2DM has stopped accepting new users and quota requests. No new features will be added to C2DM. However, apps using C2DM will continue to work. Existing C2DM developers are encouraged to migrate to the new version of C2DM, called Google Cloud Messaging for Android (GCM). See the C2DM-to-GCM Migration document for more information. Developers must use GCM for new development.
重要提示:C2DM在2012年6月26日被正式弃用。这意味着C2DM已经停止接受新用户和配额请求。C2DM不会增加任何新功能。然而,使用C2DM的应用程序将继续发挥作用。现有的C2DM开发人员被鼓励迁移到新版本的C2DM,称为谷歌云消息传递给Android (GCM)。有关更多信息,请参见c2dmto - gcm迁移文档。开发人员必须使用GCM进行新的开发。
#6
0
I can't shed any light on the Android side of the equation, but I can tell you that I recently setup an incredibly simple Rails app on Heroku that sends push notifications to my iOS app via APNS. I used the houston gem and was receiving push notifications in my iOS app in less than 20 minutes from when I started the effort.
我无法解释这个等式的Android方面,但我可以告诉你,我最近在Heroku上安装了一个非常简单的Rails应用,它通过APNS向我的iOS应用程序发送推送通知。我使用了houston gem,并且在我的iOS应用中收到了推送通知,距离我开始这项工作还不到20分钟。