objective c - iOS - Get first name and last name using Google SignIn SDK -


i using google sign in sdk , works perfectly. able following data:

nsstring *userid = user.userid;                  // client-side use only! nsstring *idtoken = user.authentication.idtoken; // safe send server nsstring *name = user.profile.name; nsstring *email = user.profile.email; 

how retrieve first name , last name? , other information, instance city user lives in, , on?

i faced similar problem yours. cannot first name , last name separately google sdk. instead can manually follows,

nsstring *name = user.profile.name; nsarray *items = [name componentsseparatedbystring:@" "];   //take 1 array splitting string nsstring *fname = [items objectatindex:0]; nsstring *lname = [items objectatindex:1]; 

Comments

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -