I am trying to implement an XMPP server in my Google Cloud module (endpoints) for my Android app using Android Studio in order to send downstream messages to devices.
I have found an example project which uses Smark here. The following is the code for the connection:
CcsClient ccs = CcsClient.prepareClient(Utils.FCM_ID,Utils.FCM_KEY,false);
try {
ccs.connect();
} catch (XMPPException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (SmackException e) {
e.printStackTrace();
}
But I am getting the following SmackException:
The following addresses failed: 'fcm-xmpp.googleapis.com:5236' failed because
java.net.SocketException: Permission denied: connection to
(10, [2607:f8b0:4001:c06::bc]:5236,6) denied due to policy
How can I fix this?
Copyright Notice:Content Author:「Edijae Crusar」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/41778081/firebase-fcm-xmpp-server-error-connection-denied-due-to-policy