-
Notifications
You must be signed in to change notification settings - Fork 84
Problem with LiveSDK + swift + cocoapods (loading xib) #74
Comments
Maybe im getting redirected to some blank error page #pragma mark UIWebViewDelegate methods
|
Hi @ammoqq |
so this is my url after i press "YES" on the permissions screen: 2015-07-20 20:57:01.294 Ddukt[363:50716] https://account.live.com/Consent/Update?ru=https://login.live.com/oauth20_authorize.srf ... scope=wl.signin+wl.basic+wl.emails+wl.skydrive+wl.offline_access 2015-07-20 20:57:02.101 Ddukt[363:50716] https://login.live.com/oauth20_authorize.srf?lc=1045&display=ios_phone&response_type=code&redirect_uri= ... &res=success 2015-07-20 20:57:03.286 Ddukt[363:50716] https://login.live.com/oauth20_desktop.srf?code=CODE_HERE&lc=1045 //btw i can only get those values on device, cause on simulator it crashes with NSlog |
and the result for the user is simply going from the page that asks for permissions to the blank page and nothing more for example i made the code like that:
and the console says: EDIT: yes im postive! authDialogCompletedWithResponse:url this method never gets called (when i place NSLog inside the LiveAuthRequest.m, inside the authDialogCompletedWithResponse:url method is never called). Any idea why or how to fix that ? |
maybe to make delegate work i need to do something like i do for example in google signInGPP?.delegate = self but that won't compile it is strange cause for example when starting to log in the method authCompleted(status: LiveConnectSessionStatus, session: LiveConnectSession!, userState: AnyObject!) { |
As I mentioned before we do not support swift/object c interop, I can't guarantee that the LiveSDK will work with swift. Can you tell me what the _delegate object looks like at that point? Is it nil? |
yes it is null I would be more than thankful for any clues or ideas how to tackle that, I can try to fix it myself but i have no idea how at the moment |
It is possible that the delegate is getting dealloced before the response is sent. The delegate in the LiveAuthDialog is not the same delegate that you pass into LiveConnectClient. It is possible that the LiveConnectClientCore object is getting dealloced before the auth result is finished, this will result in it deallocing the delegate that you are seeing as nil. If you insert a breakpoint or NSLog statement in the dealloc of LiveConnectClientCore you will be able to see if this is actually the case. |
well actually dealloc in LiveConnectClientCore is called before i even click yes in the webview!
|
If you want you can add a retain statement to line 96 in LiveConnectClient.m to try and fix the problem
Warning: This may (and probably does) cause a memory leak. As I mentioned we do not support swift /objective c interop and at the time do not have plans to support it in the future. |
ok great it indeed fixes the problem (yea i understand it isnt the best way) Thanks for help! |
Getting error:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle ... (loaded)' with name 'LiveAuthDialog_iPhone''
//in the place of ..., there is my simulator directory.
Important*
I tried manually drag & dropping the xibs into Copy Bundle Resources, but that helps with the error only partially. I am getting redirected to the xib i am supposed to, can log in, can click the Yes button on the permissions AND then im redirected to a blank webview page instead of going back to my app. Any ideas ?
Is there a way to fix this ? there is no info on readme except running pod install and it should work. Unfortunately it doesnt.
Please help
EDIT: I have the PhotoSky example working fine, but cannot do it in swift. The photoSky app works perfectly when i use my own client ID in it!
this is how i login in swift:
var live = LiveConnectClient(clientId: ClientID, delegate: self)
live.login(self, scopes: Scopes, delegate: self)
The text was updated successfully, but these errors were encountered: