Only the peripheral role needs user permission to run. The central can do whatever it wants to. Simply instantiate a CBPeripheralManager
when you want the user to give permission and it will trigger the dialog.
pmanager = [[CBPeripheralManager alloc] initWithDelegate:self queue:nil];
Then you use the peripheralManagerDidUpdateState:
delegate method to get informed about the user's decision. You needn't set the bluetooth-peripheral
backgrounding mode in the plist if your app does not operate in the background.
Keep in mind that the dialog will be popped only once during the lifetime of the application and the setting won't be reset when the app is deleted and reinstalled.
Note also that in light of this behavior, the
The only one reference I can find is that by having a plist key for bluetooth-peripheral the user will be prompted automagically on app launch.
Is not true.
For the twitter part. I haven't tried to use that API yet but found several answers that suggest authorization is either handled automatically for you or iOS will ask only the first time.
- "[App]" Would Like Access to Twitter Accounts alert is not shown in iOS 6 and the answer
- Twitter on ios - How is permission granted to do tweets? and the answer
To test the popup questions you should manually reset the settings in
Settings->General->Reset->Reset Location & Privacy
Just a small addition: best practices for asking for user permission