Geofence.Geofence(String, IGeoshape, MonitoredGeofenceStates, Boolean) constructor

Applies to Windows and Windows Phone

Initializes a new Geofence object given the id, the shape of the geofence, the states to monitor the geofence for, and the singleUse flag.

Syntax


var geofence = new Windows.Devices.Geolocation.Geofencing.Geofence(id, geoshape, monitoredStates, singleUse);

Parameters

id

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The Id of the geofence.

geoshape

Type: IGeoshape

The area that defines the geofence to monitor.

monitoredStates

Type: MonitoredGeofenceStates

The states to monitor the geofence for.

singleUse

Type: Boolean [JavaScript] | System.Boolean [.NET] | Platform::Boolean [C++]

True indicates the geofence should be monitored only for one use. False indicates the geofence should be monitored for multiple uses.

Remarks

When this constructor is used, the DwellTime will default to 10 seconds, the StartTime will default to 0 meaning start immediately, and the Duration will default to 0, meaning forever.

The id value must be non-null and less than 64 characters.

The geoshape parameter must be a non-null Geocircle with a SpatialReferenceId that matches the platform or an exception will be thrown.

You must specify the Entered or Exited states, or both, for a geofence to be monitored. It is not possible to create a geofence that only monitors the Removed state.

Requirements

Minimum supported client

Windows 8.1

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Devices.Geolocation.Geofencing
Windows::Devices::Geolocation::Geofencing [C++]

Metadata

Windows.winmd

See also

Geofencing, start to finish
Geofence
Geofence(String, IGeoshape)
Geofence(String, IGeoshape, MonitoredGeofenceStates, Boolean, TimeSpan)
Geofence(String, IGeoshape, MonitoredGeofenceStates, Boolean, TimeSpan, DateTime, TimeSpan)

 

 

Show:
© 2014 Microsoft