I have already refereed the Stackoverflow Link :- How to check for microphone access at time of launch?
But I want to show alert in full screen for getting permission as shown in Shazam app.
App Site :- https://support.shazam.com/entries/26560426-Microphone-access-now-required-iOS7-
App Link :- https://itunes.apple.com/us/app/shazam/id284993459?mt=8
I want to show alert like this. Can anyone help me on this issue?
Code that i have tried so far :-
-(BOOL)requestforpermisssion
{
__block BOOL result=NO;
#ifndef __IPHONE_7_0
typedef void (^PermissionBlock)(BOOL granted);
#endif
PermissionBlock permissionBlock = ^(BOOL granted)
{
if (granted)
{
[self setupRecording];
result = YES;
}
else
{
// Warn no access to microphone
result = NO;
}
};
// iOS7+
if([[AVAudioSession sharedInstance] respondsToSelector:@selector(requestRecordPermission:)])
{
[[AVAudioSession sharedInstance] performSelector:@selector(requestRecordPermission:)
withObject:permissionBlock];
}
return result;
}