2013-05-30 13 views
5

sto cercando di condividere il contenuto del mio app per Google Plus. A tal fine, ho usato il seguente codice:iOS Google Plus integrazione e la condivisione

-(IBAction)handleGPlus{ 

    id<GPPShareBuilder> shareBuilder = [[GPPShare sharedInstance] shareDialog]; 

    [shareBuilder setURLToShare:[NSURL URLWithString:@"http://dummy.com"]]; 
    [shareBuilder setTitle:@"Some title" description:@"Some description" thumbnailURL:[NSURL URLWithString:@"http://dummy.com/image"]]; 
    [shareBuilder setContentDeepLinkID:kClientId]; 
    [shareBuilder open]; 
} 

E ho predisposto l'IDcliente in questo modo:

static NSString * const kClientId = @"MY_CLIENT_ID"; 

Ma io ottenere il seguente errore:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'You must specify |clientID| for |GPPSignIn|' 
*** First throw call stack: 
(0x346932a3 0x3c33897f 0x346931c5 0x1d2e33 0x122725 0x365860c5 0x36586077 0x36586055 0x3658590b 0x36585e01 0x364ae5f1 0x3649b801 0x3649b11b 0x3819e5a3 0x3819e1d3 0x34668173 0x34668117 0x34666f99 0x345d9ebd 0x345d9d49 0x3819d2eb 0x364ef301 0xee20d 0xed600) 
libc++abi.dylib: terminate called throwing an exception 

I hanno incluso i file GoogleOpenSource.Framework e GooglePlus.Framework troppo.

Qualche idea su cosa sto facendo male?

+0

Perché non si assegna ID client della classe GPPSignIn – chandan

risposta

12

perché non si assegna id Client_ di classe GPPSignIn. Prova questo codice nel tuo AppDelegate

[GPPSignIn sharedInstance].clientID = @"MY_CLIENT_ID"; 
    [GPPDeepLink setDelegate:self]; 
    [GPPDeepLink readDeepLinkAfterInstall]; 

quindi provare sharing link per la sua attuazione in modo giusto.

Spero che ti aiuti.

+1

Grazie ha funzionato. :) –

+0

Il tuo più Benvenuto @Rameez – chandan

Problemi correlati