signalapp / Signal-iOS

A private messenger for iOS.
https://signal.org
GNU Affero General Public License v3.0
10.62k stars 2.96k forks source link

No Push Notifications since upgrade to iOS 13 #4280

Closed lorenzhs closed 1 year ago

lorenzhs commented 4 years ago

Bug description

Since the day of the upgrade to iOS 13, I don't receive push notifications for messages any more. I sometimes get notifications hours later. Upon opening the app, all outstanding messages are received and I get the notifications for them.

This includes sync with the Desktop app: if I have an unread message on iOS (sometimes they do arrive, typically hours late) and open the Desktop app, Signal-iOS does not update its notification state. Only when I do open the iOS app does it update the state, marks the message as read, and syncs any other messages sent (via Desktop) and received in the meantime. (This is not really surprising, since signalling between Desktop and mobile uses the same mechanism, I just wanted to clearly rule out the Desktop app as a cause)

Steps to reproduce

Unclear. I never had issues using iOS 12, but since the day I updated to iOS 13 the issue has been present. There was no point in time where I was using iOS 12 and the issue was there, and at no point since the update to iOS 13 has it not been there, so I suppose (without hard proof) that somehow was the trigger. However, friends who also updated to iOS 13 report that everything works fine for them.

Actual result: Not receiving push notifications

Expected result: Should receive push notifications for incoming messages.

Re-registering for push notifications in the advanced settings tab does not help. A soft wipe of the phone ("Reset all settings") causes Signal to re-request notification permissions from the system, but doesn't help either.

Screenshots

N/A

Device info

Device: iPhone 7

iOS version: 13.4, issue first appeared with 13.0 and was also present in 13.1, 13.2, and 13.3 (including their point releases)

Signal version: 2.43.3.1 – 3.7.1.0, plus some earlier versions

Link to debug log

https://debuglogs.org/58c7e0894ea57f59f53b473ad7c079e5fe77a0e5ed01f69f4d0b41cd66f0a285.zip (it's a few days old, only got around to filing the issue now. It still persists.)

https://debuglogs.org/18e866c013e3fc0f6be7b7954f0d5978c7e9474e9db6b0be537867cbedc77074.zip is a recent minimal example using 2.45.0.

I think 2019/10/02 17:59:25:334 is a good example, where three hours after last sending a message Signal suddenly receives a bulk of outstanding messages, starting with [AppDelegate.m:1186 -[AppDelegate application:performFetchWithCompletionHandler:]]: performing background fetch. To my layman's eyes, this looks like Signal is falling back to websockets instead of the Apple Push mechanism, but I may be wrong.

Also, this is unrelated to #3474, #2312, etc – I'm using the official app store app, not a custom build.

awaitlink commented 4 years ago

To my layman's eyes, this looks like Signal is falling back to websockets instead of the Apple Push mechanism, but I may be wrong.

I don't think Signal iOS uses any other method of receiving "pings" about new messages other than Apple push notifications. It still has to fetch the messages themselves, that's why it uses a background connection.

lorenzhs commented 4 years ago

Makes sense. For the record, I tried "Re-register for push notifications" multiple times and it didn't help.

