我正在尝试让react-native-permissions在我的世博网络客户端构建中运行。构建成功,但当我启动应用程序时,我得到了一个相对通用的“未检测到权限处理程序”。错误。
研究表明,向ios/Podfile添加权限并确保需要存在ios/<appname>/Info.plist条目。
该应用程序工作没有反应-本机-权限,但我想使用包检查是否设置了权限,如果没有引导用户设置。
ios/Podfile
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
pod 'Permission-SpeechRecognition', :path => "#{permissions_path}/SpeechRecognition"ios/< appname >/Info.plist (相关条目)
<key>NSMicrophoneUsageDescription</key>
<string>CUSTOM: Allow to access the microphone</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>CUSTOM: Allow to securely recognize user speech</string>app.config.js (博览会)
...
"plugins": [
"@react-native-firebase/app",
"@react-native-firebase/perf",
"@react-native-firebase/crashlytics",
"@react-native-google-signin/google-signin",
["react-native-fbsdk-next",
{
"appID": "xxx",
"clientToken": "xxx",
"displayName": "xxx",
"advertiserIDCollectionEnabled": false,
"autoLogAppEventsEnabled": false,
"isAutoInitEnabled": true
}
],
[
"@react-native-voice/voice",
{
"microphonePermission": "CUSTOM: Allow access the microphone",
"speechRecognitionPermission": "CUSTOM: to securely recognize user speech"
}
]
]工作流程
expo prebuild --clean
cd ios
# modify `Podfile` and add below two lines
permissions_path = '../node_modules/react-native-permissions/ios'
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
pod 'Permission-SpeechRecognition', :path => "#{permissions_path}/SpeechRecognition"
pod install
cd ..
eas build --platform ios --profile development --local

发布于 2022-08-17 00:29:50
我也有同样的问题。然后,我阅读了您共享的错误消息,其中包含了问题的解决方案。以下步骤对我有效:
请检查Podfile
我不需要做第三步。
https://stackoverflow.com/questions/72413047
复制相似问题