build: add F-Droid flavor (#760)
* build: add fdroid flavor * feat: disable fcm registration in f-droid flavor
This commit is contained in:
parent
a79779f813
commit
2ca34278f9
|
@ -34,6 +34,7 @@ android {
|
||||||
}
|
}
|
||||||
githubRelease { initWith release }
|
githubRelease { initWith release }
|
||||||
playRelease { initWith release }
|
playRelease { initWith release }
|
||||||
|
fdroidRelease { initWith release }
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_17
|
sourceCompatibility JavaVersion.VERSION_17
|
||||||
|
|
|
@ -122,6 +122,12 @@ public class PushSubscriptionManager{
|
||||||
|
|
||||||
|
|
||||||
public void registerAccountForPush(PushSubscription subscription){
|
public void registerAccountForPush(PushSubscription subscription){
|
||||||
|
// this function is used for registering push notifications using FCM
|
||||||
|
// to avoid NonFreeNet in F-Droid, this registration is disabled in it
|
||||||
|
// see https://github.com/LucasGGamerM/moshidon/issues/206 for more context
|
||||||
|
if(BuildConfig.BUILD_TYPE.equals("fdroidRelease"))
|
||||||
|
return;
|
||||||
|
|
||||||
if(TextUtils.isEmpty(deviceToken))
|
if(TextUtils.isEmpty(deviceToken))
|
||||||
throw new IllegalStateException("No device push token available");
|
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;
|
||||||
|
|
Loading…
Reference in New Issue