今日的程序码 => GITHUB
我很喜欢这篇 CodeLab,我自己认为,如果这篇的内容看得懂那 Provider 基本上都会了。
如果想要看这篇的成品什麽样子,欢迎去 官方 CodeLab 看。
这边里面有 IOS
、Android
、Web
,下面会补充。
https://firebase.google.com/codelabs/firebase-get-to-know-flutter#3
GoogleService-Info.plist
到 ./ios/Runner./ios/Podfile
(这个看你需求,我自己是没有加。)platfrom
的版本不可以太低(我自己是设定为 10.0)。pod 'Firebase/Analytics'
cd ios/
pod install
4.在 ./ios/Runner/AppDelegate.swift
加上这两行(这个要加)
import UIKit
import Flutter
import Firebase // 加上这行
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
FirebaseApp.configure() // 加上这行
GeneratedPluginRegistrant.register(with: self)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
Target
,可以看这个 ISSUE
开启网路设定
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
google-services
放到 android/app/
底下<script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-firestore.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-auth.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.6.1/firebase-firestore.js"></script>
<script>
// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
var firebaseConfig = {
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
firebase.analytics();
</script>
参考来源 (FireStore 安全设定)[https://firebase.google.com/codelabs/firebase-get-to-know-flutter#7]
记得不要把这两个档案上传到 GitLab or GitHub
# Google Services (e.g. APIs or Firebase)
google-services.json
GoogleService-Info.plist
Authentication
这个是 Firebase 中间的区块,用来注册登入、登出的元件。ApplicationProvider
用来处理 Authentication
元件里面的逻辑。YesNoSelection
是否参加活动的区块GuestBook
留言区方法用途
今天就先讲到这边,明天谈谈里面的逻辑和其他的应用。
那我们铁人赛 Day 15 见罗!!
目前我们写好了一个新增的画面 需求 接下来,常见的需求是,人员的新增之後是人员的编辑。 新增用的画面...
Like every year, analysis firms make all kinds of ...
一、筹码面 筹码面主张跟着大金主的动向,搭上主力顺风车。 股票价格在於市场买卖行为, 筹码面分析大户...
举个例⼦来说,这个网址: http://rubyonrails.com/posts/123 Rail...
LINE Developers:https://developers.line.biz/zh-ha...