-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
[Question] Does this module work on iOS 13? #8
Comments
Sadly, this library will not keep alive the app in the background by itself on iOS. I am working on an iOS 13 solutions using the new However, you can rely on other libraries like I have updated the library documentation about this subject. |
You say in the main documentation on the warning part that the problem is that this library wont get the app to live forever in background.. But, will it live for at least 15-20 minutes? And, will this library allow to execute any JS code while on background as long as the app lives? |
@d0xi5, it might live for at least 5 minutes. However, iOS can close it as soon as it wants. It depends on your use case. |
Hi |
@zendevil, I am sorry, but it is not possible. Take a look at my comment #8 (comment) for more info. |
Hi @Rapsssito , reading comment #8 you said to use "react-native-track-player" but it's for music play. Is there a way to keep working without using music player ? location only for example ? My use case is "Tcp connection + Download files for 5 minutes". Then after 2/3 minutes I want to restart this process |
Hey I too have some similar use case |
Actually I need a background process which looks out for data from a source for certain interval of time. That too I need specifically for iOS. Will try if I can use react-native-track-player for keeping the app alive |
@Osric38, check the docs for more info:
The issue here is that iOS does not allow your app to run in the background without a very specific reason. The main problem is with iOS itself and its restrictions on background tasks. Take a look at the iOS docs about this topic. |
@Rapsssito I know about this restriction, but with react-native-track-player, I will block user for reading his personnal musics, no ? Have you already tried "react-native-background-geolocation" ? In IOS 13, it seems background is allowed for some processing actions, have you tried this point ? |
@Osric38 I have not tested it with react-native-background-geolocation. Make sure to use react-native-track-player if the sound is a real part of the app, if it is not, your app will get rejected in the App Store. Take into account that running the React Context is a relatively heavy processing action. However, I will take a look at the possibilities offered by iOS 13 as soon as possible. |
Did we ever get any progress on this? Because I do not even think my I got one error POST |
@russmenum, for geolocation purposes, I highly recommend using just pure |
@Rapsssito , I am confused about how that is different? In looking at that it looks like all the calls run in the foreground so would not work while the app is not in the foreground? Maybe moot as after install trying to use it is crashing my app. If it will work even when iOS app is in the background or another app is in use; great, but looks like all the doc is class bassed; would you know of any functional hook-based exsamples? I need hooks |
Please do something. Flutter has already had flutter_workmanage that relied on Android's WorkManager, iOS' performFetchWithCompletionHandler and iOS BGAppRefreshTask. Could you do it in React Native? |
Hi @russmenum , @Ppang0405 In your App.js:
Then in main component:
Then you can do action in handler you want. On Android you can use : react-native-background-actions |
I've tried a lot of ways, even tricked the system by using react-native-track-player and react-native-background-geolocation but all led to the same result: When I tried on iOS 14 and 15, the background tasks (react-native-background-actions, react-native-background-geolocation, and react-native-track-player) was only being implemented for 30 seconds, while on Android or iOS 12 it was working fine. Then I've found this comment
So I don't think it could be possible to efficiently implement the background tasks on recent iOS versions. In my own use case, the system would have some data to sync to the cloud and I was trying to implement background tasks to handle the case when the app goes to the background. Since it's no longer implementable, I've changed the way to approach the problem by using notification, so that I will send noti to users after an amount of time if they still have unsynced data. P/S: I could do the trick with the track player, I've added some audio to keep the app alive in the background for over 30 seconds, and then seemed it did work, just not sure how long would it keep the app alive. But since my app is not related to playing any videos or audios, this could be rejected by Apple but if yours do have, then you can think about it and use it with your own risks. |
I'm finding module which working at IOS 13.
I was used react-native-backgroun-timer. but it's not working at IOS 13.
I think it's because of new ios "background processing".
I wanna know about this module cover IOS 13.
The text was updated successfully, but these errors were encountered: