AndrewShmig / Vkontakte-iOS-SDK-LV

[iOS] Powerful & flexible Vkontakte iOS SDK Latest Version
79 stars 23 forks source link

No auth window displayed, no errors thrown #60

Closed 9teen90nine closed 10 years ago

9teen90nine commented 10 years ago

[[VKConnector sharedInstance] startWithAppID:@"3985619" permissons:[NSArray arrayWithObject:@"wall"] delegate:self]; This call neither shows auth window, nor calls any of

-(void)VKConnector:(VKConnector )connector accessTokenRenewalFailed:(VKAccessToken )accessToken { NSLog(@"Fail :("); } delegate methods. Am I doing something wrong? Xcode 5.0.1, ios 6.1.3

AndrewShmig commented 10 years ago

Hi! Thank you for reporting.

Hmm... Can you show me your code? Where and when are you calling methods etc?

AndrewShmig commented 10 years ago

I am getting following error: screen shot 2013-11-08 at 6 35 45 pm

AndrewShmig commented 10 years ago

screen shot 2013-11-08 at 6 39 30 pm

9teen90nine commented 10 years ago

I have changed my app ID to a random one, so you could use your own app ID. I would never post such an issue if I had some info in debugger.

my code

//SKPViewController.m

//SKPViewController.h

import <UIKit/UIKit.h>

import "VKConnector.h"

import "VKAccessToken.h"

import "VKRequestManager.h"

import "VKUser.h"

@interface SKPViewController : UIViewController

@end

My delegate methods are in the upper post.

AndrewShmig commented 10 years ago

@9teen90nine hm... can you just change your app ID in my standard project which comes in VK iOS SDK and rerun it? Want to see which delegate methods are called at all.

and also, don't import each class apart, import VkontakteSDK.h file.

9teen90nine commented 10 years ago

2013-11-08 18:59:09.632 Project[66432:70b] -[ASAAppDelegate VKConnector:willShowModalView:] 2013-11-08 18:59:16.985 Project[66432:70b] -[ASAAppDelegate VKConnector:accessTokenRenewalFailed:] 2013-11-08 18:59:16.985 Project[66432:70b] -[ASAAppDelegate VKConnector:willHideModalView:] I have clicked "Cancel" on login popup. All done with my app ID.

AndrewShmig commented 10 years ago

@9teen90nine so, as I can see all is working fine?

9teen90nine commented 10 years ago

In your test app for sure, but it doesn't work in my app at all. Not a single line in the debugger.

AndrewShmig commented 10 years ago

@9teen90nine need to see your code (project), cannot say what is wrong with information you gave.

AndrewShmig commented 10 years ago

@9teen90nine if there is any other way I can help you, let me know.

Maybe you forgot to add QuartzCore.framework? Maybe your requests are timed out?

I recommend you to implement all VKConnectorDelegate's methods and to check which one are called.

9teen90nine commented 10 years ago

I'm kinda drunk now, so I'll try tomorrow. I have installed the framework using cocoapods, but also added the quartzcore framework manually. I'll post some more code tomorrow.

AndrewShmig commented 10 years ago

@9teen90nine tomorrow has come! please, update your version of SDK and try again.

9teen90nine commented 10 years ago

So I have updated to v. 4.1.7 (using cocoapods), and updated the auth call UIWebView *wview = [[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; [[VKConnector sharedInstance] startWithAppID:@"3985619" permissons:[NSArray arrayWithObject:@"wall"] webView:wview delegate:self]; but I still don't see any webviews presented. Now I'm getting these messages in debugger: 2013-11-11 09:23:36.663 Skyport[12208:907] +[VKConnector sharedInstance] 2013-11-11 09:23:36.664 Skyport[12208:907] -[VKConnector startWithAppID:permissons:webView:delegate:] each time I press login button. I use navigation controller as a rootviewcontroller and storyboards, if that helps.

AndrewShmig commented 10 years ago

@9teen90nine your uiwebview is hidden or not when a call to startWithApp: starts?

9teen90nine commented 10 years ago

So, I've figured it out. I don't know what was the original issue in v.3.2.1, but in 4.1.7 the issue was in weak UIWebView (which got deleted by the ARC). Actually, I'd suggest keeping function defenitions between versions, because it would be a bit painful to update the code for each upgrade. You can deprecate methods, but as soon as there's no on-line documentation there's no way to figure it out without diving into your code.

AndrewShmig commented 10 years ago

@9teen90nine I am testing now SDK, installed from pods and have the same problem - white screen and thats all... no uiwebview. I'll fix this as soon as possible.

About deprecated methods - you are right, but its quite uncomfortable to have 2-3 methods with the same code logic but with different names. It's my fault that I have created all new versions in a single branch. New version = new branch. Online documentation is coming. Few days and I'll translate code comments (documentation) and after that add GH-Pages tutorials.

AndrewShmig commented 10 years ago

@9teen90nine it works fine. See my code:

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    webView = [[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [self.view addSubview:webView];

    [[VKConnector sharedInstance] startWithAppID:@"3541027"
                                      permissons:@[@"wall"]
                                         webView:webView
                                        delegate:self];
}
AndrewShmig commented 10 years ago

screen shot 2013-11-11 at 10 20 32 am

9teen90nine commented 10 years ago

Yep, I've already got it working - the issue was that I created UIWebView in the IBAction call, and it was deleted by ARC.

AndrewShmig commented 10 years ago

@9teen90nine glad to hear that!