Android 如何为我自己的应用程序创建自定义推送通知?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10412488/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to create custom Push Notification for my Own App?
提问by Shreyash Mahajan
I want to make my own Push Notification that works for my Own App. I know that i have to manage all that threw the Web-Service. But i am wonder about how to make that push Notification.
我想制作我自己的适用于我自己的应用程序的推送通知。我知道我必须管理所有抛出 Web 服务的东西。但我想知道如何制作推送通知。
So can any-one tell me how to make that Custom Push Notification ??
那么任何人都可以告诉我如何制作自定义推送通知??
Thanks in Advance.
提前致谢。
采纳答案by nithinreddy
If you want to manage all by yourself, Click here. This is a great tutorial, which has code to establish the push web services, as well as app implementation.
如果您想自己管理所有,请单击此处。这是一个很棒的教程,其中包含用于建立推送 Web 服务以及应用程序实现的代码。
回答by Sam Clewlow
The easiest way to do it is using Urban Airship - http://urbanairship.com/
最简单的方法是使用 Urban Airship - http://urbanairship.com/
Check all the guides/docs on their site, as they explain everything very well, you'll need to register with Google for a C2DM auth token, and set up a free account with Urban Airship. Then it's just a case of configuring you manifest and a few other classes. Dig around in both the API docs and the guide. The urban airship jars have very good support for logging too, so if you can't get it working, check logcat and this will usually give you a good description of why it's failing.
检查他们网站上的所有指南/文档,因为它们很好地解释了所有内容,您需要在 Google 上注册 C2DM 身份验证令牌,并在 Urban Airship 上设置一个免费帐户。那么这只是配置清单和其他一些类的一个例子。深入研究 API 文档和指南。城市飞艇罐子也对日志记录有很好的支持,所以如果你不能让它工作,检查 logcat,这通常会给你一个很好的描述为什么它失败。
You can also do some other cool stuff like use the notification to trigger running some code etc.
你还可以做一些其他很酷的事情,比如使用通知来触发运行一些代码等。
The notifications can be sent from Urban Airships site/UI, or via a JSON payload via a HTTP POST request from your web server to Urban Airship.
通知可以从 Urban Airships 站点/UI 发送,也可以通过 JSON 有效负载通过 HTTP POST 请求从您的 Web 服务器发送到 Urban Airship。
Without Urban airship, your stuck creating loads of server infrastructure, Urban Airship has a very generous free package (1000000 free notifications!) and also supports cross platform, so you could send notifications to the Android, BB and iOS versions of your apps from one place.
如果没有 Urban 飞艇,您会在创建大量服务器基础设施时遇到困难,Urban Airship 有一个非常慷慨的免费包(1000000 个免费通知!)并且还支持跨平台,因此您可以从一个应用程序向 Android、BB 和 iOS 版本发送通知地方。
回答by user2645186
Have you tried PushApps? you'll find all of your answers detailed here - http://wiki.pushapps.mobi/
你试过 PushApps 吗?您会在此处找到详细的所有答案 - http://wiki.pushapps.mobi/