标签: react-native-ios

React Native地图获取左上角和右下角经纬度

我正在开发一个使用 React-native-maps 的 React Native 应用程序,目前我坚持获取当前区域的左上角(纬度和经度)和右下角(纬度和经度)

<MapView.Animated
        onRegionChange={this.onRegionChange.bind(this)}
        showsUserLocation
        initialRegion={{
          latitude: coords.latitude,
          longitude: coords.longitude,
          latitudeDelta: LATITUDE_DELTA,
          longitudeDelta: LONGITUDE_DELTA,
        }}
        style={{ flex: 1 }}
      >
      <MapView.Marker
          coordinate={{ latitude: coords.latitude, longitude: coords.longitude }}
      >
      <MapView.Callout style={{ position: 'relative', width: 150}}>
        <PlaceCard />
      </MapView.Callout>
    </MapView.Marker>
</MapView.Animated>
Run Code Online (Sandbox Code Playgroud)

知道如何得到它吗?!

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

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

使用未声明的标识符“AIRGoogleMapOverlay”react-native-maps

我已经为 IOS https://github.com/react-community/react-native-maps/blob/master/docs/installation.md完成了与此链接中描述的完全相同的安装

但由于某种原因我收到这些错误:

  1. 使用未声明的标识符“AIRGoogleMapOverlay”
  2. 使用未声明的标识符“覆盖”
  3. 使用未声明的标识符“覆盖”

代码:#import“AIRGoogleMapOverlayManager.h”#import“AIRGoogleMapOverlay.h”

@interface AIRGoogleMapOverlayManager()

@end

@implementation AIRGoogleMapOverlayManager

RCT_EXPORT_MODULE()

(UIView *)view
{
  AIRGoogleMapOverlay *overlay = [AIRGoogleMapOverlay new];
  overlay.bridge = self.bridge;
  return overlay;
}

RCT_REMAP_VIEW_PROPERTY(bounds, boundsRect, NSArray)
RCT_REMAP_VIEW_PROPERTY(image, imageSrc, NSString)

@end
Run Code Online (Sandbox Code Playgroud)

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

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

如何从 Play 商店下载链接获取参数

我目前正在开发一个带有react-native的移动应用程序,该应用程序包含一个邀请码。

商店下载链接会有邀请码参数。

我想通过商店下载链接从下载的应用程序中获取此参数。

我怎样才能在反应本机上做到这一点?

提前致谢

react-native react-native-ios

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

如何创建文件并将其保存到 Files 应用程序(iOS 平台)

我需要创建 PDF 文件(完成)并将其保存到“文件”应用程序,以便用户可以在我的应用程序之外随时访问它。我试着rn-fetch-blobreact-native-fs包和他们工作的罚款为Android,但针对iOS只能创建文件到内部应用程序存储(所以没有在外部存储设备中的iOS应用程序的文件创建的文件,即不是)。我有哪些选项可以将我创建的文件保存到 Files 应用程序?我知道这是可能的,ig Slack 应用程序允许将文件保存到文件应用程序。

ios react-native react-native-ios

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

我的 npm install -g react-native-cli 不起作用

它说需要许可,我无法获得许可。由于这个问题,我无法在我的 Mac 上运行 react-native。

一世?试图获得权限但不能。

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules

npm ERR! path /usr/local/lib/node_modules

npm ERR! code EACCES

npm ERR! errno -13

npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'

npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']

npm ERR!   stack:

npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',

npm ERR!   errno: -13,

npm ERR!   code: 'EACCES',

npm ERR!   syscall: 'access',

npm ERR!   path: '/usr/local/lib/node_modules' }

npm ERR! 

npm ERR! The operation …
Run Code Online (Sandbox Code Playgroud)

node.js npm reactjs react-native react-native-ios

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

如何设置图像在反应导航中采用带标题的全尺寸屏幕?

我的屏幕包含图像,并且我想拍摄带标题的全尺寸屏幕?

我只是使用position: "absolute",但它无法包装标题,而且我无法使用,header: null因为我希望出现后退按钮!

那么我该如何处理这个问题呢?

我得到什么

背景

我想要的是

背景2

提前致谢。

javascript reactjs react-native react-native-ios react-navigation

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

React Native Semantic 问题:重新定义“MethodDescriptor”

