Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register for push notification doesn't work with v0.2.16.204713 #1329

Closed
Lowell13 opened this issue Dec 22, 2020 · 31 comments
Closed

Register for push notification doesn't work with v0.2.16.204713 #1329

Lowell13 opened this issue Dec 22, 2020 · 31 comments
Labels

Comments

@Lowell13
Copy link

Hey all, I can't register any app to receive push notifications.

I just reinstalled a whole new system, so I had to setup microG again. With v0.2.16.204713 I just can't register my apps to receive push notifications, but when I downgrade and goes back to v0.2.15.204713 it works. I used the "Push Notification Tester" app to pinpoint the problem, but I can't help more, sorry.

System :
Android 11
Custom rom : CrDroid 7.1 (for OnePlus 7 Pro)

@ghost
Copy link

ghost commented Dec 23, 2020

this issues related to VXP as well:
android-hacker/VirtualXposed#954

@mar-v-in

about bug i can't login on MICROG
i don't know what is root problem?
from microg or VXP??

@mar-v-in

Best Regards
NST_Adventure

@ghost
Copy link

ghost commented Dec 27, 2020

I found that it does work, but it takes much longer than it should for an app to eventually register (>1 day), whereas in previous versions it happened right away.

@JonnyTech
Copy link

Have you tried to dial the *#*#CHECKIN#*#* code?

@ghost
Copy link

ghost commented Dec 27, 2020

Have you tried to dial the ##CHECKIN## code?

It's a different problem; Cloud Messaging in GmsCore connects fine, but the apps don't register like they should.

@9Lukas5
Copy link

9Lukas5 commented Dec 27, 2020

I have the same problem on a fresh installation of LineageOS18.1 (Android 11).
Can confirm downgrading to 2.15 my apps register for GCM/FCM just fine, thanks for this tip @Lowell13 🤗

@Goodwu
Copy link

Goodwu commented Jan 13, 2021

I have the same problem on a fresh installation of LineageOS18.1 (Android 11).
Can confirm downgrading to 2.15 my apps register for GCM/FCM just fine, thanks for this tip @Lowell13 🤗

I can confirm this. Also Android 11, also work fine after downgrade to 2.15.
And here's the backtrace.

01-13 15:54:20.755 3917 3917 D GmsGcmRegister: onBind: Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms }
01-13 15:54:20.819 3917 3917 D GmsGcmRegister: handleMessage: package=com.firstrowria.pushnotificationtester what=1 id=1
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: java.lang.RuntimeException: Checkin disabled
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at org.microg.gms.gcm.PushRegisterServiceKt.ensureCheckinIsUpToDate(PushRegisterService.kt:33)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at org.microg.gms.gcm.PushRegisterHandler$handleMessage$1.invokeSuspend(PushRegisterService.kt:312)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at androidx.lifecycle.DispatchQueue.drainQueue(DispatchQueue.kt:76)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at androidx.lifecycle.DispatchQueue.enqueue(DispatchQueue.kt:106)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at androidx.lifecycle.DispatchQueue.runOrEnqueue(DispatchQueue.kt:96)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at androidx.lifecycle.PausingDispatcher.dispatch(PausingDispatcher.kt:184)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:288)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:166)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at androidx.lifecycle.PausingDispatcherKt$whenStateAtLeast$2.invokeSuspend(PausingDispatcher.kt:163)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at androidx.lifecycle.PausingDispatcherKt$whenStateAtLeast$2.invoke(Unknown Source:10)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:91)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:160)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at androidx.lifecycle.PausingDispatcherKt.whenStateAtLeast(PausingDispatcher.kt:157)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at androidx.lifecycle.PausingDispatcherKt.whenStarted(PausingDispatcher.kt:61)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at androidx.lifecycle.LifecycleCoroutineScope$launchWhenStarted$1.invokeSuspend(Lifecycle.kt:87)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:330)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:26)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:109)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:158)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.BuildersKt.launch(Unknown Source:1)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:49)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source:1)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at androidx.lifecycle.LifecycleCoroutineScope.launchWhenStarted(Lifecycle.kt:86)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at org.microg.gms.gcm.PushRegisterHandler.handleMessage(PushRegisterService.kt:308)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at android.os.Handler.dispatchMessage(Handler.java:106)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at android.os.Looper.loop(Looper.java:223)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at android.app.ActivityThread.main(ActivityThread.java:7660)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at java.lang.reflect.Method.invoke(Native Method)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:594)
01-13 15:54:20.822 3917 3917 W GmsGcmRegister: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

