Mic*_*ael 6 javascript react-native expo react-native-permissions expo-eas
我正在尝试让react-native-permissions我的 Expo 开发客户端版本运行。构建成功,但是当我启动应用程序时,我得到一个相对通用的“未检测到权限处理程序”。错误。
研究建议添加权限ios/Podfile并确保ios/<appname>/Info.plist条目需要存在。
该应用程序无需react-native-permissions即可运行,但我想使用该包来检查是否设置了权限并引导用户进行设置(如果没有)。
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone"
pod 'Permission-SpeechRecognition', :path => "#{permissions_path}/SpeechRecognition"
Run Code Online (Sandbox Code Playgroud)
<key>NSMicrophoneUsageDescription</key>
<string>CUSTOM: Allow to access the microphone</string>
<key>NSSpeechRecognitionUsageDescription</key>
<string>CUSTOM: Allow to securely recognize user speech</string>
Run Code Online (Sandbox Code Playgroud)
...
"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"
}
]
]
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
小智 -2
我也有同样的问题。然后我阅读了您分享的错误消息,其中包含问题的解决方案。以下步骤对我有用:
我不需要做第三步。
| 归档时间: |
|
| 查看次数: |
6446 次 |
| 最近记录: |