该应用程序反应本机应用程序在模拟器上编译一切正常,但是当我尝试从 xcode 在我的 iphone 上运行它时,我收到以下错误:

语义问题:

1 - 'MethodDescriptor' 的重新定义 - 在路径/react-native/ReactCommon/cxxreact/ModuleRegistry.cpp:10 中包含的文件中:

2 - 'NativeModule' 的重新定义 - 1. 在 react-path/native/ReactCommon/cxxreact/ModuleRegistry.cpp:10 包含的文件中:

React-cxxreact/NativeModule.h 上的代码

// Copyright (c) Facebook, Inc. and its affiliates.

// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

#pragma once

#include <string>
#include <vector>

#include <folly/Optional.h>
#include <folly/dynamic.h>

namespace facebook {
namespace react {

struct MethodDescriptor {
  std::string name;
  // type is …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-ios

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

将数组数据从 Swift 传递到 React Native

我正在开发一个react-native插件,但不确定为什么我的收集数据没有通过。

这是我的快速代码:

    @objc(getItems:rejecter:)
    func getItems:rejecter(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void {
        return resolve(itemManager.items)
    }
Run Code Online (Sandbox Code Playgroud)

itemManager.items具有这种结构的数组在哪里[[ name = Meh 1, primary : Yes ], [ name = Meh 2, primary : No ]]

从 JavaScript 调用它我得到一个包含正确数量的项目的数组,但它们null不是我期望的实际 json 对象。

任何人都可以请教如何解决这个问题?谢谢

swift react-native react-native-ios

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

使用多个帐户 React Native Google Signin

我有一个使用谷歌登录的本机应用程序。目前,我可以使用我的手机登录的谷歌帐户之一登录,但我需要为我的谷歌帐户堆栈中的另一个谷歌帐户执行OAuth,这是为了获取 API 访问权限 我需要二级帐户的 serverAuthToken

我用于谷歌登录的库 - https://github.com/react-native-community/google-signin

到目前为止我所做的:

const firebaseGoogleLogin = async () => {
    try {
      await GoogleSignin.hasPlayServices();
      const userInfo = await GoogleSignin.signIn();
      if (userInfo) {
        await storeToken(userInfo);
        // eslint-disable-next-line no-console
        console.log('User info retrieved during login', userInfo);
      }
      // create a new firebase credential with the token
      // eslint-disable-next-line max-len
      const credential = firebase.auth.GoogleAuthProvider.credential(userInfo.idToken, userInfo.accessToken);
      // login with credential
      // eslint-disable-next-line no-unused-vars
      const firebaseUserCredential = await firebase.auth().signInWithCredential(credential);
      console.log('Logged in')
    } catch (error) {
      if (error.code === …
Run Code Online (Sandbox Code Playgroud)

android google-signin react-native-android react-native-ios react-native-firebase

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

由于 GoogleUserMessagingPlatform,使用 react-native 构建排毒失败?

我无法让曾经工作过的 React-Native Detox 构建工作。错误似乎是这样开始的:

PhaseScriptExecution [CP]\ Copy\ XCFrameworks /my-project/ios/build/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/GoogleUserMessagingPlatform.build/Script-75B045B5FA23A64D503F12601136A594.sh (in target 'GoogleUserMessagingPlatform' from project 'Pods')
    cd /my-project/ios/Pods
    /bin/sh -c /my-project/ios/build/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/GoogleUserMessagingPlatform.build/Script-75B045B5FA23A64D503F12601136A594.sh
warning: [CP] Unable to find matching .xcframework slice in '/my-project/ios/Pods/GoogleUserMessagingPlatform/Frameworks/Release/UserMessagingPlatform.xcframework UserMessagingPlatform framework ios-armv7_arm64_arm64e ios-i386_x86_64-simulator' for the current build architectures (arm64 x86_64).
Run Code Online (Sandbox Code Playgroud)

然后最后失败了:

ld: warning: directory not found for option '-F/my-project/ios/build/Build/Products/Release-iphonesimulator/XCFrameworkIntermediates/UserMessagingPlatform'
ld: framework not found UserMessagingPlatform
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

我正在使用最新的大多数东西 - RN 0.63.3、CocoaPods 1.10.0、XCode 12.1。

cocoapods jestjs react-native react-native-ios detox

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