I am pretty new to iOS dev. I started building a BLE app a month back and it works fine in foreground and background and there is nothing wrong with BLE connection as such. I restored my phone last week. After restarting the moment I tried running my app in my iPhone. It started crashing. The code was breaking on this line.
[self.manager retrievePeripherals:[NSArray arrayWithObject:(id)peripheral.UUID]];
with a SIGABRT signal. I installed endomondo and tried pairing my sensor with it. It asked me to enable ble and I tapped yes on the dialog and the belt paired. After that I checked my app and it started working fine too. What I think is that since before making my own app, I had endomondo installed so something was enabled already for my app to work fine. I cant really understand what needs to be done to enable my app for ble operations without having any other app to do this for me. Help me fix this. Do we need to set something else to enable ble rather than just enabling bluetooth from settings?