objective c - Google sign-in SDK 2.0.1 for iOS error -


i'm trying integrate google sign-in in project i'm using 'google sign-in sdk 2.0.1'. have follow steps shown on developer.google site when click on button returns error 'unknown error' in - (void)signin:(gidsignin *)signin didsigninforuser:(gidgoogleuser *)user witherror:(nserror *)error

i have integrated 2 url schemes , app-delegate,vc implementation shown in tutorial

here code viewcontroller implement sign-in button

@interface viewcontroller () < gidsigninuidelegate,gidsignindelegate> @property (weak, nonatomic) iboutlet gidsigninbutton *btnsignin;  @end  @implementation viewcontroller  - (void)didreceivememorywarning {     [super didreceivememorywarning];     // dispose of resources can recreated. }  - (void)viewdidload {     [super viewdidload];     [gidsignin sharedinstance].uidelegate = self;     [gidsignin sharedinstance].delegate = self;  }  // ---------------------------------------------------------------------  #pragma mark - gidsignindelegate  - (void)signin:(gidsignin *)signin didsigninforuser:(gidgoogleuser *)user      witherror:(nserror *)error {     if (error) {         nslog(@"error in signin %@",[error localizeddescription]);         return;     } }  // ---------------------------------------------------------------------   - (void)signin:(gidsignin *)signin diddisconnectwithuser:(gidgoogleuser *)user      witherror:(nserror *)error {     if (error) {         nslog(@"error did disconnect %@",[error localizeddescription]);         return;     } }  @end 

what specific error code? generally, see message returned along exception:

2015-06-18 16:36:49.463 signinexample[20038:2727845] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: 'your app must support following url schemes: (null)' 

a few things diagnose in meantime:

  • you might want start the google sign-in quickstart running pod try google , use [[gglcontext sharedinstance] configurewitherror: &configureerror]; configure project

  • if not calling configurewitherror, should setting client id, typically done in appdelegate, example:

    [gidsignin sharedinstance].clientid = "your_client_id";

  • look @ web browser address (if you're testing in simulator) make sure client id getting passed sign in flow

  • make sure add reversed client id url schemes


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -