Urban Airship Android Client - Google GCM Push
来源:互联网 发布:老男孩linux运维 编辑:程序博客网 时间:2024/05/21 17:12
本文链接:http://blog.csdn.net/kongxx/article/details/8181196
上一篇文章说到了怎样通过helium来推送通知,下面来看看怎样通过Google的GCM来推送。
这里关于GCM的配置可以参考http://developer.android.com/guide/google/gcm/demo.html
下面的例子假定已经配置好了Google的GCM。
1. 首先添加gcm.jar包到libs目录下,并将其加入classpath。
2. 首先修改AndroidManifest.xml文件,添加对GCM的支持
<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="urbanairship.client"android:versionCode="1"android:versionName="1.0" >...<!-- BEGIN for Urban Airship GCM --><uses-permission android:name="android.permission.GET_ACCOUNTS" /><uses-permission android:name="android.permission.WAKE_LOCK" /><uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /><uses-permission android:name="urbanairship.client.permission.C2D_MESSAGE" /><permission android:name="urbanairship.client.permission.C2D_MESSAGE" android:protectionLevel="signature" /><!-- END for Urban Airship GCM --><applicationandroid:name="urbanairship.client.MyApplication"android:enabled="true"android:icon="@drawable/ic_launcher"android:label="@string/app_name"android:theme="@style/AppTheme" android:debuggable="true">...<!-- BEGIN for Urban Airship GCM --><receiver android:name="com.urbanairship.CoreReceiver" /><receiverandroid:name="com.urbanairship.push.GCMPushReceiver"android:permission="com.google.android.c2dm.permission.SEND" ><intent-filter><action android:name="com.google.android.c2dm.intent.RECEIVE" /><action android:name="com.google.android.c2dm.intent.REGISTRATION" /><category android:name="urbanairship.client" /></intent-filter></receiver><!-- END for Urban Airship GCM -->...</application></manifest>3. 修改assets/airshipconfig.properties文件
3.1 将其中的
transport=helium改成
transport = gcm3.2 将其中的gcmSender设置为Google API project ID。
4. 运行程序测试,从Urban AirShip向此设备发送通知,然后检查状态栏。
- Urban Airship Android Client - Google GCM Push
- Urban Airship Android Client - Helium Push
- Android Server Push Notification - Urban Airship
- Android Server Push Notification - Urban Airship
- 第三方Push服务:Urban Airship
- Android Push Notifications using Google Cloud Messaging GCM
- Android GCM push通知
- Android Push Notifications using Google Cloud Messaging (GCM), PHP and MySQL
- android使用google gcm接收push消息需要注意的地方
- Urban Airship Server API - Java客户端实例
- Urban Airship在iOS中的应用
- Urban Airship在iOS中的应用
- Urban Airship在iOS中的应用
- urban airship实现消息内容的推送
- android: Google Cloud Messaging (GCM)
- Google GCM(推送)-Android+服务器
- Google Cloud Messaging(GCM) for Android
- 【PhoneGap Android】Google GCM推送使用插件
- C# WinForm开发系列相关的博客
- tomcat架构及源码分析
- linux下java调用浏览器
- 无限循环小数的分数形式
- Android SQLite 查询相关的笔记
- Urban Airship Android Client - Google GCM Push
- 2012-11-14日工作
- Mysql数据库中varchar类型和char类型的区别
- WCF (Windows Communication Foundation) Overview
- Android---(4),Fragment的创建和使用,intent调用内置应用。
- 关于猫叫、老鼠逃跑、人被惊醒的程序设计
- Java修改注册表
- 浮点数(谁偷了你的精度?)
- 毕业后就是程序员——我的阿里、金山、中华、腾讯、360、网易面试总结