我很困惑为什么在用户成功通过身份验证后,下面的代码片段在控制台中显示电子邮件和全名为空。我仔细阅读了文档并尝试了一切可能的方法。任何帮助将不胜感激。
async function onAppleButtonPress() {
// performs login request
const appleAuthRequestResponse = await appleAuth.performRequest({
requestedOperation: AppleAuthRequestOperation.LOGIN,
requestedScopes: [AppleAuthRequestScope.EMAIL, AppleAuthRequestScope.FULL_NAME],
});
//api getting current state of the user
const credentialState = await appleAuth.getCredentialStateForUser(appleAuthRequestResponse.user);
if (credentialState === AppleAuthCredentialState.AUTHORIZED) {
// user is authenticated
console.log("email is",appleAuthRequestResponse.email);
console.log("full name is",appleAuthRequestResponse.fullName);
}
}
Run Code Online (Sandbox Code Playgroud) 我正在开发一个应用程序,我想在其中像facebook一样显示时间差异。以下代码显示时间差为yyyy-mm-dd hh:mm:ss
timestamp.toDate().difference(DateTime.now()).toString(),
Run Code Online (Sandbox Code Playgroud)
如果时间少于一分钟,我希望它以秒为单位显示时间。60 秒后,它应该仅显示以分钟为单位的时间差异,并且应删除秒部分。60 分钟后,应以小时和分钟显示时间,秒部分应删除。最后,当到了 24 小时时,它应该显示几天前的时间。非常欢迎您提出宝贵意见、建议和意见。任何帮助将不胜感激。提前致谢。