Tizen Native API  7.0
Geofence Manager

This Geofence Manager API provides service related to geofence(geo-fence).

Required Header

#include <geofence_manager.h>

Overview

This Geofence Manager API provides service related to geofence(geo-fence). A geofence is a virtual perimeter for a real-world geographic area. This API provides functions to set geofence with geopoint, MAC address of Wi-Fi, and Bluetooth address. And notifications on events like changing in service status are provided. There are two kinds of places and fences:

  • Public places and fences that are created by MyPlace app can be used by all apps.
  • Private places and fences that are created by specified app can be used by the same app. Notifications can be received about the following events:
  • Zone in when a device enters a specific area
  • Zone out when a device exits a specific area
  • Results and errors for each event requested to geofence module The Geofence manager has the following properties:
  • geofence type
  • status
  • 'Service state change' callback The geofence type property of geofence manager (geofence_type_e) specifies the type of virtual perimeter. The status property describes the current state and duration of a geofence. State (geofence_state_e) can be uncertain, in, or out.

Related Features

This API is related with the following features:

  • http://tizen.org/feature/location
  • http://tizen.org/feature/location.geofence

It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.

Since :
2.4

Functions

int geofence_manager_is_supported (bool *supported)
 Checks whether the geofence manager is available or not.
int geofence_manager_create (geofence_manager_h *manager)
 Creates a new geofence manager.
int geofence_manager_destroy (geofence_manager_h manager)
 Releases the geofence manager.
int geofence_manager_start (geofence_manager_h manager, int geofence_id)
 Starts the geofencing service.
int geofence_manager_stop (geofence_manager_h manager, int geofence_id)
 Stops the geofencing service.
int geofence_manager_add_place (geofence_manager_h manager, const char *place_name, int *place_id)
 Creates a new place for geofencing service.
int geofence_manager_update_place (geofence_manager_h manager, int place_id, const char *place_name)
 Updates the place name of a given place ID.
int geofence_manager_remove_place (geofence_manager_h manager, int place_id)
 Removes the specific place for geofencing service.
int geofence_manager_add_fence (geofence_manager_h manager, const geofence_h fence, int *geofence_id)
 Adds a geofence for a given geofence manager.
int geofence_manager_remove_fence (geofence_manager_h manager, int geofence_id)
 Removes a geofence with a given geofence ID.
int geofence_manager_set_geofence_state_changed_cb (geofence_manager_h manager, geofence_state_changed_cb callback, void *user_data)
 Registers a callback function to be invoked when a device enters or exits the specific geofence.
int geofence_manager_unset_geofence_state_changed_cb (geofence_manager_h manager)
 Unregisters the callback function.
int geofence_manager_set_geofence_event_cb (geofence_manager_h manager, geofence_event_cb callback, void *user_data)
 Registers a callback function to be invoked when a response comes.
int geofence_manager_unset_geofence_event_cb (geofence_manager_h manager)
 Unregisters the callback function.
int geofence_manager_set_geofence_proximity_state_changed_cb (geofence_manager_h manager, geofence_proximity_state_changed_cb callback, void *user_data)
 Registers a callback function to be invoked when a proximity state of device is changed.
int geofence_manager_unset_geofence_proximity_state_changed_cb (geofence_manager_h manager)
 Unregisters the callback function.
int geofence_manager_foreach_geofence_list (geofence_manager_h manager, geofence_manager_fence_cb callback, void *user_data)
 Retrieves a list of fences registered in the specified geofence manager.
int geofence_manager_foreach_place_geofence_list (geofence_manager_h manager, int place_id, geofence_manager_fence_cb callback, void *user_data)
 Retrieves a list of fences registered in the specified place.
int geofence_manager_foreach_place_list (geofence_manager_h manager, geofence_manager_place_cb callback, void *user_data)
 Retrieves a list of places registered in the specified geofence manager.
int geofence_manager_get_place_name (geofence_manager_h manager, int place_id, char **place_name)
 Gets the name of place.

Typedefs

typedef void(* geofence_state_changed_cb )(int geofence_id, geofence_state_e state, void *user_data)
 Called when a device enters or exits the given geofence.
typedef void(* geofence_proximity_state_changed_cb )(int geofence_id, geofence_proximity_state_e state, geofence_proximity_provider_e provider, void *user_data)
 Called when a proximity state of device is changed.
typedef void(* geofence_event_cb )(int place_id, int geofence_id, geofence_manager_error_e error, geofence_manage_e manage, void *user_data)
 Called when the some event occurs in geofence and place such as add, update, etc..
