The above answer worked for me after a bit of a fight for a bet. I think there is some problem with accessing the file path. The code has been modified and verified here.
NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"sampleFile" ofType:@"mp3"]; NSURL *soundFileURL = [NSURL fileURLWithPath:soundFilePath]; NSArray *activityItems = @[soundFileURL]; UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil]; [self presentViewController:activityVC animated:YES completion:nil];
source share