/ ionic

Ionic Geofence Native Plugin; Location and Notification Permissions bug

[[email protected], [email protected]]

I ran into a bug (ios), after finally getting the Ionic Native Geofence plugin to build after this build issue. When the app first loads, you are required to get permission from the user to track their location and to receive local notifications. Without these permissions the Geofence plugin is not going to work.

I'm still working out why my fix works (albeit with another minor bug*) but follow the step below if you have run into the same issue:

  1. Add the Ionic Native Diagnostic Plugin ionic cordova plugin add cordova.plugins.diagnostic
  2. npm install --save @ionic-native/diagnostic
  3. Delete your app from the device you are going to test on.
  4. Build the app ionic cordova build ios -c

You should now get both alerts asking for location and notification permissions.

  • A bug still exists after the above fix is in place where the notification alert pops up first but before you can interact with it, the location permission alert pops up over the top followed by the notification alert after selecting an option.