I am creating an iPhone app using the TestApp application that came with the Soundcloud
Coca API wrapper download.
When I use the key and client id and call back URL there is no
problem. I can log into the app using my Soundcloud account and upload
the my tracks at the touch of a button.
When I switch the client id, key and callback URL to the one that I
have listed on my developer account the behavior changes. I can log in
and the app gets registered to my account, but before my username is
posted to the app I get a 401 at this level in the code:
- (void)connectionDidFinishLoading:(NSURLConnection *)connection;
{
#if (NXOAuth2ConnectionDebug)
NSLog(@"%.0fms (SUCC) - %@", -[startDate
timeIntervalSinceNow]*1000.0, [self descriptionForRequest:request]);
#endif
printf("connectionDidFinishLoading\n");
if (sendConnectionDidEndNotification) [[NSNotificationCenter
defaultCenter] postNotificationName:NXOAuth2DidEndConnection
object:self];
sendConnectionDidEndNotification = NO;
printf("connectDidFinishLoading.1\n");
printf("self.statusCode: %d \n", self.statusCode);
Since my app works perfectly fine with the key, id and callback URL
given in the TestApp it is strange to me that when I switch these
values I get the 401.
Just to clarify further:
It is an iOS app and I have definitely placed the correct key and id
in the correct spot. The client ID and Secret from souncloud.com (not
sandbox-soundcloud) are plugged into the values directly under
#ifdef kUseProduction
This seems to me the correct thing to do. Also, in my info.plist file
I have the URL identifier
com.imc
and the URL scheme
http://imc
which matches exactly the redirect URI have filed with Soundcloud.
Likewise I have defined my kCallbackURL as
http://imc
Any other thoughts?
I finally got the answer from the lovely people at SoundCloud.