Mobile Data (not that the type of network makes a difference - I don't get notifications on WiFi either), Background App Refresh and Notification permissions are allowed.

KazaiMazai commented 4 years ago

I've looked through the code, it seems like the issue is related to iOS13 voIP push notifications policy.

According to docs, in iOS 13, voip push notification should be reported to CallKit right in didReceiveIncomingPushWith method. Otherwise the app will crash if it's built in iOS13 SDK or the system will stop deliver voip push notifications to the app for older SDK versions.

Reporting voip push notification to CallKit forces presentation of Call UI.

The problem is that voIP push notifications are currently used to force the app to fetch new messages from server. So they are sent to client on every new MESSAGE.

In that case, incoming call UI may just look weird.

All this is to force developers to use voIP push notifications only for real calls and avoid abusing the system, making apps alive from the background via voIP push notifications.

It seems that now, message refresh process needs a significant upgrade both on server and client.

Correct me if I'm wrong

lorenzhs commented 4 years ago

I have confirmed that other people using Signal on iOS 13 do not have this problem, so no, I don't think it's related to that.

varjolintu commented 4 years ago

I'm also having an issue related to this. Notifications for Signal are enable, but if I don't enable them for lock screen, notification center or banner (so just badges are enabled), I don't get notifications at all. The icon always looks like there are no new messages, and the messages are only received when opening the application.

lorenzhs commented 4 years ago

I think you’re experiencing a different issue, I have all types of notifications enabled. Rebooting doesn’t help, it’s not a one-off runtime state confusion thing.

Signal developers, please let me know if I there is something I can do to help debug this, it limits the usefulness of Signa enormously for me.

segnome commented 4 years ago

I have the same problem since upgrading from iOS 13. I will try to "Re-register for push notifications" to see if that resolves the problem tonight.

segnome commented 4 years ago

I have the same problem since upgrading from iOS 13. I will try to "Re-register for push notifications" to see if that resolves the problem tonight.

This fixed the issue.

lorenzhs commented 4 years ago

Not for me, unfortunately. I’ve tried numerous times.

varjolintu commented 4 years ago

The latest update fixed the issue for me.

lorenzhs commented 4 years ago

Not for me. Here's a minimal debug log showing the issue in the current version, 2.45.0.29: https://debuglogs.org/18e866c013e3fc0f6be7b7954f0d5978c7e9474e9db6b0be537867cbedc77074.zip. I sent the messages as "note to self" from the Desktop client while the app was in the background, they were only received once I opened the app, not while it was in the background.

Exact flow:

  1. Open Signal-iOS, enable debug logging, re-register for push notifications. Go back to home screen.
  2. On Signal-Desktop, write a message as note to self. Wait a few seconds. Nothing happens.
  3. Open Signal-iOS. Note to self is received. Send note to self from Signal-iOS. Go back to home screen.
  4. same as 2
  5. Open Signal-iOS. Note to self is received. Submit debug log.
segnome commented 4 years ago

I have the same problem since upgrading from iOS 13. I will try to "Re-register for push notifications" to see if that resolves the problem tonight.

This fixed the issue.

The issue is back. No notifications unless I open the app. Is this possibly due to iOS 13 killing apps for memory more aggressively or due to how signal leverages the voip api?

lorenzhs commented 4 years ago

The issue is back. No notifications unless I open the app. Is this possibly due to iOS 13 killing apps for memory more aggressively or due to how signal leverages the voip api?

I don't think so.

a) As far as I know, the more aggressive app killing started only in iOS 13.2, but I've experienced the issue starting with iOS 13.0 b) I know people using Signal on iOS 13 without issue, so it's not the VoIP API or something else affecting everyone on iOS 13. It appears to affect only a few people.

optionalg commented 4 years ago

i have the same issue. 2 x iphone max and one has notification issue and other doesn’t

notifications work while phone is open or in app. then after the phone locks is when the notifications stop working

seems to be mix of ios 13 issues and messages apps like signal and even slack as phone having notification problems in signal also is not getting slack notifs

but both apps get notif while phone is unlocked and open

lorenzhs commented 4 years ago

That also seems to be a different issue, I don't get notifications when the phone is unlocked but Signal isn't open. The only scenario where I do receive notifications is when Signal is the foreground app, and connects using its websocket (= pull, not push). I don't get any kind of push notifications for Signal, but all other apps (WhatsApp, ...) work fine.

lorenzhs commented 4 years ago

The end result seems very similar to what is being described in this thread: https://twitter.com/moxie/status/1170746493612855296 — it’s around the same time (11 days before iOS 13 release) and phrased from the perspective of the sender whose messages aren’t being received. Also https://community.signalusers.org/t/unreliable-message-delivery/9784.

I‘ve confirmed with others that messages they send to me aren’t being marked delivered for them, which of course makes sense because they’re not being delivered until I open the app.

mdsundquist commented 4 years ago

I have an iPhone 7+ and am also only getting new messages upon opening the app or having it open. I recall having this exact problem after upgrading to 13.0 and never being able to figure out why. I soft reset, I disabled and re-enabled push notifications--at some point it just started working again. If it was due to the release of an incremental OS update or a Signal app update, I never made the connection.

