parent
696016bd8f
commit
9fd0e7fea4
|
@ -125,11 +125,11 @@ public class PushSubscriptionManager{
|
||||||
// this function is used for registering push notifications using FCM
|
// this function is used for registering push notifications using FCM
|
||||||
// to avoid NonFreeNet in F-Droid, this registration is disabled in it
|
// to avoid NonFreeNet in F-Droid, this registration is disabled in it
|
||||||
// see https://github.com/LucasGGamerM/moshidon/issues/206 for more context
|
// see https://github.com/LucasGGamerM/moshidon/issues/206 for more context
|
||||||
if(BuildConfig.BUILD_TYPE.equals("fdroidRelease"))
|
if(BuildConfig.BUILD_TYPE.equals("fdroidRelease") || TextUtils.isEmpty(deviceToken)){
|
||||||
|
Log.d(TAG, "Skipping registering for FCM push notifications");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(TextUtils.isEmpty(deviceToken))
|
|
||||||
throw new IllegalStateException("No device push token available");
|
|
||||||
String endpoint = "https://app.joinmastodon.org/relay-to/fcm/"+deviceToken+"/"+accountID;
|
String endpoint = "https://app.joinmastodon.org/relay-to/fcm/"+deviceToken+"/"+accountID;
|
||||||
registerAccountForPush(subscription, endpoint);
|
registerAccountForPush(subscription, endpoint);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue