Here is the entirety of what Apple's official iPhone User Guide has to say about Bluetooth keyboard use:
You can use Magic Keyboard, including Magic Keyboard with Numeric Keypad, to enter text on iPhone. Magic Keyboard connects to iPhone using Bluetooth and is powered by a built-in rechargeable battery. (Magic Keyboard is sold separately.)
Note: For compatibility information about Apple Wireless Keyboard and third-party Bluetooth keyboards, see the Apple Support article Apple Wireless Keyboard and Magic Keyboard compatibility with iOS devices.
Note: If Magic Keyboard is already paired with another device, you must unpair them before you can connect Magic Keyboard to your iPhone. For iPhone, iPad, or iPod touch, see Unpair a Bluetooth device. On Mac, choose Apple menu > System Preferences > Bluetooth, select the device, then Control-click its name.
Magic Keyboard disconnects when you turn its switch to Off or when you move it or iPhone out of Bluetooth range—about 33 feet (10 meters).
To reconnect, turn the keyboard switch to On, or bring the keyboard and iPhone back into range, then tap any key.
When Magic Keyboard is reconnected, the onscreen keyboard doesn’t appear.
You need to use the onscreen keyboard instead of an external keyboard to do things like type accented characters or use dictation.
To show the onscreen keyboard, press ⏏︎ on the external keyboard. To hide the onscreen keyboard, press ⏏︎ again.
Press Command-Space.
You can change how iPhone automatically responds to your typing on an external keyboard.
Go to Settings ⚙︎ > General > Keyboard > Hardware Keyboard, then do any of the following: