MobileChromeApps / cordova-plugin-service-worker-background-sync

Cordova Service Worker Background Sync Plugin
Apache License 2.0
35 stars 13 forks source link

Periodic sync event not fired on network reconnect in iOS 10.3.2. #7

Open indgov opened 6 years ago

indgov commented 6 years ago

I set up the sample app using cordova 5.41 by running the following commands and ran it on an iPad running iOS 10.3.2:

cordova create BackgroundSyncDemo io.cordova.backgroundsyncdemo BackgroundSyncDemo cd BackgroundSyncDemo cordova platform add ios@3.9.2 cordova plugin add https://github.com/MobileChromeApps/cordova-plugin-service-worker cordova plugin add cordova-plugin-service-worker-background-sync mv 'plugins/cordova-plugin-service-worker-background-sync/sample/config.xml' 'config.xml' mv 'plugins/cordova-plugin-service-worker-background-sync/sample/www/sw.js' 'www/sw.js' mv 'plugins/cordova-plugin-service-worker-background-sync/sample/www/index.html' 'www/index.html' mv 'plugins/cordova-plugin-service-worker-background-sync/sample/www/js/index.js' 'www/js/index.js' mv 'plugins/cordova-plugin-service-worker-background-sync/sample/www/css/index.css' 'www/css/index.css' cordova prepare

Adding ios platform > 4.0 gave me this issue

Adding the plugin cordova-plugin-service-worker gave me this issue

I ran this on an iOS 9.2 simulator, registered a periodic sync event, and it kept firing every 2 seconds. On disconnecting and reconnecting the events start firing again.

Doing the same on an iOS 10.2 simulator, the event is not fired again. I tracked this down to the kReachabilityChangedNotificationnot being fired on reconnect, and could be related to this issue

However, the event (periodic sync) is not fired on a 10.3.2 device either, and I haven't been able to debug it yet. Has anyone got this to work on iOS 10?