我尝试注册到 C2DM,但它不起作用。我在我的项目中包含了 com.google.android.c2dm。当我尝试查找com.google.android.c2dm.intent.REGISTER
时,它什么也没找到:
String action = "com.google.android.c2dm.intent.REGISTER";
final PackageManager packageManager = context.getPackageManager();
final Intent intent = new Intent(action);
List<ResolveInfo> list = packageManager.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
list.size()
给0。有什么想法吗?
编辑: mu 清单文件包含正确的权限:
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />