我一直在尝试从互联网上获取一些关于将推送消息从 android 客户端(应用程序)直接发送到 GCM 而无需任何应用程序服务器参与的信息。 我的要求是向其他 Android 设备发送消息(一对一)。
我基本上希望模仿手机上的 SMS 行为。另外,我有所有设备的 UID 来发送 PUSH。
如果可能,请指向任何教程,或者如果不是,我想知道任何第三方服务器,我可以在其中发送推送消息,然后该服务器发送到 GCM。
最佳答案
看看 Parse.com - Android push guide。它允许从一台设备向另一台设备发送推送通知。它非常容易安装和使用。
您可以在 ParseInstallation
中保存设备 UID,然后针对此安装:
接收方:
ParseInstallation installation = ParseInstallation.getCurrentInstallation();
installation.put("uid", "1234567890");
installation.saveInBackground();
发件人:
ParseQuery query = ParseInstallation.getQuery();
query.whereEqualTo("uid", "1234567890");
ParsePush push = new ParsePush();
push.setQuery(query);
push.sendPushInBackground();
关于android - 是否可以直接从 Android 应用程序向 GCM 发送推送通知?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22501687/