You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
7.3 KiB

  1. # Firebase iOS Open Source Development [![Build Status](https://travis-ci.org/firebase/firebase-ios-sdk.svg?branch=master)](https://travis-ci.org/firebase/firebase-ios-sdk)
  2. This repository contains a subset of the Firebase iOS SDK source. It currently
  3. includes FirebaseCore, FirebaseAuth, FirebaseDatabase, FirebaseFirestore,
  4. FirebaseFunctions, FirebaseMessaging and FirebaseStorage.
  5. The repository also includes GoogleUtilities source. The
  6. [GoogleUtilities](GoogleUtilities/README.md) pod is
  7. a set of utilities used by Firebase and other Google products.
  8. Firebase is an app development platform with tools to help you build, grow and
  9. monetize your app. More information about Firebase can be found at
  10. [https://firebase.google.com](https://firebase.google.com).
  11. ## Installation
  12. See the three subsections for details about three different installation methods.
  13. 1. [Standard pod install](README.md#standard-pod-install)
  14. 1. [Installing from the GitHub repo](README.md#installing-from-github)
  15. 1. [Experimental Carthage](README.md#carthage-ios-only)
  16. ### Standard pod install
  17. Go to
  18. [https://firebase.google.com/docs/ios/setup](https://firebase.google.com/docs/ios/setup).
  19. ### Installing from GitHub
  20. For releases starting with 5.0.0, the source for each release is also deployed
  21. to CocoaPods master and available via standard
  22. [CocoaPods Podfile syntax](https://guides.cocoapods.org/syntax/podfile.html#pod).
  23. These instructions can be used to access the Firebase repo at other branches,
  24. tags, or commits.
  25. #### Background
  26. See
  27. [the Podfile Syntax Reference](https://guides.cocoapods.org/syntax/podfile.html#pod)
  28. for instructions and options about overriding pod source locations.
  29. #### Accessing Firebase Source Snapshots
  30. All of the official releases are tagged in this repo and available via CocoaPods. To access a local
  31. source snapshot or unreleased branch, use Podfile directives like the following:
  32. To access FirebaseFirestore via a branch:
  33. ```
  34. pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master'
  35. pod 'FirebaseFirestore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master'
  36. ```
  37. To access FirebaseMessaging via a checked out version of the firebase-ios-sdk repo do:
  38. ```
  39. pod 'FirebaseCore', :path => '/path/to/firebase-ios-sdk'
  40. pod 'FirebaseMessaging', :path => '/path/to/firebase-ios-sdk'
  41. ```
  42. ### Carthage (iOS only)
  43. An experimental Carthage distribution is now available. See
  44. [Carthage](Carthage.md).
  45. ## Development
  46. Follow the subsequent instructions to develop, debug, unit test, run integration
  47. tests, and try out reference samples:
  48. ```
  49. $ git clone git@github.com:firebase/firebase-ios-sdk.git
  50. $ cd firebase-ios-sdk/Example
  51. $ pod update
  52. $ open Firebase.xcworkspace
  53. ```
  54. Firestore and Functions have self contained Xcode projects. See
  55. [Firestore/README.md](Firestore/README.md) and
  56. [Functions/README.md](Functions/README.md).
  57. ### Running Unit Tests
  58. Select a scheme and press Command-u to build a component and run its unit tests.
  59. ### Running Sample Apps
  60. In order to run the sample apps and integration tests, you'll need valid
  61. `GoogleService-Info.plist` files for those samples. The Firebase Xcode project contains dummy plist
  62. files without real values, but can be replaced with real plist files. To get your own
  63. `GoogleService-Info.plist` files:
  64. 1. Go to the [Firebase Console](https://console.firebase.google.com/)
  65. 2. Create a new Firebase project, if you don't already have one
  66. 3. For each sample app you want to test, create a new Firebase app with the sample app's bundle
  67. identifier (e.g. `com.google.Database-Example`)
  68. 4. Download the resulting `GoogleService-Info.plist` and replace the appropriate dummy plist file
  69. (e.g. in [Example/Database/App/](Example/Database/App/));
  70. Some sample apps like Firebase Messaging ([Example/Messaging/App](Example/Messaging/App)) require
  71. special Apple capabilities, and you will have to change the sample app to use a unique bundle
  72. identifier that you can control in your own Apple Developer account.
  73. ## Specific Component Instructions
  74. See the sections below for any special instructions for those components.
  75. ### Firebase Auth
  76. If you're doing specific Firebase Auth development, see
  77. [AuthSamples/README.md](AuthSamples/README.md) for instructions about
  78. building and running the FirebaseAuth pod along with various samples and tests.
  79. ### Firebase Database
  80. To run the Database Integration tests, make your database authentication rules
  81. [public](https://firebase.google.com/docs/database/security/quickstart).
  82. ### Firebase Storage
  83. To run the Storage Integration tests, follow the instructions in
  84. [FIRStorageIntegrationTests.m](Example/Storage/Tests/Integration/FIRStorageIntegrationTests.m).
  85. #### Push Notifications
  86. Push notifications can only be delivered to specially provisioned App IDs in the developer portal.
  87. In order to actually test receiving push notifications, you will need to:
  88. 1. Change the bundle identifier of the sample app to something you own in your Apple Developer
  89. account, and enable that App ID for push notifications.
  90. 2. You'll also need to
  91. [upload your APNs Provider Authentication Key or certificate to the Firebase Console](https://firebase.google.com/docs/cloud-messaging/ios/certs)
  92. at **Project Settings > Cloud Messaging > [Your Firebase App]**.
  93. 3. Ensure your iOS device is added to your Apple Developer portal as a test device.
  94. #### iOS Simulator
  95. The iOS Simulator cannot register for remote notifications, and will not receive push notifications.
  96. In order to receive push notifications, you'll have to follow the steps above and run the app on a
  97. physical device.
  98. ## Community Supported Efforts
  99. We've seen an amazing amount of interest and contributions to improve the Firebase SDKs, and we are
  100. very grateful! We'd like to empower as many developers as we can to be able to use Firebase and
  101. participate in the Firebase community.
  102. ### macOS and tvOS
  103. FirebaseAuth, FirebaseCore, FirebaseDatabase and FirebaseStorage now compile, run unit tests, and
  104. work on macOS and tvOS, thanks to contributions from the community. There are a few tweaks needed,
  105. like ensuring iOS-only, macOS-only, or tvOS-only code is correctly guarded with checks for
  106. `TARGET_OS_IOS`, `TARGET_OS_OSX` and `TARGET_OS_TV`.
  107. For tvOS, checkout the [Sample](Example/tvOSSample).
  108. Keep in mind that macOS and tvOS are not officially supported by Firebase, and this repository is
  109. actively developed primarily for iOS. While we can catch basic unit test issues with Travis, there
  110. may be some changes where the SDK no longer works as expected on macOS or tvOS. If you encounter
  111. this, please [file an issue](https://github.com/firebase/firebase-ios-sdk/issues).
  112. For installation instructions, see [above](README.md#accessing-firebase-source-snapshots).
  113. Note that the Firebase pod is not available for macOS and tvOS. Install a selection of the
  114. `FirebaseAuth`, `FirebaseCore`, `FirebaseDatabase` and `FirebaseStorage` CocoaPods.
  115. ## Roadmap
  116. See [Roadmap](ROADMAP.md) for more about the Firebase iOS SDK Open Source
  117. plans and directions.
  118. ## Contributing
  119. See [Contributing](CONTRIBUTING.md) for more information on contributing to the Firebase
  120. iOS SDK.
  121. ## License
  122. The contents of this repository is licensed under the
  123. [Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
  124. Your use of Firebase is governed by the
  125. [Terms of Service for Firebase Services](https://firebase.google.com/terms/).