Welcome Developers!

in

Welcome!

in

iPhone Login Callback functions not responding. Help please.

Last post 05-03-2012 8:55 AM by Mbrianto Iconky. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 03-07-2011 8:43 AM

    • Caleb
    • Not Ranked
    • Joined on 02-25-2011
    • Posts 2

    iPhone Login Callback functions not responding. Help please.

    Hi, I'm developing for the iPhone and currently am having trouble receiving the callback for a successful login. So far, from my app, a user can login to mySpace.------------------------------------------- However, none of the login callbacks are working. I expected (loginViewControllerUserDidCancel), (loginViewController:didLoginWithToken:) or (loginViewController:didFailWithError:) to be triggered by this login event. None of these work. ---------------------------------------------------------------------------- After a user selects "login", a safari view opens with web results for my callback URL. After I close the webpage, my app resumes where it was before the login.------------------------------------------------ If I select login again, a myspace popup appears asking me if I want to resume my session. It seems that my session has been saved. This would be nice IF my app could detect that I am already logged in. --------------------------------------------------------------------------------------------------------------------------- When I call [[MSContext sharedContext] isLoggedIn], it always returns FALSE. I think it is because my access token is not being saved correctly and therefore not being retrieved correctly. --------------- The function: (- (void)_setAccessToken:(MSOAuthToken *)value action:(NSString *)action) always sets the access token to nil because it never sets it to any value BECAUSE the callbacks are not occurring. Because this access token is nil I cannot control what happens after login and detect if I am already logged in. --------------------------------------------------------------------------------------------------- I want to be able to detect if I am already logged in so that when users select the mySpace button, instead of taking them to the "resume session" screen. I want them to have their status immediately updated.-------------------------------------------------------------------------------------------------------------------- Here are the main things I am doing: [MSContext initializeSharedContextWithConsumerKey:kMS_OAuthConsumerKey secret:kMS_OAuthConsumerSecret authorizationCallbackURL:@"my.Test.Radio"];MSSDK *sdk = [MSSDK sharedSDK]; [sdk setUseLocation:YES]; ...then... [[MSContext sharedContext] setPermissions:@"AllowActivitiesAutoPublish|ShowUpdatesFromFriends|UpdateMoodStatus"]; // resume the context from a previously stored state -- [[MSContext sharedContext] resume]; if (![[MSContext sharedContext] isLoggedIn]) {[[MSContext sharedContext] loginWithViewController:self animated:YES withDelegate:self];} else {NSString *status = @"TestStatus"; NSDictionary *mood = [NSDictionary dictionaryWithObject:@"static" forKey:@"moodName"]; // update the status and mood [[MSSDK sharedSDK] updateStatus:status mood:mood];}------------------------------------------------------------------------------------------------------------- *NOTE: I have seen in another thread that I might need to add something to my info.pList to get the callbacks to work but I don't understand what I need to add. Please explain this.------------------------- ** I added the "---" because your website removes all spacing making this impossible to read. Thank You. - Davis
  • 03-13-2011 4:21 PM In reply to

    • Caleb
    • Not Ranked
    • Joined on 02-25-2011
    • Posts 2

    Re: iPhone Login Callback functions not responding. Help please.

    Hey, I found the fix. I was using a different version of OAuth instead of the one that MySpace supplies. This different version works with Foursquare, Facebook and Twitter so it took me sometime to realize that it does not work with MySpace.
  • 03-23-2011 5:12 PM In reply to

    Re: iPhone Login Callback functions not responding. Help please.

     Yes, that is correct. Sorry I did not see this sooner.

     

    thanks,

    Joel

  • 05-03-2012 8:55 AM In reply to

    Re: iPhone Login Callback functions not responding. Help please.

    Test
    Filed under:
Page 1 of 1 (4 items)