Search code examples
androidregistrationandroid-c2dm

Specifying multiple application packages in C2DM


I have an Android application that uses C2DM. I am creating another application derived from it. Currently, Google don't support C2DM, they moved to GCM.

But I want to use the C2DM for the derived app still. Is it possible to add multiple packages that can be notified via C2DM in the manifest?


Solution

  • You're confused. A single server can notify multiple apps, the C2DM/GCM rules don't prohibit that. The apps would have different package IDs, but the notification generating code on the server does not need to know them. All the server needs to know is a registration ID. Which the app obtains, and somehow transmits to the server.

    The app needs to provide an API Key (GCM) or Google account (C2DM) at registration time to subscribe to notifications. But not vice versa, the server does not need to authenticate against packages.

    If the notification protocol varies from one app to another, you need to communicate the supported protocol along with the reg ID to the server.