<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<!--【可选】根据需要添加-->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<receiver
android:name="com.umeng.message.NotificationProxyBroadcastReceiver"
android:exported="false" >
</receiver>
<receiver android:name="com.umeng.message.RegistrationReceiver" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REMOVED" />
<data android:scheme="package" />
</intent-filter>
<!--【可选】根据需要添加-->
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<receiver android:name="com.umeng.message.UmengBroadcastReceiver" >
<intent-filter>
<action android:name="org.agoo.android.intent.action.RECEIVE" />
</intent-filter>
<intent-filter>
<action android:name="【应用包名】.intent.action.COMMAND" />
</intent-filter>
<intent-filter>
<action android:name="org.agoo.android.intent.action.RE_ELECTION_V2" />
</intent-filter>
</receiver>
<service
android:name="com.umeng.message.UmengService"
android:exported="true"
android:process=":umengService_v1" >
<intent-filter>
<action android:name="【应用包名】.intent.action.START" />
</intent-filter>
<intent-filter>
<action android:name="【应用包名】.intent.action.COCKROACH" />
</intent-filter>
<intent-filter>
<action android:name="org.agoo.android.intent.action.PING" />
</intent-filter>
</service>
<service
android:name="org.android.agoo.service.ElectionService"
android:exported="true"
android:process=":umengService_v1" >
<intent-filter>
<action android:name="org.agoo.android.intent.action.ELECTION_V2" />
</intent-filter>
</service>
<service android:name="com.umeng.message.UmengIntentService" />
<!-- V1.3.0添加的service,负责下载通知的资源 -->
<service android:name="com.umeng.message.UmengDownloadResourceService" />
- <meta-data
android:name="UMENG_APPKEY"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxx" >
</meta-data>
<meta-data android:name="UMENG_CHANNEL" android:value="Channel ID" > </meta-data>
<meta-data
android:name="UMENG_MESSAGE_SECRET"
android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxx" >
</meta-data>
PushAgent mPushAgent = PushAgent.getInstance(context);
mPushAgent.enable();
mPushAgent.isEnabled()
PushAgent.getInstance(context).onAppStart();
原文地址:http://blog.csdn.net/z18789231876/article/details/42494065