pmwisdom/cordova-background-geolocation-services

SWIFT 3 not supported anymore by Apple

Opened this issue · 2 comments

We got a message that Apple will not accept apps anymore, which use SWIFT 3 code. Furthermore the newer Xcode versions (forced upgrade by AppStore!!) also don't support SWIFT 3 code anymore.
https://developer.apple.com/documentation/xcode_release_notes/xcode_10_2_release_notes/swift_5_release_notes_for_xcode_10_2

Those files must be upgraded to SWIFT 4.x or 5.
https://swift.org/migration-guide-swift5/

Since we are not experienced with native coding we would appreciate if someone could update the code so that it can again be compiled with XCode 10.3 or higher.

@patrick-stirnemann
Did you find solution? Were you able to update this plugin with SWIFT 4 or 5?

No. We tried to patch the plugin but we were not able to get it running even when the project compiled successfully. In the end we switched to similar plugin from mauron85:
"@mauron85/cordova-plugin-background-geolocation": "^3.1.0",
"cordova-plugin-advanced-http": "^2.2.0",
Note that it is NOT possible to make standard Angular http calls with $http when the app is in background for longer than about 5 minutes (on Android and iOS). The first 5 minutes everything works. So we also had to use another library for that (cordova-plugin-advanced-http). Also - we had to make sure that no promises were used in this case because the promise response was somehow blocked by Angular or the browser (we didn't find out why). So we had to replace all promises by standard JavaScript callback patterns. In the end we got everything to work but it was a "fight".
Good luck!