简体   繁体   中英

Is it possible to register android device from third party java server?

I am building push notification server for android and web with third party java server. As we know to be a part of this scenario, corresponding android device should get a Registration id for GCM server and share it with third party java server. Can we move this functionality to third party java server? Specifically, can we obtain a unique registration using third party java server and then assign it to corresponding android app?

No, that is not possible. Registration IDs are assigned to devices by GCM and there is no functionality to modify this process.

can we obtain a unique registration using third party java server and then assign it to corresponding android app?

no, you can't. and actually it does not make any scene, because there are two options:

  • corresponding app == your app . if that's the case - then nothing stops you from maintaining regId for itself.

  • corresponding app != your app . it does no make any sense that google will allow any app to register any other app to receive GCM messages without the receiving app permission.

also I believe that what you have in mind is a common mistake:

GCM push != status bar Notification

when understanding that - you relize that it does not make any scense to register apps that not implemented integration with your server, because event if you could (and you can't) send other apps GCM messages - if they did not implemented a broadcast receiver or Service which handles your specific push parameters and trigger it to show notification or something, nothing will happened form itself.

You could create a file on your server that generates a registration id whenever a device registers (But the device should not use GCM) and return it back afterwards. But to do this you also need to create your own "GCM like" library that would work for your server. Well, it may take a while but i think this is possible.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM