From 219ca9f72b8c1604f91e49a5c2faee195fd04fa1 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sun, 20 May 2018 16:43:10 +0200 Subject: [PATCH] put address of app server in resource file --- .gitignore | 2 +- .../siacs/conversations/services/PushManagementService.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9921b2ffb..82e03b813 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ *.swp .settings -src/playstore/res/values/gcm.xml +src/playstore/res/values/push.xml # https://github.com/github/gitignore/blob/master/Gradle.gitignore .gradle/ diff --git a/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java b/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java index 022a4ff9e..e85898688 100644 --- a/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java +++ b/src/playstore/java/eu/siacs/conversations/services/PushManagementService.java @@ -7,6 +7,7 @@ import com.google.android.gms.common.GoogleApiAvailability; import com.google.firebase.iid.FirebaseInstanceId; import eu.siacs.conversations.Config; +import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.utils.PhoneHelper; import eu.siacs.conversations.xml.Element; @@ -18,8 +19,6 @@ import rocks.xmpp.addr.Jid; public class PushManagementService { - private static final Jid APP_SERVER = Jid.of("p2.siacs.eu"); - protected final XmppConnectionService mXmppConnectionService; PushManagementService(XmppConnectionService service) { @@ -30,7 +29,8 @@ public class PushManagementService { Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": has push support"); retrieveFcmInstanceToken(token -> { final String androidId = PhoneHelper.getAndroidId(mXmppConnectionService); - IqPacket packet = mXmppConnectionService.getIqGenerator().pushTokenToAppServer(APP_SERVER, token, androidId); + final Jid appServer = Jid.of(mXmppConnectionService.getString(R.string.app_server)); + IqPacket packet = mXmppConnectionService.getIqGenerator().pushTokenToAppServer(appServer, token, androidId); mXmppConnectionService.sendIqPacket(account, packet, (a, p) -> { Element command = p.findChild("command", "http://jabber.org/protocol/commands"); if (p.getType() == IqPacket.TYPE.RESULT && command != null) {