I recommend this article to assist with troubleshooting the the connectivity issues with the Apple Keyboard.
iPad: Using Bluetooth headsets and keyboards
Troubleshooting Bluetooth accessories
If you are unable to pair with or connect to an existing Bluetooth accessory, try the following steps:
- Ensure that the Bluetooth accessory is in range. Most accessories have a range of approximately thirty feet.
- If you are unable to see the accessory in Settings > Bluetooth2:
- If a pairing record already exists, try to connect the accessory using that pairing record, or delete the record and pair again.
- If you have not paired with the accessory, follow the manufacturer's instructions to place it in discovery mode and then pair the accessory.
- If you can see but are unable to pair with the accessory:
- Verify the PIN for the accessory. You may need to refer to your manufacturer's documentation for this.
- Verify that the Bluetooth accessory is using a profile that works with the iPad, such as Headset, A2DP, or HID.
- Ensure that the firmware or software on the Bluetooth accessory is up to date.
- Ensure that the Bluetooth accessory is charged or connected to power.
- Turn off both the iPad and the Bluetooth accessory, then turn both devices on again.
- If the issue persists, test Bluetooth with another accessory or consult the manufacturer's documentation.
Intermittent Bluetooth accessory connectivity
- Check for possible sources of radio-frequency (RF) interference.
- See Avoiding radio frequency interference.
All the best,