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