Developers Checklist for VPN Connect On Demand - Techies India Inc

Developers Checklist for VPN Connect On Demand

Posted: December 11, 2019

Content MarketingKnowledgeMarketing


Developers Checklist for VPN Connect On Demand

What are VPN apps?


VPN stands for Virtual Private Network. It is a network technology that connects people to the internet through VPN provider server. VPN apps are crucial these days, as these allow you to create a safe, secure and encrypted connection over less secure network such as internet. There can be situations  when user needs a region restricted access or when the thought of being monitored on public wifi haunts them. In these scenarios providing your users with VPN app is the right approach. It not only provides them online anonymity, but also hides their IP addresses etc. that too at very low cost. 

The following statistics show a tremendous increase of 165% in VPN user growth from 2017 to 2018. Even the predictions on global VPN market growth are quite promising.

vpn statistics

Sources: Statista, GoGlobe

Why VPN apps?


Because you want your audience to stay protected from threats, stress of being hacked, identity theft, information leak of their financials, etc. So, if you are making an effort to provide your customers with 24*7 security on their mobile devices, then there are a few things you have to consider while developing it. 

User security is of utmost significance in every technological stream today. With VPN apps, you can protect your audience from threats, stress of being hacked, identity theft, or financial information leak, etc.

So, if you are making an effort to provide your users with 24*7 security on their mobile devices, then here are a few things you should consider while developing it. 

What can be the initial scenarios?

– Users can be either on Wifi or LTE.

– There are 3 different states of an app i.e. running, background & close state. Users can’t keep the app in running state, so your VPN Service should work in all states.

– User can switch on & off network anytime. If user has to enable VPN services everytime from the app or some settings, it would be a hassle for the user.

Here, the question is how you are going to provide users with a 24*7 VPN service? And for sure, you want to make it easy for them to keep VPN running all the time. Answer is to make your app providing VPN On Demand services.

What is VPN On Demand and how it works?

It is actually a rule that implies on VPN service which allows the system to automatically connect or disconnect VPN based on some specific criteria. 

Possible criterion can be as follows:-

  1. Connect VPN when Wifi is available.
  2. Connect VPN when Mobile data is available.
  3. Connect VPN when any type of network is available.
  4. Connect to a particular website only (Mostly required by Corporates).

How you have to test the VPN app for above implication?

1. Check if VPN is actually working on the device
(if it is enabled & configured from your app)

Steps to do this
– On iPhone, Go to Settings – You will see VPN on the top section of settings, you will observe a row having parameter “VPN” & its status i.e. connected or not connected.
On Android, Go to settings -> More -> See VPN connection status.

– Tap on your App’s VPN info – it will display “Type of VPN”, “Server Address”, “Address”, “Connect Time” & most importantly “Connect on Demand” status as it signifies that VPN On Demand service is enabled. (This is visible on iOS device only, however, on Android, you can only see the status of VPN service.)

– Go to browser, check if you are able to browse the domains as per your setup in VPN Server settings (e.g. any blocked or enabled sites)

– To cross verify server address you have attained on your device after connecting VPN, you can check the same on browser.

2. Check if VPN stays connected in all of the 3 states i.e. background, closed, or restart state.

Once you are done with the above test cases, the app is good to be distributed among your team and testers but not to the public because these are just the initial considerations.

What can be other challenges?

VPN On Demand setup is not all about setting it up on mobile end, but also supportive settings should be enabled on the VPN server. You may face challenges in some other scenarios as well. Some of them are as follows which may help you to test and improve the experience of your app:-

1. VPN speed

It might happen that you observe different speeds before and after VPN connection. For instance, before connecting VPN the speed of the network connection might be faster than what you observe after connecting VPN or vice-versa.
The reason for this is – the location of your VPN server, your network strength and whether encryption has been enabled on server side or not.

What you can do about this? You can set up different servers according to the reach of your customers. Not only this will help you in providing good speed to your users by staying nearby but also by putting less load on a single server. Along with this, you can choose encryption mode accordingly.

2. Losing VPN connection

Yes, you may lose a VPN connection when
– switching network from wifi to cellular or vice-versa.
– waking up your device from sleep mode.
– turning on airplane mode.
– randomly after some time.

There can be two reasons behind losing VPN connection. One of the reasons is fluctuation in your cell signal. As this service relies on a single network connection and single socket, any interruption may cause disconnection. Network strength, may be something that you cannot do anything about. But we can ensure that it reconnects automatically as soon as the device has good signal strength.

Another reason for this can be VPN server settings not supporting your app’s VPN On Demand service accurately. By checking the following values of VPN server, you can overcome this.

  • Ping restart and Ping Exit
  • Key/Value pair of “VPN On Demand” setting
  • If you are on an Android device, you may have to check the values of these parameters namely “cipher”, “auth” &  “NCP-disable”.
  • If you are on an iOS device, you must check a parameter known as “disconnectOnSleep” (for scenario of waking up device from sleep mode). For this, you will have to check the compatibility behaviour of this feature with respective OS version.

3. Battery Issues

As far as battery issues are concerned, you might come across these two plots:
– VPN behavior when your device is at low power mode.
– Another is how much battery your service is consuming.


After these considerations, you are ready to publish your app on the store. As the part of protocol, we highly recommend A/B testing just before you go live. This will save you from any behavioural differences in your app on testing and production mode.

Pro Tip : Once live, your app might not get updated while connected with VPN.

The solution for this case is to check the app’s latest version on the store from your app and notify your users about the update if available. Simultaneously, you need to disconnect the user from VPN programmatically for the app to be updated and intimate the same to users.

Note:- Above content does not have specified value for few parameters as it is important to keep in mind that behavior and challenges may vary based on VPN Protocol you are using. (It can be IKEV2, IPSec, OpenVPN, etc.)

Hope this blog was helpful to you. Enjoy VPN development and for any kind of support/queries feel free to connect with us at