@joelselvaraj
Copy link

joelselvaraj commented Jan 19, 2021

I can confirm this issue in my Xiaomi Poco F1 when running CrDroid 7.2, ArrowOS ROMs (Android 11). I can also confirm that downgrading to v0.2.15 fixes the issue.

@Master0ne
Copy link

Master0ne commented Feb 19, 2021

Issue confirmed with microG Services Core Version 0.2.17.204714 and 0.2.16.204713 on ArrowOS 11 on a POCO X3 NFC, as well as the fix by downgrading to to 0.2.15.204713.

OK, that's awkward, I have just reinstalled microG Services Core Version 0.2.17.204714 and uninstalled microG DroidGuard Helper (because SafetyNet hasn't been working with microG for a long time anyway) and now the issue seems to be gone!

I'm using Magisk Canary (21410) and even reinstalling microG DroidGuard Helper after uninstalling it didn't stop it from working.

In MagiskHide microG Services Core is checked (which gets done automatically) and microG DroidGuard Helper is unchecked.

I don't know what's going on. Any explanation for that?

P.S. I'm going to uninstall microG DroidGuard Helper again, because it's pointless, unless someone can tell anything different.

@righy
Copy link

righy commented Feb 22, 2021

I also have this issue. Apps won’t register. I can see GmsGcmRegister: java.lang.RuntimeException: Checkin disabled in the logs on every single failed attempt. Eventually, some apps happen to successfully register at some point, I don’t really know how.

I am using the app com.mrivan.wirepusher and it makes it very clear because it shows a registration failed/success icon on its main screen, and it retries to register every time you go to that screen.

I am using microg 0.2.17 on Android 7.1.2.

Downgrading to 0.2.15 solve the problem. If this regression has been introduced between 0.2.15 and 0.2.16, it must be in one of these commits.

@chris42
Copy link

chris42 commented Feb 23, 2021

@mar-v-in
I just did an install on a new device with 2.17 and noticed, that the device registration is not saved the first time I activate it. I had to activate it a second time after closing microg. Before that second activation push notification registration would not work. After activating it again, it worked without issues.

I saved a log, so if you tell me what to look for I can search.

Would be nice, if anyone could verify that this might be the issue here.

@ghost
Copy link

ghost commented Feb 23, 2021

Could be. I've noticed it toggling back Off on its own after a little while. Then I toggled it Off on purpose later, and when I checked later it was back On.

When it's properly activated, it stays On, though. I've just been using 0.2.15 for setup and then upgrading back to 0.2.17, things work fine that way and it hasn't toggled Off on its own.

@Mrnofish
Copy link

Mrnofish commented Mar 2, 2021

A simple workaround is linked in issue #1408.

@9Lukas5
Copy link

9Lukas5 commented Mar 19, 2021

I tried the workaround from #1408, but Signal still insists on missing Google Services sadly.
I was successful to register Threema now on 0.2.17 however.
This applies to my main phone running LOS18.1 (Android 11), with this patch in a home brew build for signature spoofing permission

On a test device with LOS17.1 (Android 10) I use EdXposed&FakeGapps Module for signature spoofing. This device has also 0.2.17 installed since ... a while, have lost time tracking. Tried installing Threema and Signal today and they both registered just fine.

Can someone confirm, they are able to reproducably get Signal to register with a newly installed MicroG instance on Android 11?

@Master0ne
Copy link

@9Lukas5, I'm on v0.2.18.204714 from the microG F-Droid repo now and have not experienced any problems so far, but I'm not using Signal (yet).

@chris42
Copy link

chris42 commented Mar 19, 2021

I am using Signal (Molly) on Android 11 and it registers and works fine.

@jkehne
Copy link

jkehne commented Mar 21, 2021

I just ran into the same issue when setting up my new phone (i.e., fresh install of the latest build of LineageOS for microG). All apps failed to register for GCM, showing the same "Checkin is disabled" RunTimeException. Since everything was working fine on the old device, I started comparing the contents of /data/data/com.google.android.gms on both devices and found these two lines:

<boolean name="checkin_enable_service" value="true" />
<boolean name="gcm_enable_mcs_service" value="true" />

in shared_prefs/com.google.android.gms_preferences.xml, which were present on the old device, but not the new one. I added the two lines manually via adb, rebooted, and everything appears to work fine now. That is, the device registration switch does not toggle back to off any more and applications register fine; I did not get any push notifications yet.

@righy
Copy link

righy commented Mar 21, 2021

@jkehne What's your Android version?

@Master0ne
Copy link

@jkehne After a fresh installation of microG with all points checked in Self-Check, enable Google device registration, reboot, enable Cloud Messaging, test with Push Notification Tester.

@9Lukas5
Copy link

9Lukas5 commented Mar 21, 2021

@jkehne nice finding, but in my case these were already true :/

Threema, Twitter etc. register fine, but Signal still insists on telling me "no google services installed" on the Android 11 device.^^

@jkehne
Copy link

jkehne commented Mar 21, 2021

@righy Android 10. To be precise, Lineage for microG 17.1, built on Jan 29, 2021. The device is a OnePlus 7.
@Master0ne No need, it's working fine now.

@999eagle
Copy link

<boolean name="checkin_enable_service" value="true" />
<boolean name="gcm_enable_mcs_service" value="true" />

Had the same issue on LineageOS 18.1 with microG 0.2.18.204714 and these two lines fixed it. Push notifications now work as expected.

@RobertoWa
Copy link

I tried the workaround from #1408, but Signal still insists on missing Google Services sadly.
I was successful to register Threema now on 0.2.17 however.
This applies to my main phone running LOS18.1 (Android 11), with this patch in a home brew build for signature spoofing permission

On a test device with LOS17.1 (Android 10) I use EdXposed&FakeGapps Module for signature spoofing. This device has also 0.2.17 installed since ... a while, have lost time tracking. Tried installing Threema and Signal today and they both registered just fine.

Can someone confirm, they are able to reproducably get Signal to register with a newly installed MicroG instance on Android 11?

i am on los 18.1 with microg. i tested a lot but the only way to get signal working was to install signal over the patched playstore.

@matthijskooijman
Copy link

I'm seeing the same on Lineage for Microg 17.1 (Android 10) with microg 0.2.18.204714.

I noticed that:

  • Enabling "Google Device Registration" sets "checkin_enable_service" to true
  • Disabling "Google Device Registration" sets "checkin_enable_service" to false
  • "gcm_enable_mcs_service" is true when "Cloud messaging" is still disabled in the UI
  • Enabling "Cloud messaging" removes the value for "checkin_enable_service" (leaving "gcm_enable_mcs_service" at true)
  • Disabling "Cloud messaging" sets "gcm_enable_mcs_service" to false

Seems like the wires got crossed somewhere?

When I enable "Google Device Registration" and keep "Cloud messaging" disabled, the xml file looks good (both are true), and then reboot, the UI shows both as enabled and apps can register normally. This is similar to #1329 (comment), except that I didn't have to enable "Cloud messaging" after the reboot.

@Mrnofish
Copy link

I'm seeing the same on Lineage for Microg 17.1 (Android 10) with microg 0.2.18.204714.

Stable is now v0.2.19.211515.

@ettavolt
Copy link

I saw GcmPrefs initialized outside persistent process when Gms was checked in and connected to mtalk, but responded with Checkin disabled.
gms.log shows what happened with since a reboot after all permissions were granted but nothing was turned on.
reboot.log is a full version of the same thing (i.e. not filtered with grep -E ' Gms|microg|google.gms').
If cloud-connect process accesses prefs 'outside persistent' one then it's no surprise it 1) can't read what check-in process has saved, 2) it overwrites check-in property with false.

@dequegorg
Copy link

I experience the issue with LineageOS for microG (lineage_sargo-userdebug 11 RQ2A.210405.005 eng.root.20210411.235807 dev-keys) installed on Pixel3a, together with Line App. Ran tests with PushNotificationTester. Logcat output the following, https://pastebin.com/raw/uZEMwqwE which revealed the "GmsGcmRegister: java.lang.RuntimeException: Checkin disabled" and lead me to this thread.

<boolean name="checkin_enable_service" value="true" />
<boolean name="gcm_enable_mcs_service" value="true" />

Had the same issue on LineageOS 18.1 with microG 0.2.18.204714 and these two lines fixed it. Push notifications now work as expected.

Could you please elaborate on how to add these lines and where? Thanks.

@ghost
Copy link

ghost commented Jun 21, 2021

Do you actually need cloud messaging for Line, though? Mine uses it for... something? but it certainly isn't for message notifications. Or are you using Lite? Might be different with Lite.

Regardless, you probably don't need to do that. You may be able to get it to work by just enabling Device Registration, then rebooting, and enabling Cloud Messaging afterwards. Maybe a second reboot for good measure but you should be good like that.

@dequegorg
Copy link

dequegorg commented Jun 21, 2021

@Ammako Yes, Line as in jp.naver.line.android I use this app daily to work and receive calls. Right now not having notifications is impeding my work.

You may be able to get it to work by just enabling Device Registration, then rebooting, and enabling Cloud Messaging afterwards. Maybe a second reboot for good measure but you should be good like that.

So you mean repeat the microG setup in multiple steps and rebooting in-between each time?

PS: untoggled Device Registration and Cloud Messaging---reboot---Enabled Device Registration---reboot---Enabled Cloud Messaging---reboot.

Push Notification Tester:

  • Play Service Installed: Pass
  • Internet Connectivity: Pass
  • Register for Push Notification: Fail
  • Connection to Server: Fail

PPS: are you running Line on LineageOS w/ MicroG?

@ghost
Copy link

ghost commented Jun 21, 2021

Like I said, I've never had issues getting notifications from Line even without Play Services or microG, but maybe it's different for you for some reason. Closed-source app, who could tell -shrugs-

Depending on the app, it's possible you may need to reset it by clearing its data, before microG is able to pick it up. I'm not sure if that could apply to that push notifications tester app.

Do both options show up as On when you check microG settings? And it doesn't work still?

If all else fails, you may have luck downgrading microG to 0.2.15 (gotta clear microG app data in the process), setting up your apps under that older version, and after that you can update back to newest. You'll have to enable usb debugging and give root permissions to adb, and then replace the .apk at /system/priv-app/GmsCore using adb push. I'll give you better instructions later when I'm home, if someone else won't already have done it by then.

@dequegorg
Copy link

Like I said, I've never had issues getting notifications from Line even without Play Services or microG, but maybe it's different for you for some reason. Closed-source app, who could tell -shrugs-

Depending on the app, it's possible you may need to reset it by clearing its data, before microG is able to pick it up. I'm not sure if that could apply to that push notifications tester app.

Do both options show up as On when you check microG settings? And it doesn't work still?

If all else fails, you may have luck downgrading microG to 0.2.15 (gotta clear microG app data in the process), setting up your apps under that older version, and after that you can update back to newest. You'll have to enable usb debugging and give root permissions to adb, and then replace the .apk at /system/priv-app/GmsCore using adb push. I'll give you better instructions later when I'm home, if someone else won't already have done it by then.

So the PushNotificationTester didn't work. But somehow now several apps, incl. Line, registered. So it work as far as my particular issue is concerned. Thanks!

@ale5000-git
Copy link
Member

Everything should already be fixed on the latest version so I close it for now.
Open a new issue if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests