Can I get another C2DM application for Android if I am signed with the same signature?

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

  <!-- Only this application can receive the messages and registration result --> <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" ...> <!-- Only this application can receive the messages and registration result --> <uses-permission android:name="com.example.myapp.permission.C2D_MESSAGE" /> <!-- This app has permission to register and receive message --> <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /> <!-- Send the registration id to the server --> <uses-permission android:name="android.permission.INTERNET" /> <application...> <!-- Only C2DM servers can send messages for the app. If permission is not set - any other app can generate it --> <receiver android:name=".C2DMReceiver" android:permission="com.google.android.c2dm.permission.SEND"> <!-- Receive the actual message --> <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?

+4
source share
1 answer

AFAIK This is not possible. When an application registers for C2DM messages, it generates a key based on the application package name, and you can only have one of them on each device.

If you use the same signature, I assume that you are managing both applications, if you need the application receiving the C2DM message to transfer data to the second application through a service to which they both access.

0
source

All Articles