Skip to content

[Android] Application needs OAuth consent from the user #96

Description

@NguyenHoangMinhkkkk

This Error happen with getHeartRate method
while the othes methods are working fine after sign in and allow permissions (permission HeartRate included).


const permissions = [
{
kind: Fitness.PermissionKinds.Steps,
access: Fitness.PermissionAccesses.Read,
},
{
kind: Fitness.PermissionKinds.Calories,
access: Fitness.PermissionAccesses.Read,
},
{
kind: Fitness.PermissionKinds.Distances,
access: Fitness.PermissionAccesses.Read,
},
{
kind: Fitness.PermissionKinds.HeartRate,
access: Fitness.PermissionAccesses.Read,
},
];


let currentDate = new Date();
let start = new Date(2021, 1, 1, 0, 0, 0);
let end = new Date( currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate(), 23, 59, 59,);

const getHeartRate = () => {
Fitness.getHeartRate({ startDate: start, endDate: end, interval: 'days' })
.then((res) => {
console.log('getHeartRate', res);
})
.catch((e) => {
console.log('error', e);
});
};


Screen Shot 2021-02-26 at 16 09 13
Screen Shot 2021-02-26 at 16 48 51
Screen Shot 2021-02-26 at 16 59 23

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions