Mbedos on STM32L0 and connection to the things network

Hi everyone,
I am trying to implement a push button interrupt that every time that a user is pushing button stm32l0 sends information of dummy sensor to the things network.
but when I connect the button and interrupt is enable connection to the things network will stop and it wont send anything to the things network and the Lora connection is also getting lost.
can anyone help me please?