I have a problem. I'm doing a external android service where applications can register to it to receive information. The information come back to the apps from the service via broadcast, and receive it with a broadcastReceiver
.
The problem is if I do sendBroadcast
, any app can listen the information that is for others, I can use the category on the intent filter, but both apps can have it the same category, or a malicous app can do this one on pourpose.
A solution is explicit intents, but for this I need the app to register with the package and the class where it will receive the intent. I don't like this solution.
I think there exists another solution, because GCM does so similar and doesn't need anything but the broadcastreceiver
I add a small diagram:
Does the possibility exist to send a broadcast only to a specific app, without defining the class??
How GCM does it?