Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Domain Label contains illegal character ':' #12

Open
MashalRashid opened this issue Mar 4, 2018 · 0 comments
Open

Domain Label contains illegal character ':' #12

MashalRashid opened this issue Mar 4, 2018 · 0 comments

Comments

@MashalRashid
Copy link

MashalRashid commented Mar 4, 2018

I am using Sharp.XMPP library for FCM. I can connect fine and it receives Upstream messages without issues. However, sending ack returns with Error Code 400 with following details

<JIDMalformed xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
<text>"Malformed JID 'XXXXXX:XXXXXXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXX_XXXXX-XXXXXXXXXXXXXXXXXXX': domain label contains illegal character ':'"</text>

whereas the Xs replace the device registration token from which the Upstream message was received. The code I'm using to form a message and send:

Sharp.Xmpp.Im.Message x = new Sharp.Xmpp.Im.Message(vFrom);
x.Data.SetAttribute("message_id", vMessageID);
x.Data.SetAttribute("message_type", "ack");
cl.SendMessage(x);

The string vFrom contains the device_token. I can not replace : as it is an essential part of device token and : does not escape it either. Hexadecimal equivalents don't work. What is the correct way of using colon or other special characters in here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant