Expo Mobile application for testing expo app not connecting to my server - node.js

I am building a React Native application with Expo CLI and I have the Android studio installed to test the app live.
I was able to use Expo Android app to also see the look of the app on my Android phone. Unfortunately, I use WIFI that generate random IP.
My IP changed two days ago and I had to update the BASE URL of to connect to my server instead of using localhost.
Since I did that, I was able to make API requests on my laptop but I can't seem to make API requests on my Android phone that is running the Expo android app.
I have cleared the cache and even cleared the data of my Expo Android app, but I still can't reach my server.
Only the client content starts. All API requests are not reaching the server on my Android phone but reaches the server from my laptop.
How can I fix this?
My local url looks like this:
const BASE_URL = "http://myIP:5000/api/v1";

Related

node.js and expo are installed but expo is not working. I can't connect from my device

I could see the snaks I made with expo.dev on my mobile device. I was starting the project with visual studio code for the first time, but when I scanned the QR code on my mobile device, "there was a problem loading the requested app. the request timed out. it looks like you may be using a LAN URL. make sure your device is on the same network as the server, and that you have granted Expo Go the Local Network permission in the setting app, or try using the tunnel connection type." warning is coming. Localhost does not appear under the QR code. node.js and expo are installed but expo is not working.

How to create a browser instance (pupeeteer) with firebase and use it in my app (node.js)?

I created a firebase project. This communicates with a mobile application (node.js). As part of this project I want to use pupeeteer.
I have no problem launching functions using pupeeteer in firebase.
The problem is that I want to make the user perform actions. So I have to display the web page (pupeeteer) in the application via a browser generated by the server (with a firebase function?)?
However I have no idea how to launch a browser instance in the background and close it at the end of processing?
Can you help me ? Is this the right solution?
I want to use this :
This library does 2 things:
Download the chromium binaries and launch a Chromium process.
Connect to this process with Websocket and send json commands to control the browser.
Due to limitations on mobile platforms (iOS and Android), it is not possible to launch an external Chromium process on iOS and Android. So, step 1) does not work on mobile.
You can still use puppeteer-dart on Flutter either with:
Flutter on Desktop (macOS, windows, Linux)
Flutter on mobile BUT with the actual Chrome instance running on a server and accessed from the mobile app using puppeteer.connect
The pub.dev website reports that this library works with Android and iOS. The supported platform list is detected automatically and can't be manually modified to express the current limitations

react native windows app not connecting to localhost

I have been working on react-native for windows app the thing is I created a localhost in node.js using express and made api calls from the windows app both the server and app were working fine on my device even after when i created appx bundle file and installed it on my computer then i shared the appx bundle file and my localserver file with my friend and it was causing problem there. Localhost was working fine i could make requests via postman but was not able to do so via the app it gives
Error : Network Error
. I am looking for some help if anyone have any idea about what could be going on.
Note that everything works fine on my development device

Does Ionic and React Native apps run on node server in Android and iOS devices?

I am confused how hybrid apps work on Android and iOS devices. Do they install local node or webpack server? And for each hybrid app there is its own server? So how actually these apps work?
I am new in Ionic app development. I just built a simple ionic app and install its apk on my Android phone but i am getting this:
Webpage not available
The webpageat http://localhost:8100/ could not be loaded because:
net::ERR_CONNECTION_REFUSED
And a popup with following content:
Application Error
net::ERR_CONNECTION_REFUSED (http://localhost:8100/)
Thanks
Ionic and React Native are two very different things.
Ionic generates a hybrid app. This is a native app but the native app is just a shell with a mini-webserver and a webview control. Your app is served by the mini-webserver and runs in the webview control. Basically it is still a webapp and not a true native app. See this article for more details.
The above is true for all variants of Ionic: Angular, React and Vue.
React Native generates a true native app. There is no webserver or webview control involved.
This article describes the differences in more detail.

Connecting to and syncing with localhost from android device not working

I am using the Azure Mobile App quickstart ToDoList example to get started with cross platform app. I have set up the back-end and it is working on localhost - I can hit it using Swagger and gets posts etc are working.
I then set up the client application (Xamarin.Forms). I am running the client application on my Android device and all works great when back-end is in Azure, including the offline sync element. The problem is that I have to work locally for now but I cannot sync with the db when running on localhost.
At first the debugger was giving me a "connection refused" error, so I followed the steps here and in various other sources including using my laptop IP and setting firewall rule, adding binding to port in IIS Manager and applicationhost.config, and changing ApplicationURL in Constants.cs.
Now, I get no connection refused error, but the data is not getting to the db, athough the localdb on the tablet seems to be working - it is failing when I try to sync to/from db.
Not too familiar with networking but it may be important to note that when I use localhost:portnum/tables/todoitem in browser I get results in XML but when I use 192.168.0.10:portnum/tables/todoitem I get "Bad Request - Invalid Hostname".
By default, your Mobile App .NET server backend application will run in IIS Express. This is problematic when debugging with a client application running in another device on your network, or in a virtual machine in Hyper-V (such as Windows Phone Emulator). IIS Express will host your server application under localhost, which makes the application unreachable to other devices or virtual machines. Your client application running on Windows Phone Emulator has a different meaning for localhost. The same is true for the Visual Studio Emulator (which runs in Hyper-V) and the Google Emulator.
It is simpler to configure your machine to host your Mobile App .NET server backend application on IIS, as this allows you to control the binding of the server application to an IP address, rather than localhost.
For information on this, see: https://github.com/Azure/azure-mobile-apps-net-server/wiki/Local-development-and-debugging-the-Mobile-App-.NET-server-backend

Resources