cordova-plugin-geofence
cordova-plugin-geofence copied to clipboard
Requires swift 3.0 in Xcode 8.3
Swift 2.3 is not supported and can not be built in Xcode 8.3 with the new iOS SDK 10.3.
Same issue after updating Xcode today 😕
Try the update from here - https://github.com/ypelud/cordova-plugin-geofence/tree/d2e1f22340ac2cd07559598fd290df462e75055d/src/ios
Just copy paste the contents of the 3 files (GeoFencePlugin.swift , SwiftData.swift, SwiftyJson.swift) into your XCode build where you notice build errors for these 3 files and build again.
Till @tsubik - merges this here or Yann makes a release available, the above copy/paste is a working solution.
@rafialikhan Yes, thanks for sharing what you have found. Swift is really my pain. I will have a try after updating to Xcode 8.3. If anyone already succeeded, you can post here your progress for sharing.
@rafialikhan thanks! your fix worked. I was able to compile after the following steps:
- update the three files as mentioned
- use "edit/convert/to current swift syntax" in XCode
- remove swift legacy setting from my config.xml
- fixed a remaining bug in swift code following this advice
Let's cross fingers, the code is still working - and that I do not have to rebuild the project...
@StephanGieffers I was able to compile 1 week ago and now I'm getting errors. Has anyone else gotten this to work? Please help!
Hi, I just compiled my app with the plugin with success - when opening the project in xcode, it asks if i would like to convert the code to swift 3. I click Convert. It then compiles with 2 errors. I then copy paste the 3 files from https://github.com/ypelud/cordova-plugin-geofence/tree/d2e1f22340ac2cd07559598fd290df462e75055d/src/ios into xcode and can then compile my app. The geofences seem to work as they should. Would be nice if the plugin was released on npmjs again with the fixes - they work fine for me.
These files also worked for me, except I think I've been able to skip the step of having xcode convert things:
- add <plugin name="cordova-plugin-geofence" spec="~0.6.0" />
- add <plugin name="cordova-plugin-add-swift-support" spec="~1.6.2" />
- do not add preference tag for 'UseLegacySwiftLanguageVersion'
- cordova platform add ios (installs plugin, etc)
- swap three files above into place (platforms/ios/
/Plugins/cordova-plugin-geofence/) - build your app - no swift errors/conversion necessary
@josh-m-sharpe Check steps 1 and 2 above... 😮
I need use the branch mentioned above plus the following steps:
Add:
#import "Geofence-Plugin-Bridging-Header.h"`
ToBridging-Header.h
I believe this project needs something along the lines of
https://github.com/meteor/cordova-plugin-meteor-webapp/blob/dd2d61589c27fe41c56778cb9f7bfab41a612fbd/scripts/iosAddBridgingHeader.js
I am getting plugin not installed after following the steps above... Any idea? This is happening right after I replace the files from the other Yann's repo...
I've forked the plugin into a repo called https://github.com/compelling/cordova-plugin-geofence/ that works fine for me with the fixes - and also with fixes for the android versions that used some obsolete java http methods (as the android version cannot use the javascript callbacks for geofence crossing).
@compelling Works for me too. Is that possible to make a pull request to the main repo (cowbell/cordova-plugin-geofence) ? It's easier for future updates.
1- ionic platform remove ios
2- rm -rf plugins/
3- in config.xml
Hello Guys, I am able to compile swift code but geofence trigger not working in IOS. I am using ionic 2 cordova geofence plugin. Please help me to get notified on IOS app.
@Corebee - seems you have same issue, pls let me know if this issue has been solved?
Plugin works fine for me, but i had to update location access description entries for plist file for iOS11: E.g.
<config-file mode="add" parent="NSLocationAlwaysAndWhenInUseUsageDescription" target="*-Info.plist">
<string>This app requires constant access to your location in order for auto alarm on/off to work.</string>
</config-file>
<config-file mode="add" parent="NSLocationWhenInUseUsageDescription" target="*-Info.plist">
<string>This app requires access to your location in find estate address distance.</string>
</config-file>
@compelling, yes I had added 'NSLocationAlwaysAndWhenInUseUsageDescription' in info.plist.
@compelling great work - has anyone had this working successfully with xcode v9 or above? My basic understanding is that it would need to be compilable swift code at version 3.2 or higher?