Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all 16566 articles
Browse latest View live

Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_MobilePayManager"

$
0
0

I know there is a lot of similar errors out there, but i tried doing exactly what the answers said, and nothing helped.

I have now even created a completely new DemoProj (React-Native app), linked the repository the error is in, and i STILL get the same error. The repository can be found here: https://github.com/Renetnielsen/DemoProj

If one fetches it and runs xcode, and runs that, you would get the same error. I have no solution to this what so ever, especially since im no Objective C programmer. Please please help me!!

The module react-native-appswitch is a small 2 function module, that just exports some IOS SDK functionality (https://developer.mobilepay.dk/appswitch-integration)

Complete Stacktrace:https://github.com/Renetnielsen/DemoProj/blob/master/README.md

Solutions tried - Create completely new app, refered repo, installed, got error - Ran on device, same error. - Cleaned build folder, pods and so on - still error - Linking binary files and so on

It needs to be fixed using 64 bit architecture, so using 32 is not an option, since ios does not support that any more as far as i know.


expo project, cannot load project to IPhone by scanning QR code, how to fix?

$
0
0

I can load the project by adding the url "exp://192.168.140:19000" on expo client on IPhone. But cannot load it by scanning QR code, which was what I was doing until having this problem.

These happens only when I set the expo XDE host to "local", other all fails.

The expo client display the error.

There was a problem loading the experience.

Show details display the following.

exp://localhost:19000
"Error while loading: Could not connect to the server.."(code -1004)

I want to be able to load the project by scanning QR code. Could anyone help me on this. Thanks in advance!

FCM notifications stops working after a while in react native - ios

$
0
0

I am developing a react-native app using fcm and react-native-fcm library. I am sending the notifications like this:

function sendNotification(notificationType, payload, registrationToken) {
var options = {
    priority: "high",
    ttl: 0,
    content_available: true
};

var messageContent = {
    data: {
        type: notificationType,
        payload: JSON.stringify(payload)
    }
};
admin.messaging().sendToDevice(registrationToken, messageContent, options)
    .then(function (response) {
        console.log("Successfully sent message:", response);
    })
    .catch(function (error) {
        console.log("Error sending message:", error);
    });  }

In android I receive the notifications correctly (both foreground and background).
In IOS, at first I receive them also both in foreground and background, however, after several times I am sending notifications, I stop receive them in background, and all of the notifications arrive only in when app is in foreground.
I have found this answer, talking about throttling in the IOS level, but I can't find any documentation about that. Does it mean that I can't control the background notifications in IOS for my app? And I can only send X messages for a minute? How do chat apps on IOS handle this issue?

React Native: Exception thrown while executing UI block

$
0
0

I'm building an iOS react-native app, and I'm currently using the react-native-swipe-card package to build "tinder" like swipe cards for my app. The app works fine however when I go to swipe a card left or right, and let it go while it's halfway off the screen I'm getting the following error:

ExceptionsManager.js:71 Exception thrown while executing UI block: -[NSNull floatValue]: unrecognized selector sent to instance 0x1075b5130

enter image description here

React native / node issue: The package was successfully found. However, the package specifies a `main` module field that could not be resolved

$
0
0

I am new to node and React Native and I have an issue that I hope someone can help me resolve. I and another person are making a React Native application and currently I am trying to piece together a backend made by the other person with my frontend and I get the following error:

While trying to resolve module http from file /Users/alex/ParkME/node_modules/node-fetch/index.js, the package /Users/alex/ParkME/node_modules/http/package.json was successfully found. However, this package itself specifies a main module field that could not be resolved (/Users/alex/ParkME/node_modules/http/index.js. Indeed, none of these files exist:

  • /Users/alex/ParkME/node_modules/http/index.js(.native||.ios.expo.js|.native.expo.js|.expo.js|.ios.expo.ts|.native.expo.ts|.expo.ts|.ios.expo.tsx|.native.expo.tsx|.expo.tsx|.ios.expo.json|.native.expo.json|.expo.json|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
  • /Users/alex/ParkME/node_modules/http/index.js/index(.native||.ios.expo.js|.native.expo.js|.expo.js|.ios.expo.ts|.native.expo.ts|.expo.ts|.ios.expo.tsx|.native.expo.tsx|.expo.tsx|.ios.expo.json|.native.expo.json|.expo.json|.ios.js|.native.js|.js|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx) Failed building JavaScript bundle.

Does anyone know what the issue might be?

Background service doesn't stop in iOS

$
0
0

I'm using socket.io-client in react-native to start a chat room, when the app enters in background mode the socket keeps working, no problem, but when I disconnect the socket yet the foreground mode still stays active. I have tried a lot of ways but none deactivated the background service.

Follow the code who call the socket:

socket = null;

socketConnection = (url) => {
    socket = io(url, { forceNew: true });

    socket.on('connect', () => {
        console.warn("Connected: ", socket.connected);
    });
    socket.on('disconnect', () => {
        console.warn("Disconnected: ", socket.disconnected);
    });
}

socketDisconnect = () => {
    socket.disconnect();
    socket.off("connect");
    socket.off("disconnect");
}

'expo' is not recognized as an internal or external command

$
0
0

After running npm install -g expo-cli and successfully installing the packages globally, expo is still not recognized as an internal or external command. Does anyone know how I might get around this issue using windows 10, or what to do in terms of something like a path variable.

Xcode Launch Image Source

$
0
0

I have a very silly question, my xcode project doesn't have setting for Launch Image Source , I have already added my splash screen image to Images.xcassets -> LaunchImage , but in my project target General -> App Icon and Launch Images doesn't have setting for Launch Image Source

enter image description hereenter image description here


React Native does not support iOS13.2 debug version

$
0
0

React Native does not support iOS13.2 debug version

if I run debug,I will recive breakDown;if i run release, I could run

all of that are true mobile

Apple rejected the binary (2.3.1 - Performance) React Native 0.61.0-rc.3

$
0
0

My first app with React Native to the Apple App Store has been rejected because they say, "... it contains hidden features, hidden features. Specifically, your app includes support for Hot Update functionality that allows your app to download a new main.jsbundle anytime. It would be appropriate to remove this functionality from your app."

It's a fairly simple app with a search to Firebase Realtime database for jobs.

I've spent hours scouring the net for answers, have about 4 Case numbers with Apple requesting specific information as to exactly where it sees the problem - still waiting.

Has anyone encountered and solved this problem? Detailed message from Apple below.

Guideline 2.3.1 - Performance

We discovered that your app contains hidden features.

Specifically, your app includes support for Hot Update functionality that allows your app to download a new main.jsbundle anytime. It would be appropriate to remove this functionality from your app.

The next submission of this app may require a longer review time, and this app will not be eligible for an expedited review until this issue is resolved.

Next Steps

  • Review the Performance section of the App Store Review Guidelines.
  • Ensure your app is compliant with all sections of the App Store Review Guidelines and the Terms & Conditions of the Apple Developer Program.
  • Once your app is fully compliant, resubmit your app for review.

Submitting apps designed to mislead or harm customers or evade the review process may result in the termination of your Apple Developer Program account. Review the Terms & Conditions of the Apple Developer Program to learn more about our policies regarding termination.

Guideline 2.5.2 - Performance - Software Requirements

Your app, extension, or linked framework appears to contain code designed explicitly with the capability to change your app’s behavior or functionality after App Review approval, which is not in compliance with App Store Review Guideline 2.5.2 and section 3.3.2 of the Apple Developer Program License Agreement.

This code, combined with a remote resource, can facilitate significant changes to your app’s behavior compared to when it was initially reviewed for the App Store. While you may not be using this functionality currently, it has the potential to load private frameworks, private methods, and enable future feature changes. This includes any code which passes arbitrary parameters to dynamic methods such as dlopen(), dlsym(), respondsToSelector:, performSelector:, method_exchangeImplementations(), and running remote scripts in order to change app behavior and/or call SPI, based on the contents of the downloaded script. Even if the remote resource is not intentionally malicious, it could easily be hijacked via a Man In The Middle (MiTM) attack, which can pose a serious security vulnerability to users of your app.

The next submission of this app may require a longer review time, and this app will not be eligible for an expedited review until this issue is resolved.

Next Steps

  • Review the Software Requirements section of the App Store Review Guidelines.
  • Ensure your app is compliant with all sections of the App Store Review Guidelines and the Terms & Conditions of the Apple Developer Program.
  • Once your app is fully compliant, resubmit your app for review.

Submitting apps designed to mislead or harm customers or evade the review process may result in the termination of your Apple Developer Program account. Review the Terms & Conditions of the Apple Developer Program to learn more about our policies regarding termination.

Scroll multiple horizontal scrollview in sync when you scroll one in React Native

$
0
0

Below is a sample of what needs to be achieved in React Native:

Title1

Some description that spans horizontally using a ScrollView (horizontal prop)...............................

Title2

Some description that spans horizontally using a ScrollView (horizontal prop)...............................

Title3

Some description that spans horizontally using a ScrollView (horizontal prop)...............................

The code for the same is:

FlatList --> View --> Title + ScrollView (description)

Now, the expectation is when I scroll the description of one row, all the descriptions from the other row should scroll in sync.

Below is the structure:

<View>
    <TouchableOpacity>
      <View style={styles.titleContainer}>
        <Text style={styles.title}>{name}</Text>
      </View>
    </TouchableOpacity>

    <ScrollView
      onMomentumScrollEnd={e => this.onScroll(e, index)}
      ref={node => { this.scrollRef[index] = node; }}
      scrollEventThrottle={16}
      showsHorizontalScrollIndicator={false}
      horizontal
      style={styles.fundContainer}
    >
      <View style={styles.statsContainer}>
        <Text>Some Description</Text>
      </View>
    </ScrollView>
  </View>

And the method that I run on scroll:

  onScroll = (event: Object, index: number) => {
    this.scrollRef.forEach((scrollItem, scrollIndex) => {
      if (scrollIndex !== index) {
        scrollItem.scrollTo({
          x: event.nativeEvent.contentOffset.x,
          y: event.nativeEvent.contentOffset.y,
          animated: true,
        });
      }
    });
  };

I am using onMomentumScrollEnd which scrolls the item on scroll end. If I use onScroll, it creates a performance bottleneck and lags miserably.

Are there any workaround to scroll the list in sync?

react-native-orientation in IOS

$
0
0

I have a project in React Native, and I need lock a orientation a specific view in landscape orientation. But, the code don't work and the screen loop tilting. I find one answer for the problem very similar with mine. But, the solution propose don"t work. I already search very hard for one solution.

Sorry for bad english. Someone can help?

this is a result of my code

This is my code

import Orientation from 'react-native-orientation-locker';

const App: () => React$Node = () => {
  function _onOrientationDidChange(orientation) {
    if (orientation == 'PORTRAIT') {
      Orientation.lockToLandscapeLeft();
    }
    console.log(orientation);
  }

  React.useEffect(a => {
    Orientation.lockToLandscapeLeft();
    Orientation.addOrientationListener(_onOrientationDidChange);
  }, []);
  return (
    <>
      <StatusBar barStyle="dark-content" />
      <SafeAreaView>
        ...
      </SafeAreaView>
    </>
  );
};

Having issue in React Native app running on IOS device

$
0
0

I am running my react native app on IOS but it is not working it is showing an error:

Code signing is required for product type 'Application' in SDK 'iOS 13.0'

No profiles for 'org.reactjs.native.example.app' were found:  Xcode couldn't find any iOS App Development provisioning profiles matching 'org.reactjs.native.example.app'.

Failed to register bundle identifier. The app identifier "org.reactjs.native.example.app" cannot be registered to your development team. Change your bundle identifier to a unique string to try again.

React native scroll view twitching on iOS when using SafeAreaView

$
0
0

This is bizarre and I can't find anything about it.

I have a very simple project (just getting started with react native), and when I put a list of items in a scroll view, I'm getting a constant "twitching". Here is a video of the behavior: https://imgur.com/a/MYerrFl

It happens on both the iOS simulator as well as my phone.

Here is the very simple code:

const App = () => {
    return (
        <ScrollView style={{
            backgroundColor: '#fcfcfc'
        }}>
            <SafeAreaView>
                {['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p'].map((letter) => {
                    return <Text style={{
                        backgroundColor: 'red',
                        padding: 20,
                        margin: 3
                    }} key={letter}>{letter}</Text>
                })}
            </SafeAreaView>
        </ScrollView>
    );
};

When I remove the SafeAreaView, it doesn't twitch at all...

/main.jsbundle does not exist. This must be a bug with "react-native": "0.59.8",


React Native iOS pod setup has duplicate target issue

$
0
0

I'm building an app with React Native and I have to add pod dependencies to my project. I followed a tutorial on how to init a pod with a brand new react-native init project. This is the content of my Podfile:

target 'MyProject' do

  target 'MyProject-tvOSTests' do
    inherit! :search_paths
  end

  target 'MyProjectTests' do
    inherit! :search_paths
  end

end

target 'MyProject-tvOS' do

  target 'MyProject-tvOSTests' do
    inherit! :search_paths
  end

end

Then I run pod install, and I get this error:

The target MyProject-tvOSTests is declared twice.

I think it's an issue with the react-native init but I don't know how to correct it.

Thanks in advance!

Personal Team is not enrolled in the Apple Developer Program

$
0
0

I am trying to upload the app to app store but getting this error on validating the app or distribution.

Team "Username (Personal Team)" is not enrolled in the Apple Developer Program. Distribution requires enrollment in the Apple Developer Program. Visit https://developer.apple.com/account to enroll.

I am new iOS development and app built with the react native framework and publishing the app using XCode 11.2.1. I am using a team member account as an app manager.

I find this Apple Developer link for the known issue but I don't understand the solution they are providing. Can any body explain it.

Show keyboard programmatically using React native

$
0
0

How do I show Keyboard for TextInput programmatically using react native? Using a ScrollView, tapping between TextInput causes the keyboard to be dismissed. I want to show the Keyboard again using onFocus method of TextInput. Anyway to accomplish this?

React Native Config.h not found

$
0
0

I'm beginner of React native developer.

After create new project then open it.

xcode is display error config.h file not found in mutex.h file. I'm also search in google and try possible solution but still display same error.

I'm done Following Commands

1

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2

brew install watchman

3

npm install -g react-native-cli

4

react-native init projectName

5

cd projectName
react-native start

6

react-native run-ios

Error in CMD
./Desktop/Demo React Native/projectName/node_modules/react-native/React/../third-party/glog-0.3.4/src/base/mutex.h:105:10: fatal error: 'config.h' file not found

include "config.h" // to figure out pthreads support

1 error generated.

Software Version List
Homebrew 1.6.8
react-native-cli: 2.0.1
react-native: 0.55
watchman 4.9.0
npm 6.1.0

I'm also try this soluation but still error

In the Terminal, navigate to the third-party/glog and config glog file

cd node_modules/react-native/third-party/glog-0.3.4
./../scripts/ios-configure-glog.sh

React Native ios build error 'React/RCTBridgeModule.h' file not found

$
0
0

I am unable to build react native ios build for real devices and simiulator. Facing following issue:

"'React/RCTBridgeModule.h ' file not found".

Any solutions?

Viewing all 16566 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>