Sockets: how does sockets work on mobile app? - sockets

I've never worked on mobile app project.
In web app we can create a server with origin http://localhost:3000 and the client can connect to server with http://localhost:4000/sockets for example.
On mobile app how does it work ? Each app on mobile phone are not located on specific http url...

Related

Flutter mobile app works during testing and fails from the Google Play Store

Original problem: My flutter app using the http package connects to a rest service to get the data needed. If I am connected via my modems wifi, the connection would fail (but not timeout) on the login attempt. The circular spinner would spin forever (tried for 15 minutes). If I connect using my router's wifi, or my mobile data, the connection is fine. The app logs in and runs correctly.
I created a web app to test and after trying a few things, I found port 443 was the problem. I changed the port on my rest service and the app and now 2 emulators and 2 physical devices all work perfectly during testing.
Then yesterday I published the app update to the Play Store and the App Store. I'm still waiting on the app store to approve, but testing from TestFlight worked perfectly on my iPhone.
Google approved the app quite quickly, but when I install the update from the Play Store, no connection at all works now. I have tried uninstalling and rebooting the phone (Galaxy S22+ running Android 13 and a Galaxy S8 running Android 9) but regardless of whether I connect using mobile data or either wifi, the login sits trying forever. The app does not crash, it just won't login and although there is a timeout on the login connection, it doesn't timeout.
What could be the difference between the test version which works great, and the version I build for uploading to the Play Store?

can't reach rest api hosted on remote server from safari browser of iphone simulator

my xamarin.forms app needs to get data from sql server and for this i used a rest api. i hosted the webservice on a remote server and tested the app on my android phone. it worked well. when i tried to test the app on iphone simulator using mac in cloud to pair my vs to a mac, my app couldn't connect to the webservice. my HttpResponseMessage.IsSuccessStatusCode returned false. i tried to reach my service by copying its url in safari in my iphone simulator but i got: your search didn't match any documents. any suggestions?

How to build http server in flutter mobile app as a background service?

Is it possible to build a http server in flutter mobile app but like Android service, a background process to work constantly?
I found a solution to add a http server to flutter app 1 but it is not as a background process.

not register ionic application on mobilefirst to use

In mobile first tutorial,
one step is mfpdev app register
Question is what is the use of the registration
as I develop an ionic project and can connect to mobile first without registration when Cordova web resources Previewed with the Mobile Browser Simulator using MobileFirst command mfpdev app preview
mobile first 8
ionic 3
mfpdev app register command will register your application with MobileFirst Server. Without registering your application with the server, the application on the mobile device will fail to connect to server with an error 'application does not exist'.
If you do not want to use mfpdev app register command, you can register your application manually at MFP Operations console.
For more details , refer : Registering an application
Update : If you are using command mfpdev app preview to preview your web resources with the Mobile Browser Simulator, Security checks are not run on the server-side and security challenges are not sent to the client that runs in Mobile Browser Simulator.
MobileFirst Development Server includes a confidential client "test" that has an unlimited allowed scope ("*"). By default mfpdev app preview uses this confidential client.
NOTE : command mfpdev app preview is meant for preview the UI , OAuth protocol is not fully supported
For more details, refer :Previewing Cordova web resources with the Mobile Browser Simulator
Thanks for #manjunath kallannavar for all the supports
Unrestricted right (without login) to both protected and unprotected resources lead me to confidential client.
As pre https://youtu.be/DlxZYxXszIw?t=15m40s, the author mentions user is as confidential client when using mfpdev app preview.
However, this is not documented in IBM reference. (Please quote if you find one)
Also, by using ionic cordova run android in emulator, finally challenge received.
Conclusion, with mfpdev app preview, user right = confidential client => can access all resources
Credit to #manjunath kallannavar
Official explanation:
MobileFirst Development Server includes a confidential client "test" that has an unlimited allowed scope ("*"). By default mfpdev app preview uses this confidential client.

How to use Shadowsocks in my app and proxy the webview of app, and not global proxy

I have some websites need to proxy in my webview of my app,
I need the Shadowsocks code which can run, and proxy my web in iOS app.
And not global proxy, just proxy the web in my app, Thanks!