As soon as I upgraded to 13.2.2, it broke push notifications for Signal and for the LINE messaging app. I did a combination of toggling background refresh and push notifications and soft resetting but nothing worked. For the time being, I seem to have resolved the issue for LINE by uninstalling and reinstalling the app (LINE was last updated in the App Store two weeks ago, so I don't think that is responsible for the fix). But as the iOS version of Signal doesn't have message backup, I haven't been willing to try that method here.

I found this blog article: iOS 13 and Xcode 11 Changes That Affect Push Notifications. I knew about the TLS and the VoIP changes but not the other ones. I had discounted it being an OS issue seeing as these problems are not affecting all users and has only intermittently affected me. On the other hand, more than one of my apps has been affected. Frankly, I'm at a loss.

egberts commented 4 years ago

Still an issue for me, verbatim as outlined by original issuer.

mrjensen commented 4 years ago

I had the same issue on my iPhone 7. I could only "fix" it by uninstalling/reinstalling Signal, but that removes the entire history of messages.

I don't know if the issue is Signal-specific since I had the same issue with Slack and Messenger. All solved by uninstalling and reinstalling. Togging notifications, data, background app refresh, and do not disturb had no effect.

lorenzhs commented 4 years ago

Thanks @mrjensen, I haven't reinstalled Signal so far because I'm not willing to just delete years of message history like that. However, I didn't experience the issue with any other apps, but then I don't have Slack or FB Messenger installed.

I might try a soft wipe ("Reset all settings"), maybe that helps, too. It'll reset notification permissions, maybe that's enough.

lorenzhs commented 4 years ago

I tried a soft wipe of my phone (Settings -> General -> Reset -> Reset all settings) and it didn't help either, which is quite frustrating. As a result of the soft wipe, Signal asked for notification permission again when I started it for the first time, which I granted, but I'm still not getting push notifications. Re-registering for push notifications from Signal's settings didn't help either.

I'm kinda out of ideas here, short of losing three years' worth of messaging history by reinstalling Signal :/

Crisses commented 4 years ago

I don't believe Note to Self triggers notifications. Because the app is already open and the message is received on the device with the application active. It's not the best way to test notifications across devices. I'm having a similar (but different) notification issue that was possibly triggered either by relinking a desktop or changing notification preferences on my iPad linked device. Just upgrading to 3.2.0.10 and trying to see whether anything changes but need someone to message me to be certain of what's going on.

lorenzhs commented 4 years ago

Note to self doesn't trigger a notification, but there's a visible difference between "the push was received and the note to self is already processed" and "no push was received, the app first has to establish a connection to the servers and receive the message". Not that it matters, it's exactly the same as when other people message me, it's just easier to reproduce in testing than constantly bugging people. Also, 3.2.0.10 didn't change anything for me.

optionalg commented 4 years ago

to clarify... note to self was between diff phone numbers between multiple phones and always had triggered push notif

i have my multiple phones in a group chat and tried sending that way as well

On Tue, Jan 21, 2020 at 12:49 AM Crisses notifications@github.com wrote:

I don't believe Note to Self triggers notifications. Because the app is already open and the message is received on the device with the application active. It's not the best way to test notifications across devices. I'm having a similar (but different) notification issue that was possibly triggered either by relinking a desktop or changing notification preferences on my iPad linked device. Just upgrading to 3.2.0.10 and trying to see whether anything changes but need someone to message me to be certain of what's going on.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/signalapp/Signal-iOS/issues/4280?email_source=notifications&email_token=AABSE7CBKUKUWUBIGY75UHTQ6XBZVA5CNFSM4I63X2X2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJNB46A#issuecomment-576331384, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABSE7BICMMXH6ZCW7EW5K3Q6XBZVANCNFSM4I63X2XQ .

Crisses commented 4 years ago

I only have one phone number and didn't know that Signal could support several phone numbers for the same user/account. shrugs Between different phone numbers, a notification makes more sense. I guess. By playing with the notifications (turned off, turned on, enabled full text on lockscreen, then turned full text to unlocked only) finally got my iPad notifications back on and the way I want them. No such luck on my iPhone yet.

Crisses commented 4 years ago

Note to self doesn't trigger a notification, but there's a visible difference between "the push was received and the note to self is already processed" and "no push was received, the app first has to establish a connection to the servers and receive the message". Not that it matters, it's exactly the same as when other people message me, it's just easier to reproduce in testing than constantly bugging people. Also, 3.2.0.10 didn't change anything for me.

Got it — and was able to replicate the issue between devices: change the Signal in-app privacy setting to show the screen on the app-switcher (disable the privacy setting). The app switcher screen on iPad (9.7 inch iPad Pro running 13.3 & signal 3.2.0.10 -- which for me works properly) updates with new messages when I note-to-self on desktop, but not on the iPhone (iPhone SE running OS 13.3 & signal 3.2.0.10 ). No push is received; the preview in the app switcher doesn't show new messages.

Thank for the tip, figured I'd spell it out for anyone else who might want to replicate it.

Crisses commented 4 years ago

Nothing I tried worked to get notifications back, including deleting the app (keeping the data) and reinstalling. So I deleted the whole app & data, relinked my 2 shared devices. The shared devices have history and the iPhone does not, but most of my contacts are on 1-week deleting messages anyway. This resolved the 2 issues I had — the iphone notifications now work (and the iPad now is shown in linked devices since relinking see issue 4362.

lorenzhs commented 4 years ago

@Crisses you never really described what your issue is, but I'm pretty certain it's not the same as this one, so I think it would be best if you created a new issue (and maybe linked your comments here). Otherwise things become confusing.

I've also mentioned above that offloading doesn't help.

wvreeven commented 4 years ago

I have the same issue on my iPhone 11 running iOS 13.3.1 and the latest version of Signal (3.3.0). I do not receive any notifications unless I open the Signal app. I haven't tried completely uninstalling and then reinstalling the app yet since it looks it doesn't work for everybody. I did Reset All Settings on my iPhone and that didn't help.

Is there any news on this issue?

By the way, I have the same issue with WhatsApp but not with Slack. I only installed Slack after installing iOS 13.3.0but before 13.3.1 so it may be related to that version of iOS after all...

lorenzhs commented 4 years ago

Nothing's changed for me either. I do receive notifications for WhatsApp, though. On my phone, it's only Signal that's having this issue.

wvreeven commented 4 years ago

I decided to reinstall WhatsApp and now the notifications are back there. It makes me wonder if I should reinstall Signal as well. I don't like that I need to be added to all my groups again though and I really would like to not lose the message history either. But that's a different matter of course.

wvreeven commented 4 years ago

I did Reset All Settings on my iPhone and that didn't help.

After Reset All Settings I noticed that my Apple Watch started showing sunset and sunrise for my location again. As a matter of fact, the Watch Faces app re-requested permission to use location services. So I decided to bite the bullet and to reinstall Signal again. Now the notifications are working again! Definitely something fishy with iOS 13!

linhaosunny commented 4 years ago

I've looked through the code, it seems like the issue is related to iOS13 voIP push notifications policy.

According to docs, in iOS 13, voip push notification should be reported to CallKit right in didReceiveIncomingPushWith method. Otherwise the app will crash if it's built in iOS13 SDK or the system will stop deliver voip push notifications to the app for older SDK versions.

Reporting voip push notification to CallKit forces presentation of Call UI.

The problem is that voIP push notifications are currently used to force the app to fetch new messages from server. So they are sent to client on every new MESSAGE.

In that case, incoming call UI may just look weird.

All this is to force developers to use voIP push notifications only for real calls and avoid abusing the system, making apps alive from the background via voIP push notifications.

It seems that now, message refresh process needs a significant upgrade both on server and client.

Correct me if I'm wrong

so, how to fix it, instand of Apple APNs Push?

dbw2018 commented 4 years ago

I have had this issue with Signal, since iOS 13.1. All other apps worked fine with notifications. Signal produced notifications only when Signal was the front active app and only in the app. Then two days ago, I tried to update iOs on my iPhone SE, to 13.4 (17E255) via iTunes (MacOs 10.13.6) via USB. But the update failed 3 times with "Unknown error error code 9". Note that I have never had any issues when updates for iPhone (and I have had iPhones since iPhone3G). This was the first time that I experienced an error with an update. I then made a factory reset including installation of iOS 13.4 and a restore from backup. Notifications works now with Signal.

lorenzhs commented 4 years ago

I don't think your update problems are related. I could update to 13.4 just fine (OTA), but still no Signal notifications. A reinstallation fixes the issue, but as it results in complete loss of message history, it's not a solution for everyone. I'd rather not get notifications than lose my message history.

egberts commented 4 years ago

Need to figure out what was had before the reinstallation and what is new, replaced, or deleted after the installation. Not an easy task.

dbw2018 commented 4 years ago

....A reinstallation fixes the issue, but as it results in complete loss of message history, it's not a solution for everyone. I'd rather not get notifications than lose my message history.

lorenzhs, I sync with Signal Desktop, on my mac: Reinstallation of my iphone didn't delete data on Signal Desktop. Just a work-around backup...

jeffgerbenkok-01 commented 4 years ago

I have the same problem since IOS 13.3. Plus it seems completely ramdom which apps on the phone are affected. I tried all the recommendations I could find, except a complete re-install of the phone. any updates from your side?

lorenzhs commented 4 years ago

No updates from me, sorry. The only thing that's helped for anyone in this thread is reinstalling Signal (no need to wipe the phone), which I don't want to do. A soft wipe ("reset all settings") didn't help, even though Signal asked for notification permission again.

egberts commented 4 years ago

Yeah, took the plunge. Lost my entire conversation thread. Notification seems to be working now.

lorenzhs commented 4 years ago

I now sometimes get push notifications since (re-)enabling registration lock. I had disabled it some time ago (unfortunately, I do not remember whether that was before or after I first had this issue) and re-enabled it yesterday. Now I sometimes receive notifications for messages something like an hour after they were sent. I have not received one when the message was sent, all of the notifications I received were delayed.

jascosius commented 4 years ago

I solved the problem for me using the following workaround, but you'll need a second iPhone for this to work: Install Signal on the old phone, register your number, transfer your Signal data to the old phone, delete and reinstall Signal on the first iPhone (Signal will ask for notification permissions), transfer your data back. This worked fine for me, now Signal notifications work again on my phone and I've still my conversation history. It might be no universal solution but maybe there's someone who finds this helpful.

derekhardwick commented 3 years ago

This problem recently appeared for me (Signal 3.16.0.13), iOS 13.7). No notifications, no badging. Disabling/re-enabling notifications doesn't help, quitting/launching the app, re-registering for push notifications, etc.

I see that others have had success with re-installing the app, but I'm hesitant to do this and lose message history. Also I now have to export photos one-by-one (no multi-select). This compounding of issues is not so much fun...

egberts commented 3 years ago

I agree. There should be a special iOS button just to re-register Apple Notification.

derekhardwick commented 3 years ago

I see that others have had success with re-installing the app, but I'm hesitant to do this and lose message history. Also I now have to export photos one-by-one (no multi-select). This compounding of issues is not so much fun...

Just a follow-up, this is how I fixed the issue, and it does appear to work. This does exemplify the need for backup/export/import functionality. In the end I had to borrow a friend's iPhone, migrate to that, delete and reinstall signal on my phone, then migrate back to my phone in order to fix the issue and keep my own data. The 'no export to iCloud for security reasons' is a bit ridiculous if users have to, for example, put all their data on a borrowed phone if they want to keep it.

lorenzhs commented 3 years ago

I agree. There should be a special iOS button just to re-register Apple Notification.

Such a button exists ("Re-register for push notafications") but it doesn't help with this issue.

ghabiger commented 2 years ago

I have the same issue, started with 14.7.1. I think. Upgrading to iOS 15 did not fix this.

Re-Registering Push Notifications does not fix this.

This is beyond just 'annoying', it precludes Signal from being used as a messenger or messaging App. If I can't get push notifications when people are trying to reach me, how am I supposed to use Signal for conversations?

Details: iPhone Xs Max with iOS 15.0 Most recent/current version of Signal for iOS (5.20.2) All permissions enabled for Signal in iOS Settings Re-registered for push notifications etc. Not in Focus/DnD Mode on the iPhone, other app notifications work just fine.

I simply receive no notifications from Signal whatsoever, and have to manually open the App and check whether new messages have arrived since I last opened it.

Please fix this, it's a bug that makes Signal basically unusable as a daily messaging solution, which sucks, because I've managed to persuade many friends to switch over from other apps recently.

lorenzhs commented 2 years ago

Aww man, it sucks that this still appears to be happening - I never found a way to fix it. The only way that preserves your messages is to use a second iPhone and transfer Signal there (and then back to the original phone after reinstalling the app).

This might be a fairly rare issue, but it’s hard to image one that breaks more than this one for those affected. It’s really bad.

stale[bot] commented 2 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

lorenzhs commented 2 years ago

@ghabiger @jeffgerbenkok-01 did this get fixed for you? If so, can you update here please?