I want to just update location to server in app terminated state.
I found one great example for getting location, when app is closed. here
but what my problem is after getting location, somehow webservice not called. any help would be great.
or any specific way for calling webservice in app termination state?
Once you get location updates in terminated state, you should call your web service in a single block.
Try to move all your code that is required to perform the web service action. Like, preparing data for web service, URLSession code and handling response, and everything to this single block. If you have data to be taken from any global instance, you need to prepare them again in this block, as they are not available in app memory.
You should not refer any other class in that block. They are not available for execution during terminated state.
Hope this helps :)