You need an internet access in your aircraft, either via ground cell networks, or via satellites.
In both cases you will need an external antenna with amplifier attached to the wifi modem/router which will broadcast data to your ipad/phone.
I would try with 4g/lte modem with high gain external antenna positioned on the windows.