I recently added the dev-client in my Expo (Bare Workflow) React Native App. The deep linking configuration was working fine earlier with my scheme as:
scheme://mobile-prefix/product/10
In the local environment, I tried using the local development Deep-link as follows:
scheme://expo-development-client/?url=http://192.168.5.80:8081
This opened the app ^. This was according to the documentation: https://docs.expo.dev/development/development-workflows/#deep-linking-urls
But it still isn't clear how do I open the deep link say to a particular product which was earlier: mobile-prefix/product/10.
The way to make it work was:
Create development build.
Then use the local scheme URI, like below. See screenshot for reference
scheme://192.168.5.80:8081/mobile-prefix/product/10
So the above URI works ^
where mobile-prefix/product/10 is the one configured on React Native App itself.
I was using your above answer with React Navigation which didn't work.
You might not need the IP address. Just your-scheme-here://mobile-prefix/product/10 will work.
Related
I am using #react-native-firebase/dynamic-links package
When clicking on the link which i created, it works fine for android but for ios it doesn't Redirect to my app and it gives me this screen in the browser
This is an intermediate page and can be eliminated by configuring your dynamic links apple behavior like this.
I am implementing API to connect app with server. I have to use deviceId there. As mentioned in here we can use third party library 'react-native-device-info'. But when I am using it I am getting errors as attached screenshots. As per error it's saying to do linking but as I am using react version 0.62, so autolinking is there. So What can be issue? It took too much time to search it but till now I didn't get a proper solution.
react-native-device-info library wont work in Expo , since it requires linking of native modules hence the error.It will only work in pure react native apps.
You can check this by expo itself : expo-device
hopeit helps.feel free for doubts
You can use react-native-device-info even in Expo projects. You need to replace Expo Go with a custom build that has react-native-device-info library baked in.
By default, Expo Go used on Android, iPhone Emulators implies managed workflow (aka only expo-* modules are being used). However, using any pure react-native-* libraries falls under bare workflow, so you cannot use Expo Go - the error you see is from Expo Go, not your app.
Build your custom Expo app with expo-dev-client, react-native-device-info libraries included, and install that on your emulators. This needs to be done once when you add a react-native-* library.
Now continue to add code to your project that uses features from react-native-device-info.
npx expo start --dev-client and choose your emulator. Your custom build will be launched and you can make live changes as always like in Expo Go.
Do check out the section on Development Builds from Expo. Needless to say, I have successfully used react-native-device-info on my Expo project, because expo-device cannot provide what I needed.
I created a mobile app by expo (react native), I would like to display profile image, knowing that the images are located outside my project.
when I want to access any image I do not get there, and I get this type of error
"SHA-1 for file (D:\Workspace\ImagesProfile\images3.jpg) is not computed".
this is the hierarchy of my workspace.
-Workspace
--ImagesProfile
--Myproject
Pleace how can we solve this problem?
The way the react-native packager works right now, it's just going to scan the roots of your project and below when creating the JavaScript bundle, so it will be really hard to do this.
You basically just need to put the files under the root of your directory. There are some tools out there for syncing files from another directory into a directory under the root so you could use one of those if you really need to.
Some people are working on ways to make symlinks work with this. Notably, you might look at Haul from Callstack. https://github.com/callstack-io/haul But that isn't integrated into Expo yet.
Okay at first you should understand what you are doing. You're creating a react native application, which means this application is running on external devices and not on your PC. Your simulator or expo client running your application encapsulated from your PC using only project files. When you wanna use external images in your application you need to host them. You can create a local docker instance as image server ( e.g. an express application with a static folder ).
To make it clear, it's not possible to use images inside your filesystem which are not a part of your react native application. You can use external image server like "imgbb" for test purposes, but it's not recommended to use them in your final version.
Happy Coding!
When I set up like this
https://facebook.github.io/react-native/docs/linking#basic-usage
and open the app via Custom URL Scheme,
_handleOpenURL catches the URL if the app is shutdown, but doesn't if the app is running background.(iOS)
So can't I use the Linking.addEventListener when the app is already running?
I was having this issue working on a detached Expo project because I had added the suggested code from https://facebook.github.io/react-native/docs/linking.html to the *AppDelegate.m but Expo already provides slightly different functions for handling URL events. Removing the code from the React Native docs made it work for me.
I trying to run the react-native run-android through my React Project. After that,
I got this error
If you are installed sdk correctly, you can create an empty file in your android project named "local.properties" (if it does not exist) and define sdk address in it like this:
sdk.dir=/home/USERNAME/Android/Sdk
This address may changes based on your settings, it's the default address in linux.
I hope it helps you
I assume that you are using windows.
Add an environment variable ANDROID_HOME that points to
C:\Users\<your-user-name>\AppData\Local\Android\Sdk
You must follow the steps described in the URL:
https://facebook.github.io/react-native/docs/getting-started.html
go to Building Project with native Code and follow the steps and you must have a virtual or real device for testing. To check if any device is connected or not just go to your terminal and type adb devices and if there is any device it will show.