markdown 火力地堡

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 火力地堡相关的知识,希望对你有一定的参考价值。

### What is Firebase?
* Backend provider from Google
    * Basically allows us to save our data to the servers hosted by Google
    * DATABASE
    * AUTHENTICATION
    * Cloud based database
---
## Set up Account
* [Create account here](https://firebase.google.com/)
* [Go to console](https://console.firebase.google.com)
* Create a new project
---
### Set up Database
* Navigate to add Firebase to your iOS App
* **Ensure you have a unique bundle identifier for your app!**
* Copy and paste the bundle identifier into the field on the firebase console -> `Register App`
* Leave app nickname and ios store id blank!
* Download `GoogleService-Info.plist` and insert it below the info.plist file in your project directory
    * Make sure the `Destination` and `Add to targets` are checked! 
* Back in the firebase console, click `next`
* Podfile Setup: `cd` into your project directory and `pod init`
    * `open Podfile -a Xcode`
    * **uncomment** platform
    * Add the following pods:
    
    ```ruby
    pod 'Firebase'
    pod 'Firebase/Auth'
    pod 'Firebase/Database'
    pod 'SVProgressHUD'
    pod 'ChameleonFramework'
    ```
   
    * `pod install`
* Exit app
* In the same terminal `open .`, and use the `.xcworkspace` file
* Run `cmd + B`
* To ignore the warnings, head into the `Podfile` and append the following LOC:

```ruby
post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['CLANG_WARN_DOCUMENTATION_COMMENTS'] = 'NO'
        end
    end
end
```

* **Save, close app, in terminal `pod update`**
* **Once completed, open project.xcworkspace and run `cmd+B`**
* Back to firebase console, `Finish`, skip connection
---
### Saving to Database
* Import the module: `AppDelegate.swift` file, `import Firebase`

```swift
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

  //TODO: Initialise and Configure your Firebase here:
  FirebaseApp.configure()
  
  // reference to a brand new database
  let myDatabase = Database.database().reference()
  
  // Set some data to the database upon first loading the app
  myDatabase.setValue("We've got data")
  
  return true
}
```

* Head back into firebase terminal and create a realtime database
* Head into the `rules` tab and make sure the following rules are specified:

```
{
  "rules": {
    ".read": true,
    ".write": true
  }
  
  // MORE SECURE FOR AUTH USERS

  "rules": {
    ".read": "auth != null",
    ".write": "auth != null"
  }

}
```

* May need to restart your app 2 times for the set data to be in the database!











### Authenticating Users
* Head in to the firebase console, in the `Authentication` tab
* `Sign in Method` and enable `Email/Password`
* 

以上是关于markdown 火力地堡的主要内容,如果未能解决你的问题,请参考以下文章

text 火力地堡

java 火力地堡

燕麦工作室第一卷:火力地堡高清下载

Firebase读取/保存数据以将其用作列表|斯威夫特/火力地堡

markdown 反应天然-火力

codevs1700 施工方案第二季