To manipulate a permission you need two functions.
First should return a current status (we already discussed this). Another function should ask a permission. It can looks so:
#If OBJC
@import AVFoundation;
- (void) askRecordPermission { [[AVAudioSession sharedInstance] requestRecordPermission: ^(BOOL granted) {}]; }
#End If
To run it
Dim nativeObjectMe As NativeObject = Me
nativeObjectMe.RunMethod ("askRecordPermission", Null)
A logic can be different.
For a example, when the app starts, it checks a current status. If Undetermined (the app was started a first time), use askRecordPermission.
If a new status after askRecordPermission is Denied, ask user the second time. If Denied again, do not ask anymore and do not use B4i 'Record' statements.