Playing a SoundCloud file in IOS app

♀尐吖头ヾ 提交于 2019-12-03 03:35:36
sn-gerzonic

For public access with the IOS Soundcloud SDK you will need to add the Soundcloud clientID as a parameter to your request string:

NSString *urlString = [NSString stringWithFormat:@"%@?client_id=%@", publicTrackUrlString, yourSCClientID];
[SCRequest performMethod: SCRequestMethodGET 
              onResource: [NSURL URLWithString:urlString]
         usingParameters: nil 
             withAccount: nil
  sendingProgressHandler: nil 
         responseHandler:^(NSURLResponse *response, NSData *data, NSError *error){
                      // 
         }];

Then it will work for public tracks when the withAccount: parameter is nil.

More elegantly, you can as well pack the "client_id" in a dictionary and use it with usingParameters:

NSDictionary *params = @{@"client_id": yourSCClientID} ;

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!