ADM registration doesn't work when the package name is changed
Hi, We need to make different flavours out of our app and each one has a different package name. For convenience, we use the aapt's built-in functionality of "--rename-manifest-package" (
http://www.piwai.info/renaming-android-manifest-package/) and everything is working except for ADM. After ADM.startRegister() is called, our ADMMessageHandler subclass callbacks are not being called. It seems like the library can't find it internally and then silently swallows the response. Is there anything we can do about it besides changing the package name everywhere? Thanks.
Hi, I've verified that we've performed all the steps and I can't see what we're doing wrong. We created another app, we created a new security profile for it and also created new API keys. The thing is that after calling ADM.startRegister(), nothing else happens, not even onRegistrationError is called. Are you sure there's no issue with the package name being changed through aapt? Maybe internally you're trying to find the receiver through reflection and you get the package name from the package manager? Because in that case it won't work, as the package returned by the package manager will be the renamed package, but the receiver is still in the old package.
I forgot to mention that in the version without the package name changed, the registration works as expected. Note that the different versions don't share API keys nor security profiles. Our build process automatically selects the API key needed depending on the version we're building.
Sorted the problem out. I had to manually change the package name of the RECEIVE_ADM_MESSAGE permissions and the package of the intent filter category of the alert receiver. For some reason this change wasn't necessary for GCM but it is for ADM. Thanks anyway!