typedef bool(* geofence_manager_fence_cb )(int geofence_id, geofence_h fence, int fence_index, int fence_cnt, void *user_data)
 Called when the fence list is requested.
typedef bool(* geofence_manager_place_cb )(int place_id, const char *place_name, int place_index, int place_cnt, void *user_data)
 Called when the place list is requested.
typedef struct geofence_manager_s * geofence_manager_h
 The geofence manager handle.
typedef struct geofence_s * geofence_h
 The geofence handle.
typedef struct geofence_status_s * geofence_status_h
 The geofence status handle.

Typedef Documentation

typedef void(* geofence_event_cb)(int place_id, int geofence_id, geofence_manager_error_e error, geofence_manage_e manage, void *user_data)

Called when the some event occurs in geofence and place such as add, update, etc..

The events of public geofence is also received if there are public geofences.

Since :
2.4
Remarks:
The value of place_id or geofence_id is -1 when the place ID or geofence ID is not assigned.
Parameters:
[in]place_idThe place ID
[in]geofence_idThe specified geofence ID
[in]errorThe error code for the particular action
[in]manageThe result code for the particular place and geofence management
[in]user_dataThe user data passed from callback registration function
Precondition:
geofence_manager_start() will invoke this callback if you register this callback using geofence_manager_set_geofence_event_cb()
See also:
geofence_manage_e
geofence_manager_start()
geofence_manager_set_geofence_event_cb()
typedef struct geofence_s* geofence_h

The geofence handle.

Since :
2.4
typedef bool(* geofence_manager_fence_cb)(int geofence_id, geofence_h fence, int fence_index, int fence_cnt, void *user_data)

Called when the fence list is requested.

Since :
2.4
Parameters:
[in]geofence_idThe geofence ID
[in]fenceThe fence handle
[in]fence_indexThe index number of the fences in the list
[in]fence_cntThe total number of fences that exists for the requester
[in]user_dataThe user data passed from callback registration function
Returns:
true to continue iterating, otherwise false
Precondition:
geofence_manager_foreach_geofence_list() and geofence_manager_foreach_place_geofence_list() will invoke this callback if you specify this callback using geofence_manager_foreach_geofence_list().
See also:
geofence_manager_foreach_geofence_list()
geofence_manager_foreach_place_geofence_list()
geofence_manager_add_fence()
typedef struct geofence_manager_s* geofence_manager_h

The geofence manager handle.

Since :
2.4
typedef bool(* geofence_manager_place_cb)(int place_id, const char *place_name, int place_index, int place_cnt, void *user_data)

Called when the place list is requested.

Since :
2.4
Parameters:
[in]place_idThe current place ID
[in]place_nameThe current place name
[in]place_indexThe index number of the places in the list
[in]place_cntThe total number of places that exists for the requester
[in]user_dataThe user data passed from callback registration function
Returns:
true to continue iterating, otherwise false
Precondition:
geofence_manager_foreach_place_list() will invoke this callback if you specify this callback using geofence_manager_foreach_place_list().
See also:
geofence_manager_foreach_place_list()
geofence_manager_add_place()
typedef void(* geofence_proximity_state_changed_cb)(int geofence_id, geofence_proximity_state_e state, geofence_proximity_provider_e provider, void *user_data)

Called when a proximity state of device is changed.

Since :
3.0
Parameters:
[in]geofence_idThe specified geofence ID
[in]stateThe proximity state
[in]providerThe proximity provider
[in]user_dataThe user data passed from callback registration function
Precondition:
geofence_manager_start() will invoke this callback if you register this callback using geofence_manager_set_geofence_proximity_state_changed_cb().
See also:
geofence_proximity_state_e
geofence_proximity_provider_e
geofence_manager_start()
geofence_manager_set_geofence_proximity_state_changed_cb()
typedef void(* geofence_state_changed_cb)(int geofence_id, geofence_state_e state, void *user_data)

Called when a device enters or exits the given geofence.

Since :
2.4
Parameters:
[in]geofence_idThe specified geofence ID
[in]stateThe geofence state
[in]user_dataThe user data passed from callback registration function
Precondition:
geofence_manager_start() will invoke this callback if you register this callback using geofence_manager_set_geofence_state_changed_cb().
See also:
geofence_state_e
geofence_manager_start()
geofence_manager_set_geofence_state_changed_cb()
typedef struct geofence_status_s* geofence_status_h

The geofence status handle.

Since :
2.4

Enumeration Type Documentation

Enumeration for geofence management events.

Since :
2.4
Enumerator:
GEOFENCE_MANAGE_FENCE_ADDED 

