PostHog.setup问题只发生在使用xcode的android中。它产生的错误是"apiKey不能为空或空“。在ios中,它工作得非常完美--这对我来说似乎很奇怪,我不知道我做错了什么--函数的用法如下
import Posthog from 'posthog-react-native';
import Gleap from 'react-native-gleapsdk'
export default function App() {
useAutoUpdateAppHandler({
versionUrl: config.versionUrl,
versionRelease: config.versionRelease,
appName: 'UPchieve',
});
Posthog.setup(posthogConfig.token, posthogConfig.settings)
Gleap.initialize(gleapConfig.token)
}
this is the config
const Config = {
demo: {
webSocketUrl: 'https:...',
socketUrl: 'wss://demo....',
baseUrl: 'https://demo....',
versionUrl: 'https://cdn....',
versionRelease: '2.0.0',
},
prod: {
baseUrl: 'https://...',
},
posthog: {
token: '',
settings: {
host: 'https://...',
captureApplicationLifecycleEvents: true,
captureDeepLinks: true,
iOS: {
capturePushNotifications: true,
}
}
},
}发布于 2022-04-21 20:07:24
如果您的posthog.token是实际配置中可能导致错误的空字符串
在文献资料中,您可以看到令牌应该是PostHog项目设置页面中的"Project键“。https://app.posthog.com/project/settings如果你在PostHog云上
https://stackoverflow.com/questions/71848064
复制相似问题