Tuesday 15 February 2011

iphone - How can I login to google-plus using google-plus-ios-sdk-1.7.1 sdk? -



iphone - How can I login to google-plus using google-plus-ios-sdk-1.7.1 sdk? -

i developing iphone application using google plus.

when seek login, 401 error.

i used google-plus-ios-sdk-1.7.1 sdk.

-(bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. [gppsignin sharedinstance].clientid = kclientid; // read google+ deep-link data. [gppdeeplink setdelegate:self]; [gppdeeplink readdeeplinkafterinstall]; homecoming yes; }

in shareviewcontroller:

-(void)viewdidload { [super viewdidload]; gppsignin *signin = [gppsignin sharedinstance]; signin.shouldfetchgoogleplususer = yes; signin.scopes = @[ kgtlauthscopepluslogin ]; signin.delegate = self; [[gppsignin sharedinstance] trysilentauthentication]; _shareconfiguration = [shareconfiguration sharedinstance]; _shareconfiguration.usenativesharebox = yes; //_shareconfiguration.deeplinkenabled = yes; _shareconfiguration.mediaattachmentenabled = yes; } -(void)btngoogleshare_action { if ([gppsignin sharedinstance].authentication) { id<gppsharebuilder> sharebuilder = [[gppshare sharedinstance] nativesharedialog]; [(id<gppnativesharebuilder>)sharebuilder attachimage:self.imgview.image]; [(id<gppnativesharebuilder>)sharebuilder settitle:self.dict[@"title"] description:self.dict[@"comment"] thumbnailurl:nil]; [sharebuilder open]; } else { appdelegate *appdelegate = (appdelegate*)[uiapplication sharedapplication].delegate; gppsigninbutton *sign = [[gppsigninbutton alloc] init]; if (floor(nsfoundationversionnumber) > nsfoundationversionnumber_ios_6_1) { appdelegate.alert = [[uialertview alloc] initwithtitle:@"sign google +" message:@"after login google+, please retry again." delegate:nil cancelbuttontitle:nil otherbuttontitles:@"cancel", nil]; [appdelegate.alert setvalue:sign forkey:@"accessoryview"]; //works in ios7 } else { appdelegate.alert = [[uialertview alloc] initwithtitle:@"sign google +" message:@"after login google+, please retry again.\n\n\n" delegate:nil cancelbuttontitle:nil otherbuttontitles:@"cancel", nil]; sign.frame = cgrectmake(70, 85, 100, 40); [appdelegate.alert addsubview:sign]; } [gppsigninbutton class]; [appdelegate.alert show]; } }

below screenshot, can help me?

as mentioned in comments, first problem discussed here.

second problem text , media simultaneously post mentioned in api documentation gppnativesharebuilder protocol reference. according documentation can't utilize attachimage settitle function. function setprefilltext resolve issue.

ios iphone ios7 google-plus

No comments:

Post a Comment