Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to connect FCM xmpp server by matrix client but the connection is not authenticated and opened.

getting the error message as No connection could be made because the target machine actively refused it 74.125.24.188:5235

What I have tried:

xmppClient.XmppDomain = "gcm.googleapis.com";
xmppClient.Hostname = "fcm-xmpp.googleapis.com";
xmppClient.Port = 5235;

xmppClient.ResolveSrvRecords = false;
xmppClient.OldStyleSsl = true;

xmppClient.Username = senderId;     // your sender id
xmppClient.Password = serverKey;    // your server key

xmppClient.AutoRoster = false;
xmppClient.AutoPresence = false;
xmppClient.Open();

var jsonMessgae = new JObject(new
{
	notification = new
	{
		title = "Portugal vs. Denmark",
		body = "5 to 1"
	},
	message_id = Guid.NewGuid().ToString(),
	to = testDeviceId
});

var msg = new Message { Id = Guid.NewGuid().ToString() };
msg.Add(new Gcm { Value = jsonMessgae.ToString() });

xmppClient.Send(msg);
Posted
Updated 20-Feb-19 4:12am
v2

1 solution

It doesn't like your "connection protocol". It doesn't recognize it. It doesn't know who's knocking. It's expecting a particular command sequence.
 
Share this answer
 
Comments
Member 14156522 21-Feb-19 1:00am    
Is there anything wrong in my code?

do we need to register the FCM project for upstream messages? the how to do that

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900