6.1.3 • Published 1 year ago

@felipeclopes/capacitor-google-fit v6.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@perfood/capacitor-google-fit

Capacitor plugin to read data from Google Fit.

Install

npm install @perfood/capacitor-google-fit
npx cap sync

API

connect()

connect() => Promise<void>

Connect to Google Fit


disable()

disable() => Promise<void>

Disable Google Fit


logout()

logout() => Promise<void>

Logout from Google Fit


open()

open() => Promise<void>

Open


isAllowed()

isAllowed() => Promise<AllowedResult>

Returns wether the permissions are ok or not

Returns: Promise<AllowedResult>


isPermissionGranted()

isPermissionGranted() => Promise<AllowedResult>

Check if permission is granted

Returns: Promise<AllowedResult>


isInstalled()

isInstalled() => Promise<{ value: boolean; }>

Check if Google Fit is installed

Returns: Promise<{ value: boolean; }>


getHistory(...)

getHistory(call: QueryInput) => Promise<DayContainer>

Get history

ParamType
callQueryInput

Returns: Promise<DayContainer>


getHistoryActivity(...)

getHistoryActivity(call: QueryInput) => Promise<ActivityContainer>

Get history activity

ParamType
callQueryInput

Returns: Promise<ActivityContainer>


addListener('googleFitAllowed', ...)

addListener(eventName: 'googleFitAllowed', listenerFunc: (info: GoogleFitPermissionData) => void) => Promise<PluginListenerHandle>
ParamType
eventName'googleFitAllowed'
listenerFunc(info: GoogleFitPermissionData) => void

Returns: Promise<PluginListenerHandle>


Interfaces

AllowedResult

PropType
allowedboolean

DayContainer

PropType
daysHistoryData[]

HistoryData

PropTypeDescription
startstring
endstring
distancestringDistance travelled in meters. Valid range: 0—100 meters per second
speedstringmeters per second
caloriesstring

QueryInput

PropType
startTimeDate
endTimeDate

Date

Enables basic storage and retrieval of dates and times.

MethodSignatureDescription
toString() => stringReturns a string representation of a date. The format of the string depends on the locale.
toDateString() => stringReturns a date as a string value.
toTimeString() => stringReturns a time as a string value.
toLocaleString() => stringReturns a value as a string value appropriate to the host environment's current locale.
toLocaleDateString() => stringReturns a date as a string value appropriate to the host environment's current locale.
toLocaleTimeString() => stringReturns a time as a string value appropriate to the host environment's current locale.
valueOf() => numberReturns the stored time value in milliseconds since midnight, January 1, 1970 UTC.
getTime() => numberGets the time value in milliseconds.
getFullYear() => numberGets the year, using local time.
getUTCFullYear() => numberGets the year using Universal Coordinated Time (UTC).
getMonth() => numberGets the month, using local time.
getUTCMonth() => numberGets the month of a Date object using Universal Coordinated Time (UTC).
getDate() => numberGets the day-of-the-month, using local time.
getUTCDate() => numberGets the day-of-the-month, using Universal Coordinated Time (UTC).
getDay() => numberGets the day of the week, using local time.
getUTCDay() => numberGets the day of the week using Universal Coordinated Time (UTC).
getHours() => numberGets the hours in a date, using local time.
getUTCHours() => numberGets the hours value in a Date object using Universal Coordinated Time (UTC).
getMinutes() => numberGets the minutes of a Date object, using local time.
getUTCMinutes() => numberGets the minutes of a Date object using Universal Coordinated Time (UTC).
getSeconds() => numberGets the seconds of a Date object, using local time.
getUTCSeconds() => numberGets the seconds of a Date object using Universal Coordinated Time (UTC).
getMilliseconds() => numberGets the milliseconds of a Date, using local time.
getUTCMilliseconds() => numberGets the milliseconds of a Date object using Universal Coordinated Time (UTC).
getTimezoneOffset() => numberGets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC).
setTime(time: number) => numberSets the date and time value in the Date object.
setMilliseconds(ms: number) => numberSets the milliseconds value in the Date object using local time.
setUTCMilliseconds(ms: number) => numberSets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
setSeconds(sec: number, ms?: number | undefined) => numberSets the seconds value in the Date object using local time.
setUTCSeconds(sec: number, ms?: number | undefined) => numberSets the seconds value in the Date object using Universal Coordinated Time (UTC).
setMinutes(min: number, sec?: number | undefined, ms?: number | undefined) => numberSets the minutes value in the Date object using local time.
setUTCMinutes(min: number, sec?: number | undefined, ms?: number | undefined) => numberSets the minutes value in the Date object using Universal Coordinated Time (UTC).
setHours(hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => numberSets the hour value in the Date object using local time.
setUTCHours(hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => numberSets the hours value in the Date object using Universal Coordinated Time (UTC).
setDate(date: number) => numberSets the numeric day-of-the-month value of the Date object using local time.
setUTCDate(date: number) => numberSets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
setMonth(month: number, date?: number | undefined) => numberSets the month value in the Date object using local time.
setUTCMonth(month: number, date?: number | undefined) => numberSets the month value in the Date object using Universal Coordinated Time (UTC).
setFullYear(year: number, month?: number | undefined, date?: number | undefined) => numberSets the year of the Date object using local time.
setUTCFullYear(year: number, month?: number | undefined, date?: number | undefined) => numberSets the year value in the Date object using Universal Coordinated Time (UTC).
toUTCString() => stringReturns a date converted to a string using Universal Coordinated Time (UTC).
toISOString() => stringReturns a date as a string value in ISO format.
toJSON(key?: any) => stringUsed by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization.

ActivityContainer

PropType
activitiesHistoryActivityData[]

HistoryActivityData

PropType
startstring
endstring
distancestring
speedstring
caloriesstring
activitystring
weightstring
stepsstring
sourceNamestring
sourceTypestring

PluginListenerHandle

PropType
remove() => Promise<void>

GoogleFitPermissionData

PropType
value'success' | 'failure'
6.1.0

1 year ago

6.0.1

1 year ago

6.0.0

1 year ago

6.1.1

1 year ago

6.0.2

1 year ago

6.1.3

1 year ago

2.0.0-alpha.10

1 year ago