Skip to content

Commit

Permalink
Re-register UnifiedPush when application starts
Browse files Browse the repository at this point in the history
  • Loading branch information
p1gp1g committed Jan 14, 2025
1 parent cc45584 commit 7cd756f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import android.webkit.WebView;

import org.joinmastodon.android.api.PushSubscriptionManager;
import org.joinmastodon.android.utils.UnifiedPushHelper;

import me.grishka.appkit.imageloader.ImageCache;
import me.grishka.appkit.utils.NetworkUtils;
Expand All @@ -27,7 +28,11 @@ public void onCreate(){
ImageCache.setParams(params);
NetworkUtils.setUserAgent("MoshidonAndroid/"+BuildConfig.VERSION_NAME);

PushSubscriptionManager.tryRegisterFCM();
if (UnifiedPushHelper.isUnifiedPushEnabled(this)){
UnifiedPushHelper.registerAllAccounts(this);
} else {
PushSubscriptionManager.tryRegisterFCM();
}
GlobalUserPreferences.load();
if(BuildConfig.DEBUG){
WebView.setWebContentsDebuggingEnabled(true);
Expand Down

0 comments on commit 7cd756f

Please sign in to comment.