This quick-start application is an iOS Xcode project that lets you get started with the Google+ platform in about 10 minutes. The app demonstrates using the Google+ Sign-In button, using SDK methods to list people that the user has circled, and making requests to other Google APIs.
Prerequisites
Adding Google+ client features to iOS applications requires:
- Install Xcode 4.5 or later
Step 1: Enable the Google+ API
To enable the Google+ API for your app, you need to create a Google Developers Console project, enable the Google+ API then create a client ID.- Go to the Google Developers Console.
- Select a project, or create a new one.
- In the sidebar on the left, select APIs & auth (the APIs sub-element is automatically selected).
- In the displayed list of APIs, make sure the Google+ API status is set to ON, as well as any other APIs that your app requires.
- In the sidebar on the left, select Credentials.
In the OAuth section of the page, select Create New Client ID.
In the resulting Create Client ID dialog box, do the following:
- Select Installed application for the Application type.
- Select iOS.
- In the Bundle ID field, enter the
bundle identifier from your application's project summary.
The default Bundle ID for the provided sample app is
com.google.GooglePlusPlatformSample
. - Leave the App Store ID field blank, since this quick-start app is not published in the Apple iTunes App Store.
- Under Deep Linking, click Enabled.
- Click the Create client ID button.
- In the resulting Client ID for iOS application panel, note or copy the Client ID that your app will need to run the sample.
Step 2: Download the quick-start app and open its Xcode project
The zip file to download contains the source files and Xcode project file for the quick-start application. The file also contains the iOS SDK library for the Google+ platform.
- Download the Google+ iOS SDK which includes the quick-start application.
- Navigate to the zip file in the Finder and double-click it to extract it to
a folder named
google-plus-ios-sdk-version
. - Inside this folder, open the
SampleCode
folder then double-click theGooglePlusSample
Xcode project file to open it in Xcode.
Step 3: Insert the client ID
- In Xcode, navigate to the
GooglePlusSample
folder and open the fileGooglePlusSampleAppDelegate.m
. - In this file, find the variable
kClientID
and replace its value within quotes to the client ID you generated earlier.
Step 4: Run the Google+ sample application
- In Xcode, click the Run button to compile and run the app.
This sample app demonstrates Google+ feature and shows how to integrate the Google+ components in your app.
Next steps
Now that you have learned to create a Google Developers Console project and configured your Xcode project, you can begin integrating Google+ features into your iOS app:
Learn more about the Google+ features you can add to your app: