通过用户名和密码或使用“aws-amplify”中的 { Auth } 联合身份可以轻松登录 AWS Cognito 会话
Auth.signIn({ username: email, password: password})
Run Code Online (Sandbox Code Playgroud)
或者
Auth.federatedSignIn({ provider: 'Google' }); // or 'SignInWithApple' || 'Facebook'
Run Code Online (Sandbox Code Playgroud)
通过以下方式可以轻松退出 Cognito 会话
Auth.signOut();
Run Code Online (Sandbox Code Playgroud)
可能值得注意的是,我们使用 expo-web-browser 来启动应用内浏览器会话,而不是定向到外部 safari/chrome 窗口。
问题是 Auth.signOut() 调用不会撤销 Google/Apple/Facebook 会话中的令牌,因此每当Auth.federatedSignIn({ provider: 'Google' });再次调用时,用户已经登录。
这是次优的,因为这意味着如果用户通过 Google / Facebook / Apple 登录,他们将无法使用不同的 Google / Facebook / Apple 帐户登录。它还使得调试联合提供商首次登录时发生的问题变得非常困难,因为它不允许测试人员更改帐户。
有没有人在最新版本的 Expo 中找到有效的解决方案?(截至撰写本文时为 35)
这是一个类似的问题,没有答案并且没有提供很多背景信息
本文档建议致电
GET https://mydomain.auth.{region}.amazoncognito.com/logout?
client_id={CLIENT_ID}&
logout_uri=https://myclient/logout
Run Code Online (Sandbox Code Playgroud)
但我在调用时没有在我的应用程序中使用此方法
fetch('https://{MY_DOMAIN}.auth.us-west-2.amazoncognito.com/logout?client_id={CLIENT_ID}&redirect_uri=exp://127.0.0.1:19000&response_type=code', {
method: 'GET',
//Request Type
})
Run Code Online (Sandbox Code Playgroud)
从我的注销按钮
这个线程 …
这是我的视图样式
<View
style={{
flexDirection: 'column',
marginTop: 15,
borderTopWidth: 2,
borderStyle: 'dashed',
borderTopColor: 'rgb(225, 225,225)',
margin: 20,
alignSelf: 'center',
paddingTop: 10,
}}
>
Run Code Online (Sandbox Code Playgroud)
在 Android 上,我得到一条漂亮的虚线
然而,在 iOS 上,我没有收到任何消息
和
WARN Unsuppported dashed / dotted border style
Run Code Online (Sandbox Code Playgroud)
并且包含视图的其余部分根本不渲染
按照此处的React Native 重新启动文档,我有以下代码:
import Animated, { useSharedValue, useAnimatedStyle } from 'react-native-reanimated';
function WobbleExample(props) {
const rotation = useSharedValue(0);
const animatedStyle = useAnimatedStyle(() => {
return {
transform: [{ rotateZ: `${rotation.value}deg` }],
};
});
return (
<>
<Animated.View style={[styles.box, animatedStyle]} />
<Button
title="wobble"
onPress={() => {
rotation.value = withRepeat(withTiming(10), 6, true)
}}
/>
</>
);
}
Run Code Online (Sandbox Code Playgroud)
但我在我的 Metro 控制台中看到这个,应用程序崩溃了
Error: Reading from `_value` directly is only possible on the UI runtime
This error is located at:
in AnimatedComponent (at …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Azure DevOps REST API 来计算我们存储库中拉取请求的总数,并最终使用它来希望从 git 数据中获得一些更有用的信息。
我曾尝试使用对存储库的 GET 请求返回拉取请求列表,但 Azure API 将每个请求的响应限制为 101。您可以使用 $top 和 $skip 来更改返回的响应数量和数量,并使用 $count 来计算返回的响应。然而,这仍然将结果限制在绝对最大值 1,000 并返回包含在 PR 中的整个数据集,当我真的只需要知道其中的实例数时,我不需要它的数据完全返回,因为这会在大型 repos 上产生巨大的结果。
这是我正在使用的 GET 请求:
https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repository}/pullrequests?$top=999&$count=true&searchCriteria.status=all&api-version=5.0
Run Code Online (Sandbox Code Playgroud)
这是我使用 Postman 返回项目数的测试脚本
var body = JSON.parse(responseBody);
tests[body.value.length + " Pull Requests in this Repository" ] = true;
Run Code Online (Sandbox Code Playgroud)
这将返回 101 的响应计数,正如预期但不期望的那样。非常感谢任何提示和技巧!
这里提到的解决方案讨论了如何使用 ATTrackingManager 类进行设置,但是,它没有直接暴露给 React Native。
使用react-native-tracking-transparency包在构建时给我带来了一个问题:
“未定义的符号_RCTRegisterModule”
因为只有在不包含 use_flipper 时它才有效!在你的podfile中......所以我被困住了,不想按照这里的解决方案中的建议进行补丁包(这意味着修复已经被合并,但在用这个构建时我仍然看到“未定义的符号_RCTRegisterModule”......
想知道是否有针对 React Native 的 ATTrackingManager 类的包装器?
我的团队开发了一个应用程序,并将发布到各自的应用程序商店。
\n尝试构建应用程序的用户是拥有 Apple 开发人员帐户的组织的成员。
\n运行“eas build”时,我们收到以下错误
\neas build \n\xe2\x9c\x94 Build for platforms \xe2\x80\xba All\n\xe2\x9c\x94 Linked to project @{user}/{ProjectName}\n\xe2\x9c\x94 Using remote Android credentials (Expo server)\nUsing Keystore from configuration: Build Credentials {ProjectName} (default)\n\xe2\x9c\x94 Compressed project files 1s (11.8 MB)\n\xe2\x9c\x94 Uploaded to EAS 21s\n\xe2\x9c\x94 Using remote iOS credentials (Expo server)\n\nIf you provide your Apple account credentials we will be able to generate all necessary build credentials and fully validate them.\nThis is optional, but without Apple account access you will need …Run Code Online (Sandbox Code Playgroud) react-native ×3
expo ×2
azure-devops ×1
build ×1
css ×1
git ×1
postman ×1
reactjs ×1
styling ×1