Firebase

1.首先前往firebase.google.com注册账号,必须使用Gmail账户;

2.进入firebase console,create new project,进入project, Add an app,选择Android;

3.在Android Studio中打开Manifest文件,复制package name;

4.在Android Studio右侧的Gradle面板中运行app-> Tasks-> Android -> SingningReport,复制SHA1

5.点击REGISTER APP, 进入Download config file,下载google-services.json;

6.将Android Studio左侧的视图切换为Project,然后将google-services.json移动到app 文件件下;

7.点击continue,进入Add Firebase SDK;

8.最后一步,添加Denpendces

在project build.gradle中添加

classpath 'com.google.gms:google-services:3.0.0'

在app build.gradle中的最后一行添加

apply plugin: 'com.google.gms.google-services'

另外需要添加你需要使用的firebase模块,可以在firebase的Documentation中的guides中找到模块列表

Gradle Dependency LineService
com.google.firebase:firebase-core:10.2.1Analytics
com.google.firebase:firebase-database:10.2.1Realtime Database
com.google.firebase:firebase-storage:10.2.1Storage
com.google.firebase:firebase-crash:10.2.1Crash Reporting
com.google.firebase:firebase-auth:10.2.1Authentication
com.google.firebase:firebase-messaging:10.2.1Cloud Messaging and Notifications
com.google.firebase:firebase-config:10.2.1Remote Config
com.google.firebase:firebase-invites:10.2.1Invites and Dynamic Links
com.google.firebase:firebase-ads:10.2.1AdMob
com.google.firebase:firebase-appindexing:10.2.1App Indexing

9.最后一步,Sync Gradle。

 

*在Android Studio的Tools中打开Firebase的Assistant,使用'Connect to Firebase'连接项目,里面有所有内容的guides,非常方便使用




转载于:https://www.cnblogs.com/mazing/p/6689061.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值