Yes it must be done before take-off.
Make sure your FR is switched on before doing the Internet declaration, and stays on. (in case the FR has a residing/old declaration)