0

I'm creating an a Spotify iOS app using Cocoalibspotify that essentially allows for live playlist sharing. I do this by having the user add a playlist and set it as collaborative. So I have 2 questions:

1) I want the app to notify the user when a subscriber adds or deletes a track from a playlist shared between them. Is this possible?

2) Is it possible to send a request to another user to have them subscribe to one of your playlists?

Sorry if these questions are kind of poorly worded. I'm fairly new to iOS development and Cocolibspotify. Thanks for the help!

Jacob D
  • 229
  • 2
  • 5

1 Answers1

0

SPPlaylist declares SPPlaylistDelegate - have a look at the documentation and header files for details. If you're that new to iOS, also look up the delegate pattern - it's very common in iOS development.

SPPlaylistDelegate declares a number of methods for when tracks are added, removed and moved around in a playlist.

Set your delegate like this:

self.playlist.delegate = self;

Then the delegate methods will be called by the playlist when appropriate, like:

-(void)playlist:(SPPlaylist *)aPlaylist didAddItems:(NSArray *)items atIndexes:(NSIndexSet *)newIndexes {

    // Track(s) added!
}
iKenndac
  • 18,730
  • 3
  • 35
  • 51