Skip to content

Commit

Permalink
Cloud Storage update
Browse files Browse the repository at this point in the history
Change-Id: Ib5326e71e0f09a0b9e3d8728c74e2ce63a505171
  • Loading branch information
ulukaya committed Mar 9, 2017
1 parent 8906123 commit ec46cf3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 26 deletions.
6 changes: 3 additions & 3 deletions storage/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Firebase Storage Quickstart
Cloud Storage for Firebase Quickstart
=============================

The Firebase Storage iOS quickstart demonstrates how to upload data to a Firebase Storage bucket, and retrieve a download URL.
The Cloud Storage for Firebase iOS quickstart demonstrates how to upload data to a Cloud Storage bucket, and retrieve a download URL.

Introduction
------------

- [Read more about Firebase Storage](https://firebase.google.com/docs/storage)
- [Read more about Cloud Storage for Firebase](https://firebase.google.com/docs/storage)

Getting Started
---------------
Expand Down
39 changes: 21 additions & 18 deletions storage/StorageExample/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="16C67" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="byF-jG-Fga">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="byF-jG-Fga">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<development version="7000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11757"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
Expand All @@ -14,7 +17,7 @@
<navigationBar key="navigationBar" contentMode="scaleToFill" barStyle="black" id="X7b-cS-vli">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<color key="barTintColor" red="0.0" green="0.52156862745098043" blue="0.88627450980392153" alpha="1" colorSpace="calibratedRGB"/>
<color key="barTintColor" red="0.0" green="0.52156862745098043" blue="0.88627450980392153" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</navigationBar>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="ewu-8n-6qh"/>
Expand All @@ -33,36 +36,36 @@
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kNe-hA-Ajt">
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" enabled="NO" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kNe-hA-Ajt">
<rect key="frame" x="240" y="157" width="121" height="30"/>
<state key="normal" title="Download Picture"/>
<connections>
<segue destination="dTy-Zw-dam" kind="show" id="7Pz-m3-3O8"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="g4V-CR-dck">
<button opaque="NO" contentMode="scaleToFill" misplaced="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="g4V-CR-dck">
<rect key="frame" x="111" y="95" width="378" height="44"/>
<color key="backgroundColor" red="1" green="0.5607843137254902" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="1" green="0.5607843137254902" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
<state key="normal" title="Take Picture">
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="titleColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="didTapTakePicture:" destination="BYZ-38-t0r" eventType="touchUpInside" id="ydh-qg-AYm"/>
</connections>
</button>
<textView clipsSubviews="YES" contentMode="scaleToFill" editable="NO" text=" " textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="H8c-gN-cFS">
<textView clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" editable="NO" text=" " textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="H8c-gN-cFS">
<rect key="frame" x="24" y="209" width="552" height="200"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
<dataDetectorType key="dataDetectorTypes" link="YES"/>
</textView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="H8c-gN-cFS" secondAttribute="bottom" constant="191" id="5Cr-MM-HS0"/>
<constraint firstItem="H8c-gN-cFS" firstAttribute="top" secondItem="kNe-hA-Ajt" secondAttribute="bottom" constant="22" id="76q-3a-oNi"/>
Expand All @@ -76,7 +79,7 @@
<constraint firstItem="kNe-hA-Ajt" firstAttribute="top" secondItem="8bC-Xf-vdC" secondAttribute="top" constant="157" id="sfl-pR-oEs"/>
</constraints>
</view>
<navigationItem key="navigationItem" title="Firebase Storage Example" id="lX3-oi-C1r"/>
<navigationItem key="navigationItem" title="Cloud Storage for Firebase Example" id="lX3-oi-C1r"/>
<connections>
<outlet property="downloadPicButton" destination="kNe-hA-Ajt" id="PEn-5w-PhG"/>
<outlet property="takePicButton" destination="g4V-CR-dck" id="p2o-E3-Yit"/>
Expand All @@ -96,7 +99,7 @@
<viewControllerLayoutGuide type="bottom" id="8dZ-Gi-AVY"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="27f-X7-nNm">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<navigationBar contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="YWo-Xi-oCi">
Expand All @@ -108,21 +111,21 @@
<navigationItem title="Title" id="Rfx-OL-UUJ"/>
</items>
</navigationBar>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="0ot-gz-oeU">
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0ot-gz-oeU">
<rect key="frame" x="87" y="113" width="426" height="240"/>
<constraints>
<constraint firstAttribute="height" constant="240" id="E7b-0Z-Dbc"/>
</constraints>
</imageView>
<textView clipsSubviews="YES" contentMode="scaleToFill" editable="NO" text=" " textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="Ujz-6e-2KW">
<textView clipsSubviews="YES" contentMode="scaleToFill" misplaced="YES" editable="NO" text=" " textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="Ujz-6e-2KW">
<rect key="frame" x="40" y="452" width="520" height="13"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
<dataDetectorType key="dataDetectorTypes" link="YES"/>
</textView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="0ot-gz-oeU" firstAttribute="centerX" secondItem="27f-X7-nNm" secondAttribute="centerX" id="1CB-kJ-mAN"/>
<constraint firstItem="8dZ-Gi-AVY" firstAttribute="top" secondItem="Ujz-6e-2KW" secondAttribute="bottom" constant="135" id="Ogn-V7-KmS"/>
Expand Down
4 changes: 2 additions & 2 deletions storage/StorageExample/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>NSCameraUsageDescription</key>
<string>Take and upload photos to Firebase Storage</string>
<string>Take and upload photos to Cloud Storage</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Upload photo to Firebase Storage</string>
<string>Upload photo to Cloud Storage</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
Expand Down
2 changes: 1 addition & 1 deletion storage/StorageExample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ - (void)viewDidLoad {
// [END configurestorage]

// [START storageauth]
// Using Firebase Storage requires the user be authenticated. Here we are using
// Using Cloud Storage for Firebase requires the user be authenticated. Here we are using
// anonymous authentication.
if (![FIRAuth auth].currentUser) {
[[FIRAuth auth] signInAnonymouslyWithCompletion:^(FIRUser * _Nullable user,
Expand Down
3 changes: 1 addition & 2 deletions storage/StorageExampleSwift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import Photos
import Firebase
import FirebaseAuth
import FirebaseStorage
/* Note that "#import "FirebaseStorage.h" is included in BridgingHeader.h */

@objc(ViewController)
class ViewController: UIViewController,
Expand All @@ -39,7 +38,7 @@ class ViewController: UIViewController,
// [END configurestorage]

// [START storageauth]
// Using Firebase Storage requires the user be authenticated. Here we are using
// Using Cloud Storage for Firebase requires the user be authenticated. Here we are using
// anonymous authentication.
if FIRAuth.auth()?.currentUser == nil {
FIRAuth.auth()?.signInAnonymously(completion: { (user: FIRUser?, error: Error?) in
Expand Down

0 comments on commit ec46cf3

Please sign in to comment.