expo-secure-store not working in bare React Native App - ios

I have an app, that is made in bare react native. I am trying to use expo's expo-secure-store. But, it's not working. It is giving me the following error:
[Error: The method or property SecureStore.setItemAsync is not available on ios, are you sure you've linked all the native dependencies properly?]
It was working in 1 of my expo apps.
I have react-native-unimodules installed, but, not expo.
Do I require to install expo too? I think that would defeat the whole purpose.
Are there any other alternatives that I can use? Or someone can tell me how to fix this.
Thanks

Related

'PromisesObjC/FBLPromise+All.h' file not found when using react-native-peripheral - is there any way I can fix this?

When trying to build my react-native ios app, I am getting this error as in the picture:
enter image description here
The library for which the error is occurring is called react-native-peripheral, which I understand has not been updated in 3 years. I have tried pod install already, and I have found that the app will build without this error when I use the module in a new project with no other external libraries installed.
I am very new to react-native and app development; however if it is of any help I have a suspicion that this issue may be due to inconsistent Pod version requirements of the PromisesObjC pod.
I am using react-native-firebase for firebase (google cloud) storage, and I notice that this requires PromisesObjC (<3.0, >= 1.2), as below:
enter image description here
If you could offer any guidance that would be great. I know that it is probably not advised to still use react-native-peripheral given that it is no longer maintained, but I can't find any other library which allows me treat my iphone like a bluetooth peripheral (while the screen is turned off).
I am using cocoapods.
Thanks.

Set up React Native project without using react-native-cli

So I'm learning React Native now, and I'm wondering how to set up an app manually, without using react-native-cli. The reason is that I want to set up app code within another project, but whenever I try to move code from a react-native-cli app to another folder containing other project code, I get build errors when running npx react-native run-ios (specifically, xcodebuild errors out with exit code 65). Actually, even if you create a project with react-native-cli and then just change the folder name you get the same build error.
I have template repos I use to start React projects, and I'd like to set one up for native projects, but it looks like it's not possible with the react-native-cli workflow. Is there another way to initialize a React Native project? I know the React docs have a section on integrating RN with existing native apps (https://facebook.github.io/react-native/docs/integration-with-existing-apps), but I don't have an existing native app, I'm starting a new one!
I have scoured the documentation and found nothing on this. Is there any way to find out what commands are run by react-native-cli? How can I set up my RN app from scratch?
EDIT: yes I have heard of Expo! It's all over the RN documentation. I'm asking about how to do the things that react-native init does, but with a more specialized/templated project structure.
As per latest react native documentation, the easiest way to get started is with Expo CLI. Expo is a set of tools built around React Native and, while it has many features, the most relevant feature for us right now is that it can get you writing a React Native app within minutes.
Expo also helps in testing app on phone via QR code.

Error while migrating from react-native-fcm to react-native-firebase

I am migrating my react native app that used react-native-fcm and react-native-firebase-analytics that are now deprecated to use react-native-firebase.
The build runs fine, however when the app start, it stays on the splash screen for almost a minute (which is weird), then crashes with an error:
TypeError: 'undefined' is not an object (evaluating 'RNFIR.requestPermissions()')
There is no such expression in my code, everything is up to date.
My guess is that it might come from inside the react-native-firebase lib but I'm not sure how to fix it. Any ideas?
Make sure you remove all the libraries installed from react-native-fcm in xcode, I migrated from react-native-fcm to react-native-firebase and there were a few left over libraries that I had to manually remove.

react native for ios seems to include a library from a previous project

So I am trying my first few tutorials with react native and therefore am still quite unfamiliar. I had followed this tutorial for using an npm camera in an IOS app. The camera worked find but I had to go an link this library for the camera. I tried it both the manual approach and rnpm. However, now I have a different tutorial on the go which I was messing around with prior to the camera one, and the simulator throws this error.
undefined is not an object (evaluating 'CameraManager.Aspect'), and further down there is also an error about a file which I know was only in my other tutorial(because I wrote it).
So this seems to me like xCode or the node modules for react are somehow still holding this code. I had previously added an entry to the header search paths under the projects build settings, but I looked at it and this path I needed for the camera is not there. So I don't know where this is coming in from.
I ran react-native run-ios on my project, and I tried cleaning the product in xcode and running from there. So far I haven't had very much luck figuring this out.
Ok so this was a simple human error on my behalf. I will post an answer to it anyhow as it might help some react-native beginners. So I had recently made the switch from linux to OSX, and when I started on there linux I had always run the packager for react native manually, and then I found out on OSX I can just run react-native run-ios in the root of the project and it starts another terminal window with the packager running.
The react-native packager was causing the issue. When I ran the react-native run-ios command the following day(didn't turn off my computer) the packager in the other window was forgotten about and I thought it be smart enough to kill that process and restart a new packager for the other project, but it didn't. Hopefully if anyone makes the same assumption you can save some time with this answer.

react-native integrating with existing ios apps

Have followed the instructions from here:
https://facebook.github.io/react-native/docs/embedded-app-ios.html#content
I am able to install required react sub specs and react spec with pod install
I was able to run the local react server to serve the bundles as well.
But I am seeing the following issues which is preventing my app from starting up in the iOS simulator.
/.../node_modules/react-native/React/Executors/RCTContextExecutor.m:560:7: Comparison of function 'JSGlobalContextSetName' not equal to a null pointer is always true
/.../node_modules/react-native/React/Base/RCTRootView.m:230:17: Method override for the designated initializer of the superclass '-initWithFrame:' not found
Can anybody help decyphering whats going on? Seems like it is specific to the RCTRootView implementation inside react library.
i figured the problem was with where i started the react-native app. It was not running from the project root. fixing that fixed the starting of the app in the simulator and these warnings werent the real root cause.

Resources