-
Notifications
You must be signed in to change notification settings - Fork 230
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
BackgroundTimer stops when app goes to background after Few Sec in IOS React Native IOS #397
Comments
same issue in any method |
Same issue in android too😭 |
any updates? |
Any updates on this issue? |
This is still an issue, any updates? |
yes...same issue! any solution? |
same, ios |
any solution? |
same here using |
You dont need this library. You can achieve the same thing with Date, AppState and the built in setInterval. |
Same issue for me - is there an alternative library anyone can recommend? |
no solution, IOS KILL ALL BACKGROUND METHOD after 30 seconds |
Although this defeat the purpose of using this library |
Could you provide some showcase code? |
@Aaronphy check this and maybe customized it because this was an old code
|
This is for timer purpose only and cannot do stuff If you want to prevent someone that want trick your system, you can create a package to bridge native system uptime and use that instead of js moment/Date.
For android SystemClock.elapsedRealtime(); For IOS #include <sys/sysctl.h>
- (time_t)uptime
{
struct timeval boottime;
int mib[2] = {CTL_KERN, KERN_BOOTTIME};
size_t size = sizeof(boottime);
time_t now;
time_t uptime = -1;
(void)time(&now);
if (sysctl(mib, 2, &boottime, &size, NULL, 0) != -1 && boottime.tv_sec != 0) {
uptime = now - boottime.tv_sec;
}
return uptime;
} |
Same issue |
i am resolve this case to write the native swift code and call this code in react native code , and this work fine me @objc
|
No description provided.
The text was updated successfully, but these errors were encountered: