标签: react-native-ios

React Native Ios:本机模块不能为空

在 IOS 中发现错误

本机模块不能为空

我不使用react-native-push-notification

在此输入图像描述

在此输入图像描述

react-native react-native-ios

5
推荐指数
1
解决办法
8943
查看次数

react-native-fbsdk“使用 facebook 应用程序登录”不触发回调

我正在我的 React-Native 应用程序中使用react-native-fbsdk. 我不明白为什么“使用 facebook 应用程序登录”不起作用。当用户单击此按钮而不是在 Web 视图中输入其凭据时,LoginManager回调似乎永远不会被触发。

以下是发生的情况的视频:https://i.imgur.com/1XeJC1o.mp4

这个问题似乎可能是常见问题解答中的这个问题,但我相信我的AppDelegate.m文件Info.plist设置正确。

#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <SentryReactNative/RNSentry.h>
#import <GoogleMaps/GoogleMaps.h>
#import <react-native-branch/RNBranch.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <RNGoogleSignin/RNGoogleSignin.h>
#import <CodePush/CodePush.h>
#import <AppCenterReactNativeCrashes/AppCenterReactNativeCrashes.h>
#import <AppCenterReactNativeAnalytics/AppCenterReactNativeAnalytics.h>
#import <AppCenterReactNative/AppCenterReactNative.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [RNBranch initSessionWithLaunchOptions:launchOptions isReferrable:YES];

  NSURL *jsCodeLocation;

  [AppCenterReactNativeCrashes registerWithAutomaticProcessing];  // Initialize AppCenter crashes

  [AppCenterReactNativeAnalytics registerWithInitiallyEnabled:true];  // Initialize AppCenter analytics

  [AppCenterReactNative register];  // Initialize AppCenter 

  [GMSServices provideAPIKey:@"myAPiKey"];

  [[FBSDKApplicationDelegate sharedInstance] application:application …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-fbsdk react-native-ios

5
推荐指数
1
解决办法
1456
查看次数

使用 React Native 通过 Whatsapp 共享图像和文本

我正在开发一个 React Native 应用程序,我的需求之一是能够通过 Whatsapp 共享 png 图像(从 svg 创建)以及消息中的一些文本。我已经使用react-native-share在Android上实现了这一点,但是当我在iOS上尝试时,消息中填充了提供的文本,但图像被忽略。我也尝试过分享,但结果是一样的。

我尝试过直接共享 base64 图像(data:image/png;base64, image_data以及保存创建的图像并将路径添加为 url,但结果始终相同。

在 iOS 上(同时使用 React-native-share 和 Share)实现此功能的唯一方法是省略该消息,但需求中需要文本。

有办法实现这一点吗?

版本:

  • 反应本机 - 0.55.0
  • 反应本机共享 - 1.1.2

顺便说一句,Twitter、电子邮件、短信和其他一些应用程序上的共享过程运行正常。

代码示例:

const base64Data = this.state.uri
const dir = `${RNFS.DocumentDirectoryPath}/tmp_${moment().valueOf()}.png`

RNFS.writeFile(dir, base64Data, 'base64').then(async () => {
  const options = {
    url: Platform.OS === 'android' ? `file://${dir}` : dir,
    message: '' // By omitting the message, whatsapp shows the image
  }
  try { …
Run Code Online (Sandbox Code Playgroud)

javascript share whatsapp react-native react-native-ios

5
推荐指数
0
解决办法
2995
查看次数

React Native iOS 构建问题在提供的路径中找不到应用程序包

我对原生反应很陌生。我创建了一个 Hello World 项目,但无法在 iOS 上运行。每次我运行 iOS 项目时都会抛出以下错误

** 构建失败 **

以下构建命令失败:CompileC /Users/usman/FunZoneAppsProjects/{ProjectName}/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTShadowView+Internal.o Views /RCTShadowView+Internal.m 正常 x86_64 Objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 次失败)

安装 build/Build/Products/Debug-iphonesimulator/{ProjectName}.app 处理命令时遇到错误(domain=NSPOSIXErrorDomain,code=2):无法安装请求的应用程序 在提供的路径中找不到应用程序包。提供所需应用程序包的有效路径。打印:条目,“:CFBundleIdentifier”,不存在

命令失败: /usr/libexec/PlistBuddy -c 打印:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/{ProjectName}.app/Info.plist 打印:条目,“:CFBundleIdentifier”,不存在

错误:命令失败:/usr/libexec/PlistBuddy -c 打印:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/{ProjectName}.app/Info.plist 打印:条目,“:CFBundleIdentifier”,不存在

at checkExecSyncError (child_process.js:621:11)
at Object.execFileSync (child_process.js:639:13)
at Promise.then (/Users/usman/FunZoneAppsProjects/{ProjectName}/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5)
Run Code Online (Sandbox Code Playgroud)

我读过很多人用不同的修复方法解决了这个问题,但没有一个对我有用。可能是什么问题?TIA

ios react-native react-native-ios

5
推荐指数
1
解决办法
8862
查看次数

react-native clang:错误:链接器命令失败,退出代码为 1

我正在尝试在 Xcode 中构建我的反应本机项目以在 App Store 中发布,但构建失败并出现错误

clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

我不知道如何继续。我的项目中有facebook sdk和react-native-firebase。你能帮我看看可能出了什么问题吗?谢谢。

xcode react-native react-native-ios

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

React-Native-Scrollview 的滚动在到达 StickyHeaderIndices 时被禁用

我正在尝试使我的标签栏具有粘性,我正在使用native base标签栏,而他们正在使用"react-native-scrollable-tab-view". 我用scrollView包裹我的根视图并设置“stickyHeaderIndices={[1]}”,这对于使我的选项卡栏粘在顶部很有用,但是当这些选项卡栏粘在顶部时,滚动在粘到顶部之前停止工作它工作正常,但是当这些选项卡粘在顶部滚动条上时,它会停止工作,有什么建议吗?

我尝试添加另一个滚动视图,这样我的滚动就可以工作,但没有运气,我在选项卡内有 FlatList 组件,但在 StickyHeaderIndices 滚动工作之前,FlatList 的滚动在 StickyHeaderIndices 之后也不起作用。

 <ScrollView
      stickyHeaderIndices={[1]}
      ref={ref => this.scrollView = ref}
      onContentSizeChange={(contentWidth, contentHeight) => {
        _scrollToBottomY = contentHeight
      }}
      contentContainerStyle={{flexGrow: 1, flex: 1}}>
 >  <AnotherComponent/>
    <MyTabsComponent />
</ScrollView>
Run Code Online (Sandbox Code Playgroud)

滚动应该在 StickyHeaderIndices 之后起作用。

react-native react-native-scrollview react-native-ios react-native-flatlist

5
推荐指数
0
解决办法
1362
查看次数

是否可以在 React Native 库中加载 .XIB 或 Storyboard?

我已经为 React Native 创建了一个模块,它有五个视图控制器。所以我为每个视图控制器获取 XIB。但 XIB 不会加载到库中。

RCT_EXPORT_METHOD(showFirstVC){

    UIViewController *root = RCTPresentedViewController();

   FVCViewController *ViewController = (FVCViewController *)[[UIViewController alloc] initWithNibName:@"FVCViewController" bundle:nil];

   UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:ViewController];
   navController.navigationBarHidden = YES;

    [root presentViewController:ViewController animated:YES completion:nil];
}
Run Code Online (Sandbox Code Playgroud)

你能帮我看看是否可以在 React Native 库中加载 XIB 或 Storyboard。

react-native react-native-ios

5
推荐指数
1
解决办法
266
查看次数

如何在xcworkspace项目中使用“increment_build_number”?

我正在尝试在我的 React Native 项目中使用 fastlane 自动化构建过程。我正在关注这篇文章。在increment_build_number实际操作中,我找不到任何选项来指定 .xcworkspace 项目。我尝试使用workspace标签,但没有成功。

react-native fastlane react-native-ios

5
推荐指数
1
解决办法
1786
查看次数

找不到模块

我正在尝试运行react-native start并出现以下错误

"Cannot find module 'metro-core'.  Run CLI with --verbose flag for more details. 
Run Code Online (Sandbox Code Playgroud)

在收到此消息之前,我收到了一条不同的错误消息,指出未找到模块,因此我尝试了以下操作:

删除node_modules文件夹 -

rm -rf node_modules && npm install
Reset packager cache - rm -fr $TMPDIR/react-* or node_modules/react-native/packager/packager.sh --reset-cache
Clear watchman watches - watchman watch-del-all
Run Code Online (Sandbox Code Playgroud)

我刚刚输入了react-native start,模拟器上就弹出了错误消息,这告诉我在终端上查看错误消息。

react-native react-native-ios

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

react-naitve 组件 'RNCamera' 重新注册冒泡事件 'topPictureTaken' 作为直接事件 moduleConstantsForComponent

反应原生 RNCamera 问题

有人对这个问题有任何想法吗?

我在用 "react": "^16.12.0", "react-native": "^0.61.5", "react-native-camera": "^3.13.1",

Mac 操作系统 - 版本 10.15.1

Nodejs - 版本 v10.16.0

javascript reactjs react-native react-native-ios

5
推荐指数
1
解决办法
864
查看次数