There’s no way to send GPS data to a database without access to the internet.
However, that being said, you can use Firebase to store gps data. Just make sure you have the “Persist” property enabled.
Persist will store your data offline till the device connects to the internet, so any gps data you collect will be uploaded to Firebase once the device has access to a network.
Hope this helps