I have an iPhone app, in which I have created a transmitter and a receiver, both. But, the transmitter stops transmitting when the screen is locked or the app is sent to the background.
Can I keep transmitting (a.k.a. advertising, broadcasting) while still in the background?
Unfortunately, no. iOS does allow background advertising of Bluetooth Services, but only using a proprietary technique that breaks the iBeacon advertising format. As a result, if your app starts transmitting as an iBeacon, then switches to the background, its transmission will still exist, but it will no longer be picked up by iBeacon detectors. See here for more information:
...you should be aware that advertising while your app is in the background operates differently than when your app is in the foreground. In particular, when your app is advertising while in the background ...[a]ll service UUIDs contained in the value of the CBAdvertisementDataServiceUUIDsKey advertisement key are placed in a special “overflow” area; they can be discovered only by an iOS device that is explicitly scanning for them.
The bottom line is that iOS devices cannot transmit as iBeacons when they are in the background.