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

iOS notifications only work in the foreground #4971

Open
2 tasks done
Gys opened this issue Jun 25, 2024 · 5 comments
Open
2 tasks done

iOS notifications only work in the foreground #4971

Gys opened this issue Jun 25, 2024 · 5 comments

Comments

@Gys
Copy link

Gys commented Jun 25, 2024

Checklist

  • I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
  • This issue only relates to a single feature. I will open new issues for any other features.

Is your feature request related to a problem?

IOS notifications are working in the latest develop branch. The app asks correctly if notifications are allowed to show. But then notifications are shown only while the app is running in the foreground.

If I create a notification to be shown a few seconds later and send the app to the background nothing happens. Only going back to the app will trigger showing the notification (which can be much later or never).

Is it possible to construct a solution with the existing API?

This might be related to some bug or configuration problem on iOS.

Describe the solution you'd like to see.

On Android this works correctly: even while an app is in the background, notifications from that app will be shown at the required moment.

Only showing notifications while the app is in foreground is not very useful. The app already has full attention.

@Jacalz
Copy link
Member

Jacalz commented Jun 25, 2024

Duplicate to or related to #3656 possibly?

@Gys
Copy link
Author

Gys commented Jun 25, 2024

That issue is about remote push notifications and mobile in general. This issue is about local push notifications and specific for iOS only. This works on platforms like Darwin and Android, but not for iOS.

@andydotxyz
Copy link
Member

It's not related to whether the app is foregrounded but whether it is running according to the OS (as I understand it anyhow). We don't have any background service support so as soon as the OS suspends your app the code won't run and notifications won't send.

@Gys
Copy link
Author

Gys commented Jun 25, 2024

I am sure there is no background processing possible on iOS. The only thing coming close is sending a silent remote push notification which 'wakes up' the app for a moment (if the OS chooses to allow it). At that moment the app can do things in the background.

@andydotxyz You mentioned elsewhere that on mobile notifications would be shown if the app was in the background. So that is only for Android then.

Sorry, I was hoping I missed something about local notifications on iOS. So this indeed related to #3656

PS: it is possible to setup a local notification with a specific 'show' time and date on both iOS and Android. This is not exposed by Fyne though.

@Jacalz Jacalz changed the title iOS notifications only work in the foreground, kind of defeating its purpose iOS notifications only work in the foreground Jun 25, 2024
@andydotxyz
Copy link
Member

The app can send notifications if it is running in the background on iOS and Android. However (depending on memory pressure) the iOS app will likely be killed in seconds rather than minutes on Android.

Scheduling notifications is an intended improvement so feel free to open a PR or feature request so we can track its addition.

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

No branches or pull requests

3 participants