I have an application ( com.example.myapp ) installed that received C2DM Intent s. I would like to link this in order to do my own processing in response to these Intent in a separate application ( com.example.myapp2 ). In accordance with this answer , the C2DM client system C2DM looking for:
broadcast receivers for intent: com.google.android.c2dm.intent.REGISTRATION
This has permission: .permission.C2D_MESSAGE
The following permission is defined and used in the source application as specified in the C2DM documentation
<permission android:name="com.example.myapp.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <uses-permission android:name="com.example.myapp.permission.C2D_MESSAGE" />
This is the manifest com.example.myapp2 , in which I also use this permission:
<manifest package="com.example.myapp2" ...> <uses-permission android:name="com.example.myapp.permission.C2D_MESSAGE" /> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <uses-permission android:name="android.permission.INTERNET" /> <application...> <receiver android:name=".C2DMReceiver" android:permission="com.google.android.c2dm.permission.SEND"> <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <category android:name="com.example.myapp" /> <category android:name="com.example.myapp2" /> </intent-filter> </receiver> ... </application> ... </manifest>
My C2DMReceiver is com.example.myapp2.C2DMReceiver . Note that I am not listening to com.google.android.c2dm.intent.REGISTRATION Intent , as I am not interested in registering. I can only get the Intent , which is already receiving com.example.myapp . In my IntentFilter for com.google.android.c2dm.intent.RECEIVE Intent s, I filter for both com.example.myapp and com.example.myapp2 category , since C2DM not specific as to what C2DM looks like Intent . Any help there would be appreciated.
I confirmed that com.example.myapp2 has permission com.example.myapp.permission.C2D_MESSAGE . If I run the debug key, I do not have it, but if I run the key with the key, I have it. Obviously, I am running the version on my device using the release key.
When com.example.myapp receives a C2DM Intent com.example.myapp2 , it does not receive it. Any ideas on how to debug or how to make this work? Is it possible?