Here are the steps that has to follow in-order to connect and use a bluetooth keyboard with your iPhone. This steps will using the BTstack Keyboard utility developed by Matthias Ringwald.
Now you need to select the Purchase button at the top right of the screen. BTstack Keyboard costs $5.00 and can be bought using Paypal or Amazon Payments.
Tap the Confirm button to begin installation.
You will likely be notified that Apple’s Bluetooth is active. Only one Bluetooth Stack can be active at the same time. Since the keyboard will only work with the BTstack press the OK button to activate this stack.
The app will now search for your keyboard. You must make the keyboard discoverable in order for it to be located. On the Apple Wireless Keyboard you can hold down the power button until the led blinks repeatedly. For other keyboards, check the user manual.
Once the device has been connected you will be prompted to enter a pin number using the keyboard then press ENTER.