React Native
Last updated
Was this helpful?
Last updated
Was this helpful?
devId: string
➡ The dev-id provided to you when signing up with Terra
referenceId: string
➡ A random string used to characterise a user on your server
returns
Promise<SuccessMessage>
Initialise a device connection. This function needs to be called once only when first creating the connection.
connection: Connections
➡ An ENUM from the Connections class signifying the connection you wish to initiate for.
(Optional) customPermissions: Set<CustomPermissions>
➡ This is defaulted as an empty Set
. If you want to make a more granular permissions request, you may send us a set of CustomPermissions
startIntent: String?
➡ The path to the activity you wish to display when the user scans a freestylelibre from the background (i.e "co.tryterra.terra.example.MainActivity") Only valid for Android
schedulerOn: Bool
➡ A boolean dictating if you wish turn on background delivery. Defaults to true. Please see Background Delivery section for setup.
returns
Promise<SuccessMessage>
connection: Connections
➡ An ENUM from the Connections class signifying the connection get user_id for.
returns
Promise<GetUserId>
connection: Connections
➡ An ENUM from the Connections class signifying the connection you wish to initiate for.
startDate: Date
➡ The beginning of the request in either Date or Unix Timestamp
endDate: Date
or endDate: Long
➡ The end of the request in either Date or Unix Timestamp
toWebhook: Bool
➡ Whether or not to send data to your webhook. If false, DataMessage
on the returned Promise
will contain the data in the data
field.
returns
Promise<DataMessage>
connection: Connections
➡ An ENUM from the Connections class signifying the connection you wish to initiate for.
startDate: Date
➡ The beginning of the request in either Date or Unix Timestamp
endDate: Date
or endDate: Long
➡ The end of the request in either Date or Unix Timestamp
toWebhook: Bool
➡ Whether or not to send data to your webhook. If false, DataMessage
on the returned Promise
will contain the data in the data
field.
returns
Promise<DataMessage>
connection: Connections
➡ An ENUM from the Connections class signifying the connection you wish to initiate for.
startDate: Date
➡ The beginning of the request in either Date or Unix Timestamp
endDate: Date
or endDate: Long
➡ The end of the request in either Date or Unix Timestamp
toWebhook: Bool
➡ Whether or not to send data to your webhook. If false, DataMessage
on the returned Promise
will contain the data in the data
field.
returns
Promise<DataMessage>
connection: Connections
➡ An ENUM from the Connections class signifying the connection you wish to initiate for.
startDate: Date
➡ The beginning of the request in either Date or Unix Timestamp
endDate: Date
or endDate: Long
➡ The end of the request in either Date or Unix Timestamp
toWebhook: Bool
➡ Whether or not to send data to your webhook. If false, DataMessage
on the returned Promise
will contain the data in the data
field.
returns
Promise<DataMessage>
connection: Connections
➡ An ENUM from the Connections class signifying the connection you wish to initiate for.
toWebhook: Bool
➡ Whether or not to send data to your webhook. If false, DataMessage
on the returned Promise
will contain the data in the data
field.
returns
Promise<DataMessage>
Writes activity data into Apple Health
connection: Connections
: The connection type (Connections_
) for which to post the data. For example, Connections_.APPLE
to write data to Apple Health.
payload: TerraActivityPayload
: A TerraActivityPayload
object that contains the activity data you wish to post. This can include details like activity type, heart rate, distance, calories, and other metrics.
returns
A Promise
that resolves to a SuccessMessage
object indicating the success of the operation or rejects with an error.
Fetches permissions granted by Health connect
**returns**
`Promise<Array<String>>
`
token: string
➡ A token used for authentication. Generate one here: