Subject: How to set xmpp notifications for Google cloud print
Hi,
I'm currently working on Google cloud print notifications using Xmpp.
I have used Matrix SDK to set up and wait for notifications of print jobs in google cloud.
I have three questions.
a) About setting parameter
According to under GCP XMPP site, we need to connect handshake flow.
https://developers.google.com/cloud-print/docs/rawxmpp
Please tell me how to set up the first for which you want to connect.
We need the following settings.
1) Set OAUTH2.0 AccessToken
2) Set HTTP Proxy
-> For the connection from the enterprise
Currently setting codes are as below:
XmppClient xmpp = new XmppClient();
xmpp.SetUsername(AccessToken); // In agsXMPP, I use AccessToken and success subscription
xmpp.SetXmppDomain("gmail.com");
xmpp.ResolveSrvRecords = false;
xmpp.Hostname = "talk.google.com";
xmpp.ProxyHostname = "proxy.*****.co.jp";
xmpp.ProxyPort = 80**;
Is it correct?
b) How to create the JID
According to https://developers.google.com/cloud-print/docs/rawxmpp,
we need to set 'username' and 'cookie' as below.
std::string credential;
credential.append("\0", 1);
credential.append(username_);
credential.append("\0", 1);
credential.append(cookie_);
el->AddText(Base64Encode(credential));
'cookie' is defined by OAuth2 access token.
In agsXMPP, 'username' is gotten by XmppClientConnection.MyJID.
However, in Matrix, I cannot understand how to create JID.
I think XmppClient does not have JID.
c) How to send the XML
In AgsXMPP, I had to send XML in the following way.
XmppClientConnection xmpp = new XmppClientConnection();
.. // setting
string str = "<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>";
xmpp.Send(str);
However, Matrix SDK cannot exist the same method.
Before I send the message, I think I need to create the "new Matrix.Xml.XmppXElement(str)".
Is this correct method?
I'm currently working on Google cloud print notifications using Xmpp.
I have used Matrix SDK to set up and wait for notifications of print jobs in google cloud.
I have three questions.
a) About setting parameter
According to under GCP XMPP site, we need to connect handshake flow.
https://developers.google.com/cloud-print/docs/rawxmpp
Please tell me how to set up the first for which you want to connect.
We need the following settings.
1) Set OAUTH2.0 AccessToken
2) Set HTTP Proxy
-> For the connection from the enterprise
Currently setting codes are as below:
XmppClient xmpp = new XmppClient();
xmpp.SetUsername(AccessToken); // In agsXMPP, I use AccessToken and success subscription
xmpp.SetXmppDomain("gmail.com");
xmpp.ResolveSrvRecords = false;
xmpp.Hostname = "talk.google.com";
xmpp.ProxyHostname = "proxy.*****.co.jp";
xmpp.ProxyPort = 80**;
Is it correct?
b) How to create the JID
According to https://developers.google.com/cloud-print/docs/rawxmpp,
we need to set 'username' and 'cookie' as below.
std::string credential;
credential.append("\0", 1);
credential.append(username_);
credential.append("\0", 1);
credential.append(cookie_);
el->AddText(Base64Encode(credential));
'cookie' is defined by OAuth2 access token.
In agsXMPP, 'username' is gotten by XmppClientConnection.MyJID.
However, in Matrix, I cannot understand how to create JID.
I think XmppClient does not have JID.
c) How to send the XML
In AgsXMPP, I had to send XML in the following way.
XmppClientConnection xmpp = new XmppClientConnection();
.. // setting
string str = "<starttls xmlns=\"urn:ietf:params:xml:ns:xmpp-tls\"/>";
xmpp.Send(str);
However, Matrix SDK cannot exist the same method.
Before I send the message, I think I need to create the "new Matrix.Xml.XmppXElement(str)".
Is this correct method?