Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mobile & Social

Mobile & Social

My talk on the things I've learned from the Google+ mobile apps, and how that applies to the recently release Google+ Sign-In platform. From #mdevcon13

Ian Barber

March 15, 2013
Tweet

More Decks by Ian Barber

Other Decks in Programming

Transcript

  1. builder = new PlusShare.Builder(this, mPC); builder.setMessage("Create a Google+ Page"); builder.setContentUrl(

    Uri.parse("https://eg.com/pages/")); builder.setContentDeepLinkId("/pages/", null, null, null); builder.addCallToAction("CREATE_ITEM", Uri.parse("http://eg.com/pages/create"), "/pages/create"); startActivityForResult(builder.build(), 0); Android Friday, 15 March 13
  2. builder = [[GPPShare sharedInstance] shareDialog]; [builder setPrefillText:@"Create a Page!"]; [builder

    setURLToShare:[NSURL URLWithString:@"http://eg.com/pages"]]; [builder setContentDeepLinkID:@"/pages/"]; [builder setCallToActionButtonWithLabel: @"CREATE_ITEM" URL:@"http://eg.com/pages/create" deepLinkID:@"/pages/create"]; [builder open]; iOS Friday, 15 March 13
  3. Consent onConnection Failed onActivity Result onStart onConnected Account Chooser connect

    startResolution forResult connect connect connect Friday, 15 March 13
  4. GPPSignIn *signIn = [GPPSignIn sharedInstance]; signIn.clientID = @"CLIENT_ID_GOES_HERE"; signIn.scopes =

    [NSArray arrayWithObjects: kGTLAuthScopePlusLogin, nil]; signIn.actions = [NSArray arrayWithObjects: @"http://schemas.google.com/AddActivity", nil]; signIn.delegate = self; iOS Friday, 15 March 13
  5. Moment moment = new Moment.Builder() .setType("http://schemas.google.com" + "/ReviewActivity"); .setTarget(target) .setResult(result)

    .build(); if (mPlusClient.isConnected()) { mPlusClient.writeMoment(moment); } Android Friday, 15 March 13
  6. GTLPlusMoment *moment = [[[GTLPlusMoment alloc] init]]; moment.type = @"http://schemas.google.com" @"/ReviewActivity";

    moment.target = target; moment.result = result; GTLQueryPlus *query = [GTLQueryPlus queryForMomentsInsertWithObject:moment userId:@"me" collection:kGTLPlusCollectionVault]; iOS Friday, 15 March 13
  7. public void onConnected() { // ... mPlusClient.loadPerson(this, "me"); } public

    void onPersonLoaded( ConnectionResult status, Person person) { if (status.getErrorCode() == ConnectionResult.SUCCESS) { Log.d(TAG, "Display Name: " + person.getDisplayName()); } } Android Friday, 15 March 13
  8. GTLQueryPlus *query = [GTLQueryPlus queryForPeopleListWithUserId:@"me" collection:kGTLPlusCollectionVisible]; [plusService executeQuery:query completionHandler:^(id ticket,

    GTLPlusPeopleFeed *peopleFeed, NSError *error) { if (!error) { NSArray* people= [peopleFeed.items]; } }]; iOS Friday, 15 March 13