Sending data from MIT app to arduino

I want to create a button that when clicked will send a ‘1’ to my Arduino via BluetoothLE to turn on an electromagnet and another button to send a ‘0’ to the Arduino to turn off the electromagnet. At the same time add it to list view that is like a “history” to tell me that I’ve pressed this button. Can someone show the code for the blocks needed please.