标签: react-native-ios

试图添加mailto - 反应原生

Mailto似乎无法正常工作.所有发生的事情是图标似乎被按下,但没有动作发生.拍出这个警告:

警告

警告

<TouchableHighlight onPress={() => Linking.openURL('mailto:mailto@deniseleeyohn.com?subject=abcdefg&body=body')}>
                      <Icon style={styles.icons} size={SIZE} name='envelope'/> 
    </TouchableHighlight>
Run Code Online (Sandbox Code Playgroud)

mailto react-native react-native-ios

9
推荐指数
2
解决办法
1万
查看次数

iOS App在发布模式下崩溃"undefined不是对象(评估'e.propTypes.children')"

仅在发布模式下崩溃.然后,在Schema设置中,对于发布模式,我启用了"debug executable"并运行并出现以下错误.我不知道这个错误来自哪里.没有堆栈跟踪.我该如何进一步处理?请帮我.

[error] [tid:com.facebook.react.JavaScript] undefined不是对象(评估'e.propTypes.children')

完整系统日志如下

Jun 10 10:03:03 My-MacBook-Pro assertiond[2748]: Submitted job with label: UIKitApplication:com.testdomian.testapp[0x894c][2748]
Jun 10 10:03:03 My-MacBook-Pro SpringBoard[2743]: [com.testdomian.testapp] Bootstrap complete with label: UIKitApplication:com.testdomian.testapp[0x894c][2748]
Jun 10 10:03:03 My-MacBook-Pro watchlistd[2807]: Now playing app did change to '(null)' (playing: 0) from '(null)'
Jun 10 10:03:03 My-MacBook-Pro watchlistd[2807]: WLKPlaybackSummary - Parameter failed validation bundleID. It is nil
Jun 10 10:03:03 My-MacBook-Pro testapp[5211]: assertion failed: 16F73 14E269: libxpc.dylib + 64131 [624BAF4F-2E03-34F8-ACBA-970B04637786]: 0x7d
Jun 10 10:03:03 My-MacBook-Pro testapp[5211]: Falling back to loading …
Run Code Online (Sandbox Code Playgroud)

iphone ios react-native react-native-ios

9
推荐指数
1
解决办法
752
查看次数

具有反应导航的DrawerNavigation标题

我在ReactNative上,我正在使用native-base和react-navigation npm.

我得到了这个,我的问题是如何有一个标题,直到按钮"Home",我查看了反应导航的文档,但它并没有真正清除.

https://github.com/react-community/react-navigation/blob/master/docs/api/navigators/DrawerNavigator.md

在此输入图像描述

像这样(图像是固定的,只是在这里放置一个徽标)

在此输入图像描述

javascript navigation-drawer react-native react-native-android react-native-ios

9
推荐指数
1
解决办法
1万
查看次数

如何解决"找不到config.h文件"?从设备上的本机运行app时?

获取错误"找不到Config.h文件,词法或预处理器错误."

我在xcode项目中运行设备中的应用程序.

我有谷歌,并找到了许多解决方案,但没有工作,我试过这个

https://github.com/facebook/react-native/issues/14382

当我尝试在iOS模拟器中运行时出现此错误

https://github.com/facebook/react-native/issues/10401

试图按照上面的网址但没有奏效.

请让我知道如何解决这个问题.谢谢

android github ios react-native react-native-ios

9
推荐指数
2
解决办法
5064
查看次数

必须通过contentContainerStyle prop应用ScrollView子布局

我正在使用反应原生swiper.并且显示此错误我不知道为什么.怎么解决?在过去,没有像这样的问题.这是第一次发生.怎么了?

这是完整错误的图像:

这是完整错误的图像

<Swiper loop={false}
          index={0}
          style={styles.wrapper}
          activeDotColor={'#EEE'}>

          <View style={styles.slide1}>
            <Text style={styles.text}>Choose category you like</Text>
          </View>
          <View style={styles.slide2}>
            <Text style={styles.text}>Bookmark articles that you</Text>
            <Text style={styles.text}>like</Text>
          </View>
          <View style={styles.slide3}>
            <Text style={styles.text}>Get notifications about your</Text>
            <Text style={styles.text}>chosen topic</Text>
            <Button style={styles.text} onPress={() => this.props.navigation.navigate("Home")}>
              <Text style={styles.text}>Main Screen</Text>
            </Button>
          </View>
        </Swiper>
      )
    } else {
      return <View></View>
    }
  }
}

const styles = {
  wrapper: {
    justifyContent: 'center',
    alignItems: 'center'
  },
  slide1: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#9DD6EB'
  },
  slide2: {
    flex: …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs react-native react-native-android react-native-ios

9
推荐指数
2
解决办法
6657
查看次数

React Native iOS:无法构建模块'yoga':'algorithm'文件未找到

我正在尝试使用此集成指南将React Native集成到现有的Swift iOS应用程序中:https://facebook.github.io/react-native/docs/integration-with-existing-apps.html.React Native的版本是0.53.0.

我已经成功安装了所有必需的pod,现在尝试构建项目,但总是得到以下编译错误:

在此输入图像描述 在此输入图像描述

在此输入图像描述

错误日志:

While building module 'yoga' imported from ...node_modules/react-native/React/Base/RCTConvert.h:19:
In file included from <module-includes>:1:
In file included from ...ios/Vandebron/Pods/Target Support Files/yoga/yoga-umbrella.h:15:
In file included from ...node_modules/react-native/ReactCommon/yoga/yoga/YGNode.h:13:
...node_modules/react-native/ReactCommon/yoga/yoga/Yoga-internal.h:11:10: fatal error: 'algorithm' file not found
#include <algorithm>
         ^~~~~~~~~~~
1 error generated.
In file included from ...node_modules/react-native/React/Views/RCTActivityIndicatorViewManager.m:10:
In file included from ...node_modules/react-native/React/Views/RCTActivityIndicatorViewManager.h:10:
In file included from ...node_modules/react-native/React/Views/RCTViewManager.h:13:
...node_modules/react-native/React/Base/RCTConvert.h:19:9: fatal error: could not build module 'yoga'
#import <yoga/Yoga.h
Run Code Online (Sandbox Code Playgroud)

ios react-native react-native-ios

9
推荐指数
1
解决办法
6329
查看次数

使用react-native-maps和use_frameworks找不到安装错误`React/RCTView.h'文件`

我似乎无法使用pod安装将react-native-maps安装到我的react本机ios项目中.我收到警告Missing dependency target "React"React/RCTView.h' file not found错误

https://github.com/react-community/react-native-maps/blob/master/docs/installation.md

我认为这是因为use_frameworks!pod文件中的标志.有没有合理的解决方法?

这是我的pod文件

platform :ios, '11.0'
target 'MyCoolApp' do
  use_frameworks!
  pod 'ViroReact', :path => '../node_modules/react-viro/ios/'
  pod 'ViroKit', :path => '../node_modules/react-viro/ios/dist/ViroRenderer/'
  # Required by RNFirebase
  pod 'Firebase/Core'
  pod 'Firebase/Auth'
  pod 'Firebase/Firestore'
  pod 'Firebase/Messaging'
  pod 'Fabric', '~> 1.7.5'
  pod 'Crashlytics', '~> 3.10.1'
  pod 'Firebase/Database'
  pod 'Firebase/RemoteConfig'
  pod 'Firebase/Storage'
  pod 'Firebase/Performance'
  pod 'Firebase/DynamicLinks'

  rn_path = '../node_modules/react-native'
  rn_maps_path = '../node_modules/react-native-maps'

  # See http://facebook.github.io/react-native/docs/integration-with-existing-apps.html#configuring-cocoapods-dependencies
  pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
  pod 'React', path: rn_path, subspecs: [ …
Run Code Online (Sandbox Code Playgroud)

cocoapods react-native react-native-ios react-native-maps

9
推荐指数
1
解决办法
1339
查看次数

React Native STUCK起始包装

出于某种原因,当我想启动我的React Native项目时,它会停留在'Starting Packager ...'部分.我试图删除节点包,并重新安装它们,通过yarn,npm安装它们,但没有运气.我不知道应该怎么解决这个问题:/(太尴尬了)

watchman react-native react-native-ios

9
推荐指数
3
解决办法
5109
查看次数

react-native log-ios返回没有找到真实设备的设备

我试图从一个js文件运行console.log为iOS应用程序反应原生.

在此之前,我曾尝试使用react native的调试功能' Shake Device ',但我无法成功.

现在我试图通过react-native log-ios运行命令行调试控制台,但它正在使用模拟器而不是真实设备并给出错误.

No active iOS device found
(node:26724) UnhandledPromiseRejectionWarning: undefined
(node:26724) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:26724) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Run Code Online (Sandbox Code Playgroud)

ios react-native react-native-ios

8
推荐指数
1
解决办法
396
查看次数

应用程序关闭时无法更新徽章计数 - 反应本机 iOS

我们正在使用React Native Firebase 版本 6消息传递来处理推送通知。从远程通知内容来看,我们无法在 ios 上增加/减少徽章计数。所以我们使用推送通知 ios来设置徽章计数。

当应用程序位于前台和后台时,它运行得很好。但是当应用程序关闭时,我们能够收到通知,但无法更新徽章计数。

messaging().onMessage(async remoteMessage => {
      Alert.alert('A new FCM message arrived!', JSON.stringify(remoteMessage));
});

messaging().setBackgroundMessageHandler(async remoteMessage => {
      PushNotificationIOS.getApplicationIconBadgeNumber(number => {
        PushNotificationIOS.setApplicationIconBadgeNumber(number + 1);
      });
      asyncstorage.saveItem("remoteMessage", "only one killed message received");
    });
Run Code Online (Sandbox Code Playgroud)

当应用程序处于后台状态时,这里setBackgroundMessageHandler正在工作。根据文档,即使应用程序关闭,此方法也应该调用。但事实并非如此。为了获得更多说明,当应用程序终止时,我在该方法中执行了异步存储操作。但它没有按预期工作。

我还添加了服务器端数据,这些数据是我从后端发送的通知,

{
"to":".................",
"notification":{
 "title":"Working Good",
 "body":"backgroudn noti",
 "badge":"1",
 "sound":"./app/assets/sound/alert.wav"
},
"priority":"high",
"badge":"1",
"content_available":true
}
Run Code Online (Sandbox Code Playgroud)

我想提一下这些键的一些要点,

通知对象内有一个徽章,每次关闭应用程序时都会将其设置为图标。但无法增加/减少徽章计数。它始终是 1。

添加“content_available”属性后,我能够更新徽章计数。这意味着仅添加 content_available 后,我在setBackgroundMessageHandler方法中获得了触发器,并使用推送通知 ios 属性更新了徽章计数。

现在,当应用程序关闭时,我在setBackgroundMessageHandler方法中没有收到任何触发器。

即使应用程序已关闭,我是否需要添加任何其他键才能在setBackgroundMessageHandler方法内获取触发器? …

push-notification badge react-native react-native-ios react-native-firebase

8
推荐指数
1
解决办法
3881
查看次数