From: jongmun.woo Date: Thu, 26 May 2016 07:39:39 +0000 (+0900) Subject: [3.0][geofence-manager] add new sub-part about proximity X-Git-Tag: tizen_3.0/TD_SYNC/20161201~106^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0acdcabfc957924149c93586ea1ffd0af80bfa1a;p=sdk%2Fonline-doc.git [3.0][geofence-manager] add new sub-part about proximity Signed-off-by: jongmun.woo Change-Id: I27225e69c49625f0abe57dda1ff388a634d44e4f --- diff --git a/org.tizen.tutorials/html/native/location/geofence_tutorial_n.htm b/org.tizen.tutorials/html/native/location/geofence_tutorial_n.htm index 48080b4..08f0969 100644 --- a/org.tizen.tutorials/html/native/location/geofence_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/location/geofence_tutorial_n.htm @@ -26,7 +26,8 @@
  • Getting the Geofence Event State
  • Tracking the User for Geofence Alerts
  • Retrieving Geofence Information
  • - +
  • Tracking the User for Proximity Alerts
  • +

    Related Info

    Prerequisites

    - +

    To use the functions and data types of the Geofence Manager API, include the <geofence_manager.h> header file in your application:

     #include <geofence_manager.h>
     

    Starting the Geofence Service

    - -

    To start the geofence service:

    + +

    To start the geofence service:

    1. Create a geofence manager handle using the geofence_manager_create() function:

      @@ -138,14 +142,14 @@ manager = NULL;
       

      If you destroy the handle, there is no need to call the geofence_manager_stop() function to stop the service as the service is automatically stopped. Also, you do not have to unset the previously set callbacks.

    Getting the Geofence Event State

    - +

    To get the state of all geofence events, use the geofence event callback. The geofence event callback is invoked whenever there is a request from the user, for example, to add a geofence or to start a geofence service.

    1. Register the callback using the geofence_manager_set_geofence_event_cb() function:

       geofence_manager_set_geofence_event_cb(manager, geofence_event, NULL);
      -
      +
    2. Get the success or failure state of the event in the callback:

      @@ -174,10 +178,10 @@ geofence_event(int place_id, int geofence_id, geofence_manager_error_e error,
       
       
    - +

    Tracking the User for Geofence Alerts

    - - + +

    To get information about the in or out state for the geofence:

    1. Receive event-based notifications: @@ -219,7 +223,7 @@ geofence_status_destroy(status_h);
    - +

    Retrieving Geofence Information

    To get information about the geofence:

    @@ -258,6 +262,24 @@ free(ssid); + +

    Tracking the User for Proximity Alerts

    + +

    To get information about the proximity state:

    +
      +
    1. You can get notifications about the proximity state updates using the state update callback. The callback is invoked on an event, receiving the current state of the user with respect to proximity with each call.

      +

      Register the proximity state update callback using the geofence_manager_set_geofence_proximity_state_changed_cb() function.

      +
      +geofence_manager_set_geofence_proximity_state_changed_cb(manager, proximity_state_changed, NULL);
      +
    2. +
    3. Define the callback function:

      +
      +void
      +proximity_state_changed(int geofence_id, geofence_proximity_state_e state, geofence_proximity_provider_e provider, void *user_data) {}
      +
    + + + @@ -267,4 +289,4 @@ free(ssid); - +