I'm trying to follow this tutorial to enable unlimited backgrounding on an app, using the new objc_util
(in the beta).
Do you think it will work? Is the tutorial still relevant with the latest iOS versions?
The code looks pretty simple:
@property (nonatomic, strong) AVPlayer *player;
NSError *sessionError = nil;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback withOptions:AVAudioSessionCategoryOptionMixWithOthers error:&sessionError];
AVPlayerItem *item = [AVPlayerItem playerItemWithURL:[[NSBundle mainBundle] URLForResource:@"silence" withExtension:@"mp3"]];
[self setPlayer:[[AVPlayer alloc] initWithPlayerItem:item]];
// this makes sure our player keeps working after the silence ends
[[self player] setActionAtItemEnd:AVPlayerActionAtItemEndNone];
[[self player] play];
I'm not able to fully implement it due to my lack of knowledges. In particular I'm not able to access a class' constant using objc_util
.