Is there a way to use GCM in Android without a dedicated server?

老子叫甜甜 提交于 2019-12-05 04:48:49

I think that will be hard to do what you want effectively without a server but you can check out Parse's SDK. It is free to try and free up to a certain monthly limit.

The docs. You may want to read "Sending Pushes to Channels" and "Using Advanced Targeting".

Yes you can - it's possible to send the same messages from a device that would be sent from a server. However, this has the following problems:

  1. You're putting your API key in your app, so somebody could decompile your APK to get it.
  2. Your users would need some way to share their GCM registration IDs with each other. If two users had both their IDs expire at the same time, there would be no way to share them again.

Really, building your app and hosting it on AppEngine would take about an hour to write, and cost less than $10 a month, even for a ton of users.

For a dead-simple messaging server example written in Java, check out the server backing one of my apps:

https://github.com/charlesmunger/touch-to-text-server.git

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!