The Perspective mobile app is communicating with WiFi router to Ignition gateway through Server "IPaddress:[Port]". However when I switch the internet connection of app from WiFi Router( Same network of server) to mobile internet , the perspective app stops communication with gateway(Server). Is mobile app will works within the same WiFi router network of server only ? is there any way forward to communicate mobile app with server from external network ?
Be careful with terminology. localhost has a specific meaning and will use IP address 127.0.0.1. I think you mean something else. (You can edit your question to clarify.) Also, in your question title you have said "Server". Do you mean "gateway"?
Connecting to your router's WiFi puts you on the LAN (local area network). That allows routing to the Ignition gateway as the mobile and gateway are on the same network.
Connecting to mobile Internet means that you are now connected to the Internet side of whatever router connects your network to the Internet. Standard firewall policy is to block access from outside.
You could expose your server to the Internet by setting up a firewall rule but it sounds like you would struggle to do this securely. Failure to do it properly could lead to a security breach and your future with the company could be rather short.
Search the forum for Internet access and VPN.
can port forwarding with server IP , work to communicate with mobile app ? or having static IP of Server will help to communicate mobile app with server ?
Both of those could be part of a solution to allow Internet access to your Ignition gateway but, again, it sounds like you don't know enough to do this securely.
Is this a home project or for a customer or your employer?
I am just trying to establish the communication between Ignition app and Server from external network. This is just a sample project. For industrial project, I have established the secured communication with DCS system across the countries, with VPN (Via DMZ above L3), so establishing the secured network connection won't be a problem. I am just looking from the Ignition app's requirement point of view.
Does the mobile device have VPN access to the site?