cordova-plugin-background-fetch: finished never been called
hi, first thanks for ur plugin i really appreciate ur hard work on it i tried this plugin with ios simulator where i needed to schedule local notification first time fires nicely and the local notification was scheduled perfectly but when i tried to do it again i got this message in xcode console
CDVBackgroundFetch AppDelegate received fetch event
2017-07-10 21:46:16.387 MyApp[28009:17544106] - TSBackgroundFetch performFetchWithCompletionHandler
2017-07-10 21:46:16.387 MyApp[28009:17544106] - CDVBackgroundFetch Rx Fetch Event
2017-07-10 21:50:34.740 MyApp[28009:17544106] CDVBackgroundFetch AppDelegate received fetch event
2017-07-10 21:50:34.740 MyApp[28009:17544106] - TSBackgroundFetch performFetchWithCompletionHandler
2017-07-10 21:50:34.741 MyApp[28009:17544106] Warning: Application delegate received call to -application:performFetchWithCompletionHandler: but the completion handler was never called.
2017-07-10 21:50:34.741 MyApp[28009:17544106] - CDVBackgroundFetch Rx Fetch Event
what i can understand here that it might the finish() function wasnt called even though i put it inside configure function
if u can help me with this issue pls
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 29 (12 by maintainers)
@ferreyes @christocracy unfortunately I never got it to work, even when I called BackgroundFetch.finish(), so I did something roundabout…feel free to comment and let me know if you find a solution
I call backgroundFetch.stop() on platform.resume when the app is being resumed and being used
and then I call backgroundFetch.configure when the app is paused. This actually re-initiates the backgroundFetch module each time the app is resumed/ paused.
Hello @sta55en
I have same issue with sending request. Chrome DevTools is showing requests in a ‘pending’ state and never finished. Do you figure out how can it be solved sending request by browser? If I am using cordova-plugin-advanced-http then it is working well.
Thank you
Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a “discussion” and I will leave this open.
I’ve traced the
adb
logs and this is what I got:From the log, after we see
TSBackgroundFetch: - Background Fetch event received
in the TSBackgroundFetch logs:The request to the API just sits there and hangs… If I call the code that hits the server from the UI while the app is open, it works 100%.
After we reopen the app, immediately, the request to the server completes. No errors anywhere in the log.
Do you think this is just a case of data getting disabled in the background? Do you know if there is any way to confirm that it is what’s happening?
BackgroundFetch
does not support a Promise API. There’s no possible way this could work (unless you’re using some sort of wrapper):Don’t get cute, just follow the example in README: