Skip to content

Instantly share code, notes, and snippets.

@stan229
Created October 15, 2015 04:48
Show Gist options
  • Save stan229/1f0705b4b4f443def8ae to your computer and use it in GitHub Desktop.
Save stan229/1f0705b4b4f443def8ae to your computer and use it in GitHub Desktop.
Communicating with React Native app
-(void) mediaPicker:(MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection {
MPMediaItem *mediaItem = mediaItemCollection.items[0];
NSURL *assetURL = [mediaItem valueForProperty:MPMediaItemPropertyAssetURL];
[self.bridge.eventDispatcher sendAppEventWithName:@"SongPlaying" body:[mediaItem valueForProperty:MPMediaItemPropertyTitle]];
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment