Telerik-Verified-Plugins / WKWebView

DEPRECATED - this plugin served a purpose in the past, but there are better implementation now
832 stars 149 forks source link

Requests in background mode #230

Open zaouifahd opened 8 years ago

zaouifahd commented 8 years ago

Hi, great job For my app, i use location in background with update interval , but when the app is in background the requests is not sent to server , I think the requests is put on queue. And when the app back to the foreground the requests is send to the server. Please anyone have idea, i need use location in background.

Thank you in advance for replay

EddyVerbruggen commented 8 years ago

Does it work without the wkwebview plugin?

zaouifahd commented 8 years ago

Yes background location work without the wkwebview plugin.

Kurom96 commented 6 years ago

May be the same problem. I tried background fetch for iOS. https://github.com/transistorsoft/cordova-plugin-background-fetch

    onDeviceReady: function() {
        this.receivedEvent('deviceready');

        var Fetcher = window.BackgroundFetch;

        var fetchCallback = function () {
            $.ajax({
                url: 'https://api.github.com/users/litehelpers/repos',
                dataType: 'json',
                crossDomain: true,
                success: function (res) {
                    console.log("finish");
                    Fetcher.finish();
                },
                error: function (e) {
                    console.log("background-fetch error: " + err);
                    Fetcher.finish();
                }
            });
        };

        var failureCallback = function() {
            console.log("background failed");
        };

        Fetcher.configure(fetchCallback, failureCallback, {
            stopOnTerminate: false
        });
    },

This code works fine. However, Success will not be called when adding this plugin. Process seems to be waiting. Success is called when the application to foreground.