Live Check-in

Last updated 3 hours ago

App events tagged on the Placeline

This product feature is still under development and is not available in production. Please reach out to us on Slack if you want an early access.

Create check-in event

Add a point-in-time-and-place check-in event from a device using the following iOS/Android SDK method. Callback returns errors if you add a check-in event before SDK is initialized.

iOS (Swift)
iOS (Obj C)
Android (Java)
let name = "payment"
let metaData : [String : Any] = ["order_id" : 505054, "customer_name" : "Alex"]
HyperTrackCore.createCheckin(forName: name, metaData: metaData) { [weak self] (error) in
/// handle error if any
}
NSString *name = @"payment";
NSDictionary *metaDict = [NSDictionary dictionaryWithObjects:@[@505054, @"Alex"]
forKeys:@[@"order_id", @"customer_name"]];
[HTCore createCheckinForName:name metaData:metaDict completionHandler:^(HTCoreError * _Nullable error) {
/// handle error if any
}];
String name = "payment";
HashMap<String, String> metadata = new HashMap<>();
metadata.put("order_id", "678990");
metadata.put("customer_name", "Alex");
HyperTrackCore.createCheckin(name, metadata, new HyperTrackCallback() {
@Override
public void onSuccess(@NonNull SuccessResponse response) {
Log.d("MainActivity", "successfully created check in events");
}
@Override
public void onError(@NonNull ErrorResponse errorResponse) {
Log.d("MainActivity", "failed to create check in events");
}
});

Name

Type

Description

name

String

Name of the check-in event

metadata

Dictionary

Dictionary of type <String, Any>. Use this to send extra information with check-in event.

completionHandler

Block

A callback which takes an optional CoreError as a parameter and returns Void. Use this handler to determine if there were any issues while sending check-in event.

Consuming check-in event

The check-in events that you create via the SDK can be consumed across different platforms.

Webhook

Enable webhook to receive check-in events on your server. To enable webhook, visit the console, add your webhook URL, and select check-in as the event type. Here is the format of the data JSON that is sent for a check-in event.

PROPERTY

TYPE

DESCRIPTION

name

string

Name of the check-in event that was sent by you

metadata

JSON

Metadata of the check-in event that was sent by you

activity

string

Activity of the device when the check-in event was sent. Could be: stop, walk, run, cycle, driveor no_data if the activity is unknown

location

GeoJSON

Location of the device, in GeoJSON format, when the check-in event was sent

no_data_reason

string

Reason why the activity and/or location is unknown when the check-in event was sent. Could be one of the following:

  1. tracking_paused

  2. sdk_killed

  3. gps_lost

  4. location_disabled

  5. location_permission_denied

  6. activity_permission_denied

  7. airplane_mode_on

  8. device_switched_off

Sample event

{
"id": "5e07df7e-cf01-4571-b516-e76e366efb90",
"device_id": "17e2a12d-d8de-43d1-9566-849135fdb577",
"type": "checkin",
"recorded_at": "2018-07-20T04:09:33.945000+00:00",
"data": {
"name": "payment",
"metadata": {
"order_id" : 505054,
"customer_name" : "Alex"
},
"activity": "walk",
"location": {
"coordinates": [
77.6342144,
12.929061
],
"type": "point"
}
}
}