Geofence is added

GEOFENCE_MANAGE_FENCE_REMOVED 

Geofence is removed

GEOFENCE_MANAGE_FENCE_STARTED 

Geofencing is started

GEOFENCE_MANAGE_FENCE_STOPPED 

Geofencing is stopped

GEOFENCE_MANAGE_PLACE_ADDED 

Place is added

GEOFENCE_MANAGE_PLACE_REMOVED 

Place is removed

GEOFENCE_MANAGE_PLACE_UPDATED 

Place is updated

GEOFENCE_MANAGE_SETTING_ENABLED 

Setting for geofencing is enabled

GEOFENCE_MANAGE_SETTING_DISABLED 

Setting for geofencing is disabled

Enumeration for Geofence manager of error code.

Since :
2.4
Enumerator:
GEOFENCE_MANAGER_ERROR_NONE 

Success

GEOFENCE_MANAGER_ERROR_OUT_OF_MEMORY 

Out of memory

GEOFENCE_MANAGER_ERROR_INVALID_PARAMETER 

Invalid parameter

GEOFENCE_MANAGER_ERROR_PERMISSION_DENIED 

Permission denied

GEOFENCE_MANAGER_ERROR_NOT_SUPPORTED 

Not supported

GEOFENCE_MANAGER_ERROR_NOT_INITIALIZED 

Geofence Manager is not initialized

GEOFENCE_MANAGER_ERROR_INVALID_ID 

Invalid geofence ID

GEOFENCE_MANAGER_ERROR_EXCEPTION 

Exception occurs

GEOFENCE_MANAGER_ERROR_ALREADY_STARTED 

Geofencing is already started

GEOFENCE_MANAGER_ERROR_TOO_MANY_GEOFENCE 

Too many geofence

GEOFENCE_MANAGER_ERROR_IPC 

Error in GPS, Wi-Fi, or BT

GEOFENCE_MANAGER_ERROR_DATABASE 

DB error in the server side

GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIED 

Access to specified place is denied

GEOFENCE_MANAGER_ERROR_GEOFENCE_ACCESS_DENIED 

Access to specified geofence is denied

Enumeration for the provider of proximity.

Since :
3.0
Enumerator:
GEOFENCE_PROXIMITY_PROVIDER_LOCATION 

Proximity is specified by geospatial coordinate

GEOFENCE_PROXIMITY_PROVIDER_WIFI 

Proximity is specified by Wi-Fi access point

GEOFENCE_PROXIMITY_PROVIDER_BLUETOOTH 

Proximity is specified by Bluetooth device

GEOFENCE_PROXIMITY_PROVIDER_BLE 

Proximity is specified by Bluetooth low energy device

GEOFENCE_PROXIMITY_PROVIDER_SENSOR 

Proximity is specified by Sensor

Enumeration for the state of proximity.

Since :
3.0
Enumerator:
GEOFENCE_PROXIMITY_STATE_UNCERTAIN 

Uncertain state of proximity

GEOFENCE_PROXIMITY_STATE_FAR 

Far state of proximity

GEOFENCE_PROXIMITY_STATE_NEAR 

Near state of proximity

GEOFENCE_PROXIMITY_STATE_IMMEDIATE 

Immediate state of proximity

Enumeration for the state of geofence manager.

Since :
2.4
Enumerator:
GEOFENCE_STATE_UNCERTAIN 

Uncertain state of geofence

GEOFENCE_STATE_IN 

Geofence In state

GEOFENCE_STATE_OUT 

Geofence Out state

Enumeration for geofence type.

Since :
2.4
Enumerator:
GEOFENCE_TYPE_GEOPOINT 

Geofence is specified by geospatial coordinate

GEOFENCE_TYPE_WIFI 

Geofence is specified by Wi-Fi access point

GEOFENCE_TYPE_BT 

Geofence is specified by Bluetooth device


Function Documentation

int geofence_manager_add_fence ( geofence_manager_h  manager,
const geofence_h  fence,
int *  geofence_id 
)

Adds a geofence for a given geofence manager.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Parameters:
[in]managerThe geofence manager handle
[in]fenceThe geofence handle
[out]geofence_idThe geofence ID handle to be newly created on success
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this function
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
GEOFENCE_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
GEOFENCE_MANAGER_ERROR_EXCEPTIONException occurred
See also:
geofence_manager_remove_fence()
geofence_create_geopoint()
geofence_create_bluetooth()
geofence_create_wifi()
geofence_manager_start()
int geofence_manager_add_place ( geofence_manager_h  manager,
const char *  place_name,
int *  place_id 
)

Creates a new place for geofencing service.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Parameters:
[in]managerThe geofence manager handle
[in]place_nameA place name to be created
[out]place_idThe place ID to be newly created on success
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this function
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
GEOFENCE_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
GEOFENCE_MANAGER_ERROR_EXCEPTIONException occurred
See also:
geofence_manager_update_place()
geofence_manager_remove_place()

Creates a new geofence manager.

Since :
2.4
Remarks:
The manager must be released using geofence_manager_destroy().
Since 3.0, http://tizen.org/privilege/location privilege is not required.
Parameters:
[out]managerA geofence manager handle to be newly created on success
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_OUT_OF_MEMORYOut of memory
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this function
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
GEOFENCE_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
GEOFENCE_MANAGER_ERROR_EXCEPTIONException occurred
See also:
geofence_manager_destroy()

Releases the geofence manager.

Since :
2.4
Remarks:
Since 3.0, http://tizen.org/privilege/location privilege is not required.
Parameters:
[in]managerThe geofence manager handle
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this function
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
GEOFENCE_MANAGER_ERROR_EXCEPTIONException occurred
Precondition:
geofence_manager_stop() is called before.
See also:
geofence_manager_create()
geofence_manager_stop()
int geofence_manager_foreach_geofence_list ( geofence_manager_h  manager,
geofence_manager_fence_cb  callback,
void *  user_data 
)

Retrieves a list of fences registered in the specified geofence manager.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Parameters:
[in]managerThe geofence manager handle
[in]callbackThe callback function to deliver each fence
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this function
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
GEOFENCE_MANAGER_ERROR_DATABASEDatabase error
Postcondition:
This function invokes geofence_manager_fence_cb().
See also:
geofence_manager_fence_cb()
geofence_manager_add_fence()
int geofence_manager_foreach_place_geofence_list ( geofence_manager_h  manager,
int  place_id,
geofence_manager_fence_cb  callback,
void *  user_data 
)

Retrieves a list of fences registered in the specified place.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Parameters:
[in]managerThe geofence manager handle
[in]place_idThe place ID
[in]callbackThe callback function to deliver each fence of the specified place
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this function
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
GEOFENCE_MANAGER_ERROR_DATABASEDatabase error
GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIEDAccess to specified place is denied
Postcondition:
This function invokes geofence_manager_fence_cb().
See also:
geofence_manager_fence_cb()
geofence_manager_add_place()
int geofence_manager_foreach_place_list ( geofence_manager_h  manager,
geofence_manager_place_cb  callback,
void *  user_data 
)

Retrieves a list of places registered in the specified geofence manager.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Parameters:
[in]managerThe geofence manager handle
[in]callbackThe callback function to deliver each place of the specified geofence manager
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this function
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
GEOFENCE_MANAGER_ERROR_DATABASEDatabase error
Postcondition:
This function invokes geofence_manager_place_cb().
See also:
geofence_manager_place_cb()
geofence_manager_add_place()
int geofence_manager_get_place_name ( geofence_manager_h  manager,
int  place_id,
char **  place_name 
)

Gets the name of place.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Remarks:
The place_name must be released using free().
Parameters:
[in]managerThe geofence manager handle
[in]place_idThe place ID
[out]place_nameThe name of the place
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this function
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
GEOFENCE_MANAGER_ERROR_INVALID_IDInvalid geofence ID
GEOFENCE_MANAGER_ERROR_DATABASEDatabase error
GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIEDAccess to specified place is denied
See also:
geofence_manager_add_place()
geofence_manager_update_place()
int geofence_manager_is_supported ( bool *  supported)

Checks whether the geofence manager is available or not.

Since :
2.4
Parameters:
[out]supportedtrue if geofence service is supported, otherwise false
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
See also:
geofence_manager_create()
int geofence_manager_remove_fence ( geofence_manager_h  manager,
int  geofence_id 
)

Removes a geofence with a given geofence ID.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Parameters:
[in]managerThe geofence manager handle
[in]geofence_idThe specified geofence ID
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this function
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
GEOFENCE_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
GEOFENCE_MANAGER_ERROR_EXCEPTIONException occurred
GEOFENCE_MANAGER_ERROR_GEOFENCE_ACCESS_DENIEDAccess to specified geofence is denied
Precondition:
geofence_manager_stop() is called before.
See also:
geofence_manager_add_fence()
int geofence_manager_remove_place ( geofence_manager_h  manager,
int  place_id 
)

Removes the specific place for geofencing service.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Remarks:
The place must have no geofences.
Parameters:
[in]managerThe geofence manager handle
[in]place_idThe specified place ID
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this function
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
GEOFENCE_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
GEOFENCE_MANAGER_ERROR_EXCEPTIONException occurred
GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIEDAccess to specified place is denied
Precondition:
geofence_manager_remove_fence() in all geofence is called before.
See also:
geofence_manager_add_place()
geofence_manager_update_place()
int geofence_manager_set_geofence_event_cb ( geofence_manager_h  manager,
geofence_event_cb  callback,
void *  user_data 
)

Registers a callback function to be invoked when a response comes.

Since :
2.4
Parameters:
[in]managerThe geofence manager handle
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
Postcondition:
This function invokes geofence_event_cb().
See also:
geofence_manager_unset_geofence_event_cb()

Registers a callback function to be invoked when a proximity state of device is changed.

The proximity state is measured from registered position regardless of the geofence boundary.

Since :
3.0
Parameters:
[in]managerThe geofence manager handle
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
Postcondition:
This function invokes geofence_proximity_state_changed_cb().
See also:
geofence_manager_unset_geofence_proximity_state_changed_cb()

Registers a callback function to be invoked when a device enters or exits the specific geofence.

Since :
2.4
Parameters:
[in]managerThe geofence manager handle
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
Postcondition:
This function invokes geofence_state_changed_cb().
See also:
geofence_manager_unset_geofence_state_changed_cb()
geofence_state_changed_cb()
int geofence_manager_start ( geofence_manager_h  manager,
int  geofence_id 
)

Starts the geofencing service.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Remarks:
There is no limit on number of geofence managers for which this function called Calling this function invokes a location service event. When the location service is enabled, the service state change callback (set using geofence_manager_set_geofence_state_changed_cb()) notifies the user with geofence ID as the 1st argument, geofence zone state(GEOFENCE_STATE_IN and GEOFENCE_STATE_OUT) as the 2nd argument, and the service starts.
Parameters:
[in]managerThe geofence manager handle
[in]geofence_idThe specified geofence ID
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this function
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
GEOFENCE_MANAGER_ERROR_EXCEPTIONException occurred
GEOFENCE_MANAGER_ERROR_GEOFENCE_ACCESS_DENIEDAccess to specified geofence is denied
See also:
geofence_manager_stop()
geofence_manager_add_fence()
geofence_manager_set_geofence_state_changed_cb()
int geofence_manager_stop ( geofence_manager_h  manager,
int  geofence_id 
)

Stops the geofencing service.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Remarks:
This function initiates the process of stopping the service. You can stop and start the geofence manager as needed.
Parameters:
[in]managerThe geofence manager handle
[in]geofence_idThe specified geofence ID
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this function
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
GEOFENCE_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
GEOFENCE_MANAGER_ERROR_EXCEPTIONException occurred
GEOFENCE_MANAGER_ERROR_GEOFENCE_ACCESS_DENIEDAccess to specified geofence is denied
See also:
geofence_manager_start()

Unregisters the callback function.

Since :
2.4
Parameters:
[in]managerThe geofence manager handle
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
See also:
geofence_event_cb()

Unregisters the callback function.

Since :
3.0
Parameters:
[in]managerThe geofence manager handle
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
See also:
geofence_manager_set_geofence_proximity_state_changed_cb()

Unregisters the callback function.

Since :
2.4
Parameters:
[in]managerThe geofence manager handle
Returns:
0 on success, otherwise a negative error value
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
See also:
geofence_state_changed_cb()
int geofence_manager_update_place ( geofence_manager_h  manager,
int  place_id,
const char *  place_name 
)

Updates the place name of a given place ID.

Since :
2.4
Privilege Level:
public
Privilege:
http://tizen.org/privilege/location
Parameters:
[in]managerThe geofence manager handle
[in]place_idThe specified place ID
[in]place_nameA new place name of the place ID
Return values:
GEOFENCE_MANAGER_ERROR_NONESuccessful
GEOFENCE_MANAGER_ERROR_INVALID_PARAMETERIllegal argument
GEOFENCE_MANAGER_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this function
GEOFENCE_MANAGER_ERROR_NOT_SUPPORTEDNot supported
GEOFENCE_MANAGER_ERROR_NOT_INITIALIZEDNot initialized
GEOFENCE_MANAGER_ERROR_EXCEPTIONException occurred
GEOFENCE_MANAGER_ERROR_PLACE_ACCESS_DENIEDAccess to specified place is denied
See also:
geofence_manager_add_place()
geofence_manager_remove_place()