我正在尝试嵌入Google Maps Directions API。目前可以正常使用,但我想包括出发时间,因此它可以根据出发时间的交通状况显示出行程需要多长时间。那有可能吗?我已经阅读了一些文档,并指出可以使用“ duration_in_traffic”,但未指定如何使用...有人可以帮忙
onLoginFacebook = () => {
LoginManager.logInWithPermissions(['public_profile', 'email'])
.then(result => {
if (result.isCancelled) {
alert('cancelled');
}
console.log(
`login success with permissions: ${result.grantedPermissions.toString()}`,
);
return AccessToken.getCurrentAccessToken();
})
.then(data => {
const credential = RNFirebase.auth.FacebookAuthProvider.credential(
data.accessToken,
);
return RNFirebase.auth().signInWithCredential(credential);
})
.then(currentFBUser => {
console.log(`Facebook Login with user: ${JSON.stringify(currentFBUser)}`);
//NOT WORKING
const {currentUser} = firebase.auth();
const uid = currentUser.uid;
//NOT WORKING
firebase.auth().onAuthStateChanged(authedUser => {
if (authedUser) {
Actions.home();
} else {
Actions.checkAuth();
}
});
})
.catch(error => {
console.log(`Login failed with ${error}`);
});
};