microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
8.47k stars 1.71k forks source link

Discord push notifications are broken #540

Closed ahstro closed 5 years ago

ahstro commented 6 years ago

Discord does not register for push notifications, even though the setting is enabled. Push notifications work for other apps, e.g. Slack. I've tried removing and reinstalling the app, because I heard apps need to be installed after microg/spoofing/something is set up and I couldn't remember if it was, but that didn't help.

xeals commented 6 years ago

I've set up a new phone yesterday and I can't register Discord at all. I get a notification saying that Google Play Services need to be updated. May be related.

nermolov commented 6 years ago

Can confirm this issue on my end as well.

bmccoy11 commented 6 years ago

Riot's push notifications don't appear to be working for me either.

Phantop commented 6 years ago

Getting the same Play Services update error, even with Cloud Messaging enabled and with FakeStore on MicroG Lineage. Downgrading to older versions makes the app get stuck on a Recaptcha

Phantop commented 6 years ago

I skipped back a bit and can confirm that 6.4.7 works. Newer versions may work, I skipped by 5 months

nermolov commented 6 years ago

@Phantop I tried downgrading to 6.4.7 and it still would not register with microg

pejakm commented 6 years ago

Riot's push notifications don't appear to be working for me either.

I can confirm this, too.

pejakm commented 6 years ago

I have updated to the 0.2.4-118 (download link here: https://forum.xda-developers.com/showpost.php?p=76709522&postcount=4710) but still some apps cannot register, like the tester app shown below, and simply crash afterwards.

screenshot_2018-06-03-22-06-12

Any suggestions how to get a usable logcat output for this crash is welcome (pinging @mar-v-in and @ale5000-git for help).

pejakm commented 6 years ago

log.txt log2.txt

Okay, here are some logs, hope they will help.

ahstro commented 6 years ago

Sorry for off-topic, but @pejakm, what is that tester app called?

pejakm commented 6 years ago

@ahstro https://play.google.com/store/apps/details?id=com.firstrowria.pushnotificationtester

chris42 commented 6 years ago

My experience: microg only supports methods of registering push notifications for GCM. Since October/November last year most Apps now use the new version called FCM. Apparently that does not work with microg and I do not know if there will be a fix. Hence you might see very different results for each app, depending if it upgraded or not. Hence notification tester might work, but app not. For some apps it helps to install an older version from last year first and then upgrade.

Also please note Push notification registration problems are different than the google framework version problems. Only if you get the explicit message for the google framework version you have an issue there. With Discord it seems you have both problems, FCM and current version number of google framework is needed.

DPTJKKVH commented 6 years ago

Please check if it works again with the most recent version: 12.8.79 found on f-droid.

https://github.com/microg/android_packages_apps_GmsCore/commit/4040e3df85db5dd59ed3028978a33eb92d7f4e46

ale5000-git commented 6 years ago

@ahstro @pejakm The latest version of microG GmsCore is currently 0.2.5.12879, please try it.

pejakm commented 6 years ago

@ale5000-git Push Notifications Tester now works, apps like WhatsApp and Riot work, but again Viber is problematic, it only gets notifications first few times after re-install, but later it only gets messages when opened. The OP reported this for Discord, I do not use it so cannot test, sorry.

liz-desartiges commented 6 years ago

Push notification tester still crash and no apps seams to be able to register since I updated (I use lineages 1.5.1 for microg).

ale5000-git commented 6 years ago

@frstrikerman Have you verified manually that you have microG GmsCore 0.2.5.12879? Many times F-Droid make believe that it is updated but it isn't (this apply specially to microG GmsCore).

liz-desartiges commented 6 years ago

@ale5000-git yes I did

ale5000-git commented 6 years ago

Have you tried to clear app data of Push notification tester and then re-granting all permissions?

liz-desartiges commented 6 years ago

@ale5000-git I just tried that and push notification tester still crash. In microg settings the current state is disconnected

chris42 commented 6 years ago

The patch out of #439 still has some issues. The registered apps will not show as registered in microg settings, however will work to deliver push messages. Only a few apps have troubles (so far known: Threema) I tested the push notification tester on microg 0.2.5.12879 on AOSP and it worked.

pejakm commented 6 years ago

Only a few apps have troubles (so far known: Threema)

  1. Signal can't register;
  2. Viber works for few hours after fresh install or reinstall, then does not receive notifications.
chris42 commented 6 years ago

@pejakm Could you please send some logs, especially captured during registration. e.g. via catlog

Also please make sure the following was done before:

pejakm commented 6 years ago

@chris42 All checked.

I manage to capture some output, note sure if it's related:

09-08 17:58:03.844 29986 30880 D GmsGcmMcsSvc: I/O error: javax.net.ssl.SSLException: Read error: ssl=0x7928123c00: I/O error during system call, Connection timed out
09-08 17:58:03.844 29986 30004 D GmsGcmMcsSvc: Teardown initiated, reason: javax.net.ssl.SSLException: Read error: ssl=0x7928123c00: I/O error during system call, Connection timed out
09-08 17:58:03.845 29986 30004 D GmsGcmMcsSvc: Scheduling reconnect in 5 seconds...
...
09-08 17:58:08.858  1820  2243 V AlarmManagerServiceEx: ELAPSED_WAKEUP set : Alarm{b8bea1b statsTag *walarm*:org.microg.gms.gcm.mcs.RECONNECT type 2 when 457659215 com.google.android.gms} when 457659215
09-08 17:58:08.869 29986 29986 D GmsGcmMcsSvc: Connection is not enabled or dead.
09-08 17:58:08.869 29986 29986 D GmsGcmTrigger: Not connected to GCM but should be, asking the service to start up. Triggered by: Intent { act=org.microg.gms.gcm.mcs.RECONNECT flg=0x14 cmp=com.google.android.gms/org.microg.gms.gcm.TriggerReceiver (has extras) }
09-08 17:58:08.876 29986 30004 D GmsGcmMcsSvc: Connect initiated, reason: Intent { act=org.microg.gms.gcm.mcs.RECONNECT flg=0x14 cmp=com.google.android.gms/org.microg.gms.gcm.TriggerReceiver (has extras) }
09-08 17:58:08.878 29986 30004 D GmsGcmMcsSvc: Connection is not enabled or dead.
09-08 17:58:08.882 29986 30004 D GmsGcmMcsSvc: Starting MCS connection...
09-08 17:58:08.959  1820  2257 I chatty  : uid=1000(system) InputDispatcher expire 10 lines
09-08 17:58:08.961 32010 32010 I ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
09-08 17:58:09.153 29986 30004 D GmsGcmMcsSvc: Connected to mtalk.google.com:5228
09-08 17:58:09.153 29986 30004 D GmsGcmMcsSvc: Activated SSL with mtalk.google.com:5228
09-08 17:58:09.219  2348  2348 I NetworkController.WifiSignalController: Change in state to: connected=true,enabled=true,level=2,inetCondition=1,iconGroup=IconGroup(Default Wi-Fi Icons),activityIn=true,activityOut=true,rssi=-57,,ssid="HAARP",isGigaWiFi=false,isAttWifiCall=false
09-08 17:58:09.283  1820  2258 I chatty  : uid=1000(system) InputReader expire 12 lines
09-08 17:58:09.289 32010 32010 I ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
09-08 17:58:09.408 29986 30004 D GmsGcmMcsSvc: Scheduling heartbeat in 900 seconds...
09-08 17:58:09.409 29986 32421 D GmsGcmMcsSvc: Sending login request...
09-08 17:58:09.410 29986 32421 D GmsGcmMcsOutput: Outgoing message: LoginRequest{id=android-24, domain=mcs.android.com, user=3829107795434326578, resource=3829107795434326578, auth_token=2909441624381259991, device_id=android-3523b940a18aca32, setting=[Setting{name=new_vc, value=1}], received_persistent_id=[0:1536420999578758%a3bffb5f00000031], adaptive_heartbeat=false, use_rmq2=true, auth_service=ANDROID_ID, network_type=1}
09-08 17:58:09.410 29986 32421 D GmsGcmMcsOutput: Write MCS version code: 41
09-08 17:58:09.506 29986 32420 D GmsGcmMcsInput: Reading from MCS version: 41
09-08 17:58:09.541 32010 32010 I ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
09-08 17:58:09.605 29986 32420 D GmsGcmMcsInput: Incoming message: LoginResponse{id=android-24, jid=3829107795434326578@mcs.android.com/3829107795434326578, setting=[], last_stream_id_received=1, server_timestamp=1536422287414}
09-08 17:58:09.606 29986 32420 D GmsGcmMcsSvc: Logged in
09-08 17:58:09.612 29986 32420 D GmsGcmMcsInput: Incoming message: IqStanza{type=SET, id=B818B925, from=mcs.android.com, to=3829107795434326578@mcs.android.com/3829107795434326578, extension=Extension{id=12, data=ByteString[size=0]}, account_id=-1}
09-08 17:58:09.612 29986 32420 W GmsGcmMcsSvc: Unknown message: IqStanza{type=SET, id=B818B925, from=mcs.android.com, to=3829107795434326578@mcs.android.com/3829107795434326578, extension=Extension{id=12, data=ByteString[size=0]}, account_id=-1}

Other stuff I noticed:

09-08 17:59:59.669  1481  1519 I TextSecurePreferences: Setting push registered: false
...
09-08 17:59:59.703 29986  1575 D GmsGcmRegisterSvc: onHandleIntent: Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (has extras) }
09-08 17:59:59.705 29986  1575 D GmsGcmRegisterSvc: register[req]: Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gms (has extras) } extras=Bundle[{sender=312334754206, app=PendingIntent{67f6eab: android.os.BinderProxy@b3c6908}, google.message_id=google.rpc1, google.messenger=android.os.Messenger@4e958a1}]
09-08 17:59:59.714 29986  1575 D GmsHttpFormClient: -- Request --
09-08 17:59:59.714 29986  1575 D GmsHttpFormClient: X-GOOG.USER_AID=3829107795434326578&device=3829107795434326578&app=org.thoughtcrime.securesms&cert=45989dc9ad8728c2aa9a82fa55503e34a8879374&app_ver=404&sender=312334754206
09-08 17:59:18.119  2456  6465 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:-1 android.content.ContextWrapper.bindService:-1 com.google.android.gms.common.stats.zzb.zza:-1 com.google.android.gms.common.internal.zzo$zzb.zzhu:-1 com.google.android.gms.common.internal.zzo.zza:-1 
09-08 17:59:18.124  1820 27407 W ActivityManager: Unable to start service Intent { act=com.google.android.gms.icing.APP_INDEXING_SERVICE pkg=com.google.android.gms } U=0: not found
09-08 17:59:18.125  1820  2813 W ActivityManager: Unbind failed: could not find connection for android.os.BinderProxy@2acd8fa
09-08 17:59:18.125  2456  6465 E GmsClient: unable to connect to service: com.google.android.gms.icing.APP_INDEXING_SERVICE on com.google.android.gms
09-08 17:59:18.131  2456  6465 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:-1 android.content.ContextWrapper.bindService:-1 com.google.android.gms.common.stats.zzb.zza:-1 com.google.android.gms.common.internal.zzo$zzb.zzhu:-1 com.google.android.gms.common.internal.zzo.zza:-1 
09-08 17:59:18.132  2456   950 I SettingAppIndex: cursor size : 352, mIterator size : 306
09-08 17:59:18.133  1820  8335 W ActivityManager: Unable to start service Intent { act=com.google.android.gms.icing.APP_INDEXING_SERVICE pkg=com.google.android.gms } U=0: not found
09-08 17:59:18.134  1820  2814 W ActivityManager: Unbind failed: could not find connection for android.os.BinderProxy@910beab
09-08 17:59:18.135  2456  6465 E GmsClient: unable to connect to service: com.google.android.gms.icing.APP_INDEXING_SERVICE on com.google.android.gms
09-08 17:59:18.137  2456   950 D SettingAppIndex: doAppindex -- STOP_APPINDEX !!
09-08 17:59:18.137  2456   950 I SettingAppIndex: end app index time :1536422358137
09-08 17:59:18.137  2456   950 I SettingAppIndex: done calculated time :24
09-08 17:59:18.142  2456  6465 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:-1 android.content.ContextWrapper.bindService:-1 com.google.android.gms.common.stats.zzb.zza:-1 com.google.android.gms.common.internal.zzo$zzb.zzhu:-1 com.google.android.gms.common.internal.zzo.zza:-1 
09-08 17:59:18.146  1820  3163 W ActivityManager: Unable to start service Intent { act=com.google.android.gms.icing.APP_INDEXING_SERVICE pkg=com.google.android.gms } U=0: not found
09-08 17:59:18.147  1820  1849 W ActivityManager: Unbind failed: could not find connection for android.os.BinderProxy@97b7908
09-08 17:59:18.147  2456  6465 E GmsClient: unable to connect to service: com.google.android.gms.icing.APP_INDEXING_SERVICE on com.google.android.gms
pejakm commented 6 years ago

Ah, just tried with another number, and went through. So Signal works with microG.

chris42 commented 6 years ago

Good to hear. If you are still looking into viber, check the logs for the "GmsGcmMcsInput" messages. These should appear in the log when a message is received.

timea-techgirl commented 6 years ago

Possible workaround: https://github.com/microg/android_packages_apps_GmsCore/issues/631#issuecomment-429013399

Littner64 commented 5 years ago

Version 5.7.9 solves the connection problem: https://www.apkmirror.com/apk/discord-inc/discord-chat-for-gamers/discord-chat-for-gamers-5-7-9-release

ale5000-git commented 5 years ago

The problem should be fixed in recent versions of microG GmsCore, I'm closing this for now. Please try it and report back.

nathanfranke commented 1 year ago

This resolved my issue https://github.com/microg/GmsCore/issues/1573#issuecomment-1066064144