Skip to content

Commit

Permalink
update ios codelabs m8
Browse files Browse the repository at this point in the history
Change-Id: Ied15ff1c2295782a59147e5c8ea88fa54815f1ac
  • Loading branch information
ulukaya committed Apr 12, 2016
1 parent 7599fd4 commit f5b637f
Show file tree
Hide file tree
Showing 31 changed files with 223 additions and 201 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 107960A21C6130EF003DB6CC /* Build configuration list for PBXNativeTarget "FriendlyChatObjC" */;
buildPhases = (
5524E02CC9C55787F2894CF7 /* 📦 Check Pods Manifest.lock */,
1079607C1C6130EF003DB6CC /* Sources */,
1079607D1C6130EF003DB6CC /* Frameworks */,
1079607E1C6130EF003DB6CC /* Resources */,
2207AD20E6C7E0A62AFEDC1C /* 📦 Embed Pods Frameworks */,
6917503AE9FE8E30BA7E7DB5 /* 📦 Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -162,6 +165,54 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
2207AD20E6C7E0A62AFEDC1C /* 📦 Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "📦 Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-FriendlyChatObjC/Pods-FriendlyChatObjC-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
5524E02CC9C55787F2894CF7 /* 📦 Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "📦 Check Pods Manifest.lock";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n";
showEnvVarsInLog = 0;
};
6917503AE9FE8E30BA7E7DB5 /* 📦 Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "📦 Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-FriendlyChatObjC/Pods-FriendlyChatObjC-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
1079607C1C6130EF003DB6CC /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down
5 changes: 2 additions & 3 deletions ios-starter/objc-starter/FriendlyChatObjC/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@

#import "AppDelegate.h"

@import FirebaseApp;
@import Firebase.Core;
@import FirebaseAnalytics;

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
return YES;
}

Expand Down
27 changes: 16 additions & 11 deletions ios-starter/objc-starter/FriendlyChatObjC/FCViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,30 @@
// limitations under the License.
//

@import Photos;
#import "AppState.h"
#import "Constants.h"
#import "FCViewController.h"

#import "FirebaseStorage.h"
#import "FIRRemoteConfig.h"
#import "FCRLog.h"
@import FirebaseDatabase;
@import FirebaseApp;
@import Photos;

@import FirebaseAuth;
@import Firebase.AdMob;
@import Firebase.Core;
@import FirebaseCrashReporting;
@import FirebaseDatabase;
@import FirebaseRemoteConfig;
@import FirebaseStorage;
@import GoogleMobileAds;

/**
* AdMob ad unit IDs are not currently stored inside the google-services.plist file. Developers
* using AdMob can store them as custom values in another plist, or simply use constants. Note that
* these ad units are configured to return only test ads, and should not be used outside this sample.
*/
static NSString* const kBannerAdUnitID = @"ca-app-pub-3940256099942544/2934735716";

@interface FCViewController ()<UITableViewDataSource, UITableViewDelegate,
UITextFieldDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate> {
int _msglength;
FirebaseHandle _refHandle;
FIRDatabaseHandle _refHandle;
}

@property(nonatomic, weak) IBOutlet UITextField *textField;
Expand Down Expand Up @@ -99,13 +105,12 @@ - (void)viewWillDisappear:(BOOL)animated {

// UITableViewDataSource protocol methods
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return 0;
return [_messages count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
// Dequeue cell
UITableViewCell *cell = [_clientTable dequeueReusableCellWithIdentifier:@"tableViewCell" forIndexPath:indexPath];

return cell;
}

Expand Down
4 changes: 2 additions & 2 deletions ios-starter/objc-starter/FriendlyChatObjC/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="zxq-GO-nHP">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10115" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="zxq-GO-nHP">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10084"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
</dependencies>
<scenes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import "MeasurementHelper.h"

@import Firebase.Core;
@import FirebaseAnalytics;

@implementation MeasurementHelper

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// limitations under the License.
//

#import <Foundation/Foundation.h>
@import UIKit;

@interface SignInViewController : UIViewController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,12 @@ - (void)viewDidAppear:(BOOL)animated {
}

- (IBAction)didTapSignIn:(id)sender {
[self signedIn:NULL];
}

- (IBAction)didTapSignUp:(id)sender {
[self setDisplayName:NULL];
}

- (void)setDisplayName:(FIRUser *)user {
[self signedIn:NULL];
}

- (IBAction)didRequestPasswordReset:(id)sender {
Expand Down
11 changes: 8 additions & 3 deletions ios-starter/objc-starter/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
source 'https://cpdc-eap.googlesource.com/spec.git'
source 'https://github.com/CocoaPods/Specs.git'

pod 'FirebaseStorage'
platform :ios, '7.0'

pod 'Firebase/Storage'
pod 'Firebase/AdMob'
pod 'Firebase/Auth'
pod 'Firebase/CrashReporting'
pod 'Firebase/Database'
pod 'Firebase/RemoteConfig'

platform :ios, '7.0'
target 'FriendlyChatObjC'
# If using CocoaPods 1.0.0+, use the new target syntax.
# target 'FriendlyChatObjC'

# and delete the link_with command.
link_with 'FriendlyChatObjC'
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
1024C2EB1C8F6E3000945A88 /* BridgingHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BridgingHeader.h; sourceTree = "<group>"; };
1037935F1BF4256400C88958 /* module.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; name = module.modulemap; path = Pods/Firebase/Headers/module.modulemap; sourceTree = "<group>"; };
107960721C612531003DB6CC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
107960741C61253B003DB6CC /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -94,7 +93,6 @@
children = (
107960711C612531003DB6CC /* Main.storyboard */,
107960741C61253B003DB6CC /* Info.plist */,
1024C2EB1C8F6E3000945A88 /* BridgingHeader.h */,
);
name = "Supporting Files";
sourceTree = "<group>";
Expand Down Expand Up @@ -357,7 +355,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.codelab.FriendlyChatSwift;
PRODUCT_NAME = FriendlyChatSwift;
PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = FriendlyChatSwift/BridgingHeader.h;
SWIFT_OBJC_BRIDGING_HEADER = "";
};
name = Debug;
};
Expand All @@ -374,7 +372,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.google.firebase.codelab.FriendlyChatSwift;
PRODUCT_NAME = FriendlyChatSwift;
PROVISIONING_PROFILE = "";
SWIFT_OBJC_BRIDGING_HEADER = FriendlyChatSwift/BridgingHeader.h;
SWIFT_OBJC_BRIDGING_HEADER = "";
};
name = Release;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@

import UIKit

import FirebaseApp
import Firebase.Core
import FirebaseAnalytics

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand Down
19 changes: 0 additions & 19 deletions ios-starter/swift-starter/FriendlyChatSwift/BridgingHeader.h

This file was deleted.

24 changes: 16 additions & 8 deletions ios-starter/swift-starter/FriendlyChatSwift/FCViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@
// limitations under the License.
//

import UIKit
import Photos
import UIKit

import FirebaseDatabase
import FirebaseApp
import FirebaseAuth
import Firebase.AdMob
import Firebase.Core
import FirebaseCrashReporting
import FirebaseDatabase
import FirebaseRemoteConfig
import FirebaseStorage
import GoogleMobileAds

/**
* AdMob ad unit IDs are not currently stored inside the google-services.plist file. Developers
* using AdMob can store them as custom values in another plist, or simply use constants. Note that
* these ad units are configured to return only test ads, and should not be used outside this sample.
*/
let kBannerAdUnitID = "ca-app-pub-3940256099942544/2934735716"

@objc(FCViewController)
class FCViewController: UIViewController, UITableViewDataSource, UITableViewDelegate,
Expand All @@ -33,7 +41,7 @@ class FCViewController: UIViewController, UITableViewDataSource, UITableViewDele
var ref: FIRDatabaseReference!
var messages: [FIRDataSnapshot]! = []
var msglength: NSNumber = 10
private var _refHandle: FirebaseHandle!
private var _refHandle: FIRDatabaseHandle!

var storageRef: FIRStorageReference!
var remoteConfig: FIRRemoteConfig!
Expand Down Expand Up @@ -86,7 +94,7 @@ class FCViewController: UIViewController, UITableViewDataSource, UITableViewDele

// UITableViewDataSource protocol methods
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 0
return messages.count
}

func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
Expand Down Expand Up @@ -128,7 +136,7 @@ class FCViewController: UIViewController, UITableViewDataSource, UITableViewDele
let assets = PHAsset.fetchAssetsWithALAssetURLs([referenceUrl], options: nil)
let asset = assets.firstObject
asset?.requestContentEditingInputWithOptions(nil, completionHandler: { (contentEditingInput, info) in
let imageFile = contentEditingInput?.fullSizeImageURL?.absoluteString
let imageFile = contentEditingInput?.fullSizeImageURL
let fileName = AppState.sharedInstance.displayName! + referenceUrl.lastPathComponent!
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.
//

import Firebase.Core
import FirebaseAnalytics

class MeasurementHelper: NSObject {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import UIKit

import FirebaseAuth
import Firebase.Core

@objc(SignInViewController)
class SignInViewController: UIViewController {
Expand Down
11 changes: 8 additions & 3 deletions ios-starter/swift-starter/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
source 'https://cpdc-eap.googlesource.com/spec.git'
source 'https://github.com/CocoaPods/Specs.git'

pod 'FirebaseStorage'
platform :ios, '7.0'

pod 'Firebase/Storage'
pod 'Firebase/AdMob'
pod 'Firebase/Auth'
pod 'Firebase/CrashReporting'
pod 'Firebase/Database'
pod 'Firebase/RemoteConfig'

platform :ios, '7.0'
target 'FriendlyChatSwift'
# If using CocoaPods 1.0.0+, use the new target syntax.
# target 'FriendlyChatSwift'

# and delete the link_with command.
link_with 'FriendlyChatSwift'
4 changes: 0 additions & 4 deletions ios/objc/FriendlyChatObjC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
107960B31C613231003DB6CC /* shared in Resources */ = {isa = PBXBuildFile; fileRef = 107960B21C613231003DB6CC /* shared */; };
107960B61C613263003DB6CC /* SignInViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 107960B51C613263003DB6CC /* SignInViewController.m */; };
107960B91C6156B3003DB6CC /* AppState.m in Sources */ = {isa = PBXBuildFile; fileRef = 107960B81C6156B3003DB6CC /* AppState.m */; };
10D187BD1C8102F700D0DC91 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 10D187BC1C8102F700D0DC91 /* GoogleService-Info.plist */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -37,7 +36,6 @@
107960B51C613263003DB6CC /* SignInViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SignInViewController.m; sourceTree = "<group>"; };
107960B71C6156B3003DB6CC /* AppState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppState.h; sourceTree = "<group>"; };
107960B81C6156B3003DB6CC /* AppState.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppState.m; sourceTree = "<group>"; };
10D187BC1C8102F700D0DC91 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -91,7 +89,6 @@
107960831C6130EF003DB6CC /* Supporting Files */ = {
isa = PBXGroup;
children = (
10D187BC1C8102F700D0DC91 /* GoogleService-Info.plist */,
107960AA1C6131E4003DB6CC /* Info.plist */,
107960A81C6131B6003DB6CC /* Main.storyboard */,
107960841C6130EF003DB6CC /* main.m */,
Expand Down Expand Up @@ -161,7 +158,6 @@
files = (
107960B31C613231003DB6CC /* shared in Resources */,
107960A91C6131B6003DB6CC /* Main.storyboard in Resources */,
10D187BD1C8102F700D0DC91 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
Loading

0 comments on commit f5b637f

Please sign in to comment.