我正在使用 React Native。当我尝试上传 Pod 时,我遇到了这个问题。我已经成功安装了 node_modules,但我遇到了这个问题。问题是什么?如果我们删除 package-lock.json 和 node_modules 文件夹,我重新安装了 npm。但是我在进行 pod install 时遇到了这个问题。
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target '...' do
# use_frameworks!
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/React'
pod 'React-DevSupport', :path => '../node_modules/react-native/React'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod …Run Code Online (Sandbox Code Playgroud) I want to run the function in the background. But I get an error. The error I received is
"nw_connection_receive_internal_block_invoke.
为什么会出现这个问题?我正在iOS 13设备上尝试。但是我无法在后台运行该应用程序。我在中添加了后台运行功能Info.plist。我想interator.tickTimer在后台运行该功能。但是我遇到了错误。在后台不起作用。在后台,我想定期从Firebase检索数据。
import BackgroundTasks
@available(iOS 13.0, *)
extension AppDelegate {
func cancelAllPandingBGTask() {
BGTaskScheduler.shared.cancelAllTaskRequests()
}
func scheduleImageFetcher() {
let request = BGProcessingTaskRequest(identifier: "....")
request.requiresNetworkConnectivity = true // Need to true if your task need to network process. Defaults to false.
request.requiresExternalPower = false
request.earliestBeginDate = Date(timeIntervalSinceNow: 40)
do {
try BGTaskScheduler.shared.submit(request)
} catch { …Run Code Online (Sandbox Code Playgroud)