Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49384

Geofence in Ionic not working for iOS

$
0
0

@shinuvs wrote:

I used ionic geofence native plugin for Geofence and it is successfully working in Android, but it is not working for iOS. Kindly refer my below code. I can see in Xcode log geofence added successfully and monitoring location but not showing any notification.

let fence = {
id: ‘69ca1b88-6fbe-4e80-a4d4-ff4d3748acdb’, //any unique ID
latitude: Number(this.cLatitude), //center of geofence radius
longitude: Number(this.cLongitude),
radius: this.radius, //radius to edge of geofence in meters
transitionType: 1 , //see ‘Transition Types’ below
notification: { //notification settings
id: 1, //any unique ID
title: ‘You have crossed a fence.’, //notification title
text: ‘You just left the site.’, //notification body
openAppOnClick: true //open app when notification is tapped
}
}

  this.geofence.addOrUpdate(fence).then(
    () => console.log('Geofence added ios and android'),
    (err) => console.log('Geofence failed to add')
  );

  this.geofence.onTransitionReceived().subscribe(resp => {
    console.log("resp :", resp);
    //alert("You just crossed the fence");
  });

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>