如何使用GCM(Google Cloud Messenger)注册基于python的客户端以获取设备的registration_id? [英] How do you register a python-based client with GCM (Google Cloud Messenger) to get a registration_id for the device?

查看:224
本文介绍了如何使用GCM(Google Cloud Messenger)注册基于python的客户端以获取设备的registration_id?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在想如何使用下列其中一种python包创建一个基于python的客户端,该客户端能够通过Google Cloud Messenging 接收基于XMPP的消息。





从所有我可以看到的,( eg,gcm-client 的文档),这些软件包可以将消息发送给由 registration_id 标识的其他客户端。但是,我如何首先为每个客户获得注册ID?换句话说,我如何注册我创建的客户端应用程序,以便它可以接收消息?



在我看来,这些不是客户端而只是可以用来将消息推送到客户端的库。每个客户端应用程序必须调用 getRegistrationId()来获得注册ID一次。然后他们可以收到消息。更详细的函数调用是 此处



我希望这给你一个客户端设备的想法。 :)

I have been trying to figure out how to use one of the following python packages to create a python-based client that is capable of receiving XMPP-based messages via Google Cloud Messenging.

From all I can see, (e.g., the documentation for gcm-client), these packages can send messages to other clients that are identified by registration_id. But how do I get a registration IDs for each client in the first place? In other words, how do I register the client-app that I am creating so that it can receive messages?

It is starting to seem to me that these are not clients per-se, but just libraries that can be used to push messages to clients. I hope that I am wrong about that and just missing a key concept.

解决方案

Each client application has to call the getRegistrationId() to get the registration id once. Then they can receive messages. A more detailed function call is here

I hope this give you an idea on client devices. :)

这篇关于如何使用GCM(Google Cloud Messenger)注册基于python的客户端以获取设备的registration_id?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