You cannot check the connectivity status and make the URL Request if your app is not running. An alternate solution may be to make the request once the app is opened by the user the next time. At that time you will get a call back in func applicationDidFinishLaunching
in the AppDelegate. At this point you check if you have data which you need to sync to the MySql Data base and make the request.
Edit
As you mentioned in the comment. In iOS you cannot detect the network when the app is closed SO Post. It is possible to do so using backgroundMode. Refer to this SO Post
But as you pointed. There is one way of achieving it by geo fencing. An iOS Application wakes up when it enters a region you set a geo fence to. So at that you can make the API request to wake the app. SO Post 2
Edit2
You can wake up the app using silent notification.
Hope this helps. Please let me know if you need any clarifications. Welcome to stackoverflow. Please mark the answer if it you solves the issue you are facing.