Module com.gluonhq.attach.position
Package com.gluonhq.attach.position.impl
Class IOSPositionService
- java.lang.Object
-
- com.gluonhq.attach.position.impl.IOSPositionService
-
- All Implemented Interfaces:
PositionService
public class IOSPositionService extends java.lang.Object implements PositionService
An implementation of thePositionService
for the iOS platform. Important note: it requires adding to the info.plist file:<key>NSLocationUsageDescription</key> <string>Reason to use Location Service (iOS 6+)</string> <key>NSLocationWhenInUseUsageDescription</key> <string>Reason to use Location Service (iOS 8+)</string>
With Background mode enabled<key>UIBackgroundModes</key> <array> <string>location</string> </array> <key>NSLocationUsageDescription</key> <string>Reason to use Location Service (iOS 6+)</string> <key>NSLocationAlwaysUsageDescription</key> <string>Reason to use Location Service (iOS 8+) in background</string> <key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <string>Reason to use Location Service (iOS 8+) in background</string>
-
-
Field Summary
-
Fields inherited from interface com.gluonhq.attach.position.PositionService
DEFAULT_PARAMETERS
-
-
Constructor Summary
Constructors Constructor Description IOSPositionService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Position
getPosition()
The current position on earth of the device.javafx.beans.property.ReadOnlyObjectProperty<Position>
positionProperty()
A read-only property containing information about the device's current location on earth.void
start()
Starts the service withPositionService.DEFAULT_PARAMETERS
.void
start(Parameters parameters)
Starts the service.void
stop()
Stops the service.
-
-
-
Method Detail
-
start
public void start()
Description copied from interface:PositionService
Starts the service withPositionService.DEFAULT_PARAMETERS
. Developer must call either this method orPositionService.start(com.gluonhq.attach.position.Parameters)
to start the service- Specified by:
start
in interfacePositionService
-
start
public void start(Parameters parameters)
Description copied from interface:PositionService
Starts the service. Developer must call either this method orPositionService.start()
to start the service- Specified by:
start
in interfacePositionService
- Parameters:
parameters
- Parameters for configuring the service, including desired accuracy, minimum distance and time interval between notifications, or background mode
-
stop
public void stop()
Description copied from interface:PositionService
Stops the service. Developer may call this method to stop the service on demand- Specified by:
stop
in interfacePositionService
-
positionProperty
public javafx.beans.property.ReadOnlyObjectProperty<Position> positionProperty()
Description copied from interface:PositionService
A read-only property containing information about the device's current location on earth. The property can contain anull
object when the position of the device could be determined.- Specified by:
positionProperty
in interfacePositionService
- Returns:
- a read-only object property containing the device's current location
-
getPosition
public Position getPosition()
Description copied from interface:PositionService
The current position on earth of the device. Can returnnull
when the position of the device could not be determined, for instance when the GPS has been turned off.- Specified by:
getPosition
in interfacePositionService
- Returns:
- the current position of the device
-
-