我是本机反应新手,并且一直在创建一个新应用程序。我尝试将我的项目从 React Native 0.60 更新到 0.63。执行此操作时,我必须创建一个新的项目文件才能更新我的 cocoapods。完成此操作后,我厌倦了在 iOS 模拟器上运行我的应用程序,但出现错误。
在 Xcode 中打开我的项目时,出现以下错误。
我不确定这是否与我的豆荚有关。在网上做了一些研究后,我无法找到这个问题的答案。
这是我的个人资料文件。
# Uncomment the next line to define a global platform for your project
platform :ios, '10.0'
target 'Example' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for Example
target 'ExampleTests' do
inherit! :search_paths
# Pods for testing
end
end
target 'Example-tvOS' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# …Run Code Online (Sandbox Code Playgroud)我是本机反应的新手,我正在尝试通过 iOS 设置推送通知。
我已经安装了 pushNotificationios 并按照给出的说明进行了操作。我也注册为 Apple 开发人员。
当我运行我的应用程序时,推送通知似乎不起作用。当我进入我的 iPhone 设置并点击应用程序时,它不会显示通知。
这是我的代码
import PushNotificationIOS from '@react-native-community/push-notification-ios';
import PushNotification from "react-native-push-notification";
const configure = () => {
PushNotification.configure({
onRegister: (token) => {
console.log('TOKEN:', token);
//process token
},
onNotification: (notification) => {
// process the notification
console.log("NOTIFICATION:", notification);
// required on iOS only
notification.finish(PushNotificationIOS.FetchResult.NoData);
},
permissions: {
alert: true,
badge: true,
sound: true
},
popInitialNotification: true,
requestPermissions: true,
});
};
export {
configure,
};Run Code Online (Sandbox Code Playgroud)
我最近尝试将我的 react native 从 0.62 更新到 0.63。
执行此操作后,我通过 cd iOS 进入我的 iOS 文件夹并运行 pod install,执行此操作时,我在终端中收到以下错误消息。
我试过按照错误提示运行命令 pod repo update ,但这并不能解决问题。
我曾尝试在线搜索错误,但无法找到修复方法。
这是我的个人资料文件。
platform :ios, '10.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'Example' do
# Pods for Example
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod …Run Code Online (Sandbox Code Playgroud)我是本机反应新手,并且有一个带有图标和文本的选项卡栏。我希望每个图标在活动时改变颜色,但似乎无法使其工作。
这是我的代码。
const TabNavigator = createBottomTabNavigator({
Home: {
screen: HomeScreen,
navigationOptions: ({tintColor}) => ({
title: 'Home',
tabBarIcon: <Icon name={Platform.OS === 'ios' ? 'ios-home' : 'md-home'} size={25}
color={tintColor} />,
}),
},
Listen: {
screen: MainScreen,
navigationOptions: ({tintColor}) => ({
title: 'Listen',
tabBarIcon: <FontAwesome name="microphone" size={25}
color={tintColor} />,
}),
},
Events: {
screen: EventScreen,
navigationOptions: ({tintColor}) => ({
title: 'Events',
tabBarIcon: <Icon name={Platform.OS === 'ios' ? 'ios-calendar' : 'md-calendar'} size={25}
color={tintColor} />,
}),
},
About: {
screen: AboutScreen,
navigationOptions: ({tintColor}) => ({ …Run Code Online (Sandbox Code Playgroud)