I am trying to implement an Android app with GCM support, but I am having problems authenticating with the CCS server from my third-party server.
import sleekxmpp as xmpp
SERVER = 'gcm.googleapis.com'
PORT = 5235
USERNAME = 'my-project-number'
PASSWORD = 'my-api-key'
def main():
client = xmpp.ClientXMPP(USERNAME + '@' + SERVER, PASSWORD)
if client.connect(address=(SERVER, PORT), use_ssl=True):
print('Connection established.')
print('Authenticated =', client.authenticated)
else:
print('Connection failed.')
if __name__ == "__main__":
main()
Conclusion:
Connection established.
Authenticated = False
Process finished with exit code 0
Not sure why client.authenticatedit is always false when I know that the credentials that I have are the same on the project page in the Google Developer Console.
source
share