Skip to content

Commit

Permalink
Apache 2.0 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gguuss committed Feb 3, 2015
1 parent 5b64435 commit d09ecc0
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 17 deletions.
11 changes: 4 additions & 7 deletions README.md
Expand Up @@ -9,27 +9,24 @@ uncompressed into the appropriate folder. Get them from the
[Google Play Games downloads page](https://developers.google.com/games/services/downloads/).

## Quick Setup

1. Get a client ID from https://console.deveopers.google.com for Google+ or from
https://play.google.com/apps/publish for Google Play Games.
2. For the bundle ID, set it to com.gclassy.swiftsignin.
2. For the bundle ID, set it to `com.gclassy.swiftsignin`.
3. Copy the client ID into the Swift app in the ViewController.
4. Run the app.


## Full Setup

1. Modify the bundle identifier in the project to something more appropriate
for your domain / aps.
for your domain / apps. **Note** You will need this value later.

2. Update the Scheme defined in the URL handlers in info.plist to match your
bundle identifier.
bundle identifier. **Note** Don't skip this step.
3. Register your application with your bundle identifier on
https://console.developers.google.com for Google+ or
https://play.google.com/apps/publish for Google Play Games.
4. Copy the client ID into the Swift app in the ViewController.
5. Run the app and sign-in.


## Troubleshooting
* If your application is failing after sign-in, you most likely have
misconfigured your URL schemes in info.plist.
Expand Down
12 changes: 11 additions & 1 deletion basic-signin/Bridging.h
Expand Up @@ -3,8 +3,18 @@
// swiftsignin
//
// Created by Gus Class on 12/12/14.
// Copyright (c) 2014 gclassy. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef swiftsignin_Bridging_h
#define swiftsignin_Bridging_h
Expand Down
15 changes: 14 additions & 1 deletion swift-play-games/swift-play-games/AppDelegate.swift
Expand Up @@ -3,7 +3,20 @@
// swift-play-games
//
// Created by Gus Class on 2/1/15.
// Copyright (c) 2015 gclassy. All rights reserved.
// Copyright (c) 2015 Gus Class. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//

import UIKit
Expand Down
25 changes: 18 additions & 7 deletions swift-play-games/swift-play-games/ViewController.swift
Expand Up @@ -3,7 +3,18 @@
// swift-play-games
//
// Created by Gus Class on 2/1/15.
// Copyright (c) 2015 gclassy. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import UIKit
Expand All @@ -14,15 +25,15 @@ class ViewController: UIViewController, GPGStatusDelegate {
@IBOutlet weak var signInButton: UIButton!;
@IBOutlet weak var statusText: UITextView!;
@IBOutlet weak var signOutButton: UIButton!

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
GPGManager.sharedInstance().statusDelegate = self;
statusText.text = "Initialized...";
updateUI();
}

@IBAction func signInClicked(sender: AnyObject) {
GPGManager.sharedInstance().signInWithClientID(kClientID, silently: false);
}
Expand All @@ -39,21 +50,21 @@ class ViewController: UIViewController, GPGStatusDelegate {
statusText.text = "Signed in: " + GPGManager.sharedInstance().description;
}
}

func didFinishGamesSignOutWithError(error: NSError!) {
updateUI();
}

func didFinishGoogleAuthWithError(error: NSError!) {
updateUI();
}

func updateUI() {
var isSignedIn = GPGManager.sharedInstance().signedIn;
signInButton.enabled = !isSignedIn;
signOutButton.enabled = isSignedIn;
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
Expand Down
@@ -1,5 +1,19 @@
// Created by Gus Class on 2/1/15.
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


#import <GooglePlayGames/GooglePlayGames.h>
#import <GooglePlus/GooglePlus.h>
#import <GooglePlus/GooglePlus.h>

0 comments on commit d09ecc0

Please sign in to comment.