我的应用程序与 Expo 一起使用,我import * as Google from "expo-google-app-auth";用于来自谷歌的登录用户。在开发模式下,它的工作正常。
但在独立模式下,
它重定向我以选择电子邮件,在我选择它之后将我重定向到 google.com 主页而不是返回到我的应用程序
问题:为什么将我重定向到谷歌,我该如何处理(再次 - 在开发模式下它的工作)
我的谷歌登录应用
try {
const result = await Google.logInAsync({
androidClientId: "556835760268-jm5v5u3h1bu4rcontent.com",
androidStandaloneAppClientId: "556835760268-jm5v5u3h1bu4uea3jr788tent.com",
scopes: ["profile", "email"],
});
Run Code Online (Sandbox Code Playgroud)
我的 app.json 文件:
{
"expo": {
"name": "Lior",
"slug": "Lior",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"scheme": "myapp",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"bundleIdentifier": "com.roei.liorApp",
"buildNumber": "1.0.0"
},
"web": {
"favicon": …Run Code Online (Sandbox Code Playgroud)我需要将 slugs 放入 Header 组件中,该组件可在布局内的所有网站中重复使用:
const Layout = ({ children }) => {
return (
<>
<Header />//////////this one.
{children}
<Footer />
</>
);
};
Run Code Online (Sandbox Code Playgroud)
我的 slugs 来自服务器端,我只需要在标头中动态获取它们一次。
标题内部类似:
categoriesLinks.map(category=> {
return <div>{category.SLUG}</div>
})
Run Code Online (Sandbox Code Playgroud)
但因为它是一个可重用的组件,我不知道如何以及在哪里调用getServerSidePropsor getStaticProps。
getInitialProps如果我尝试在 中获取它_app,它不会获取它(获取undefined)处理这个问题的正确方法是什么?这似乎是一个非常大的问题,我找不到合适的解决方案。
我在 use effect 中有两个函数,我希望第一个函数只调用一次,如果“meetingArray”的状态改变,第二个函数调用每个渲染
useEffect(() => {
getWeekMeetings();
meetingArray();
}, []);
Run Code Online (Sandbox Code Playgroud)
我该如何处理?