博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ios集成firebase_如何将Firebase与您的应用程序集成
阅读量:2523 次
发布时间:2019-05-11

本文共 3236 字,大约阅读时间需要 10 分钟。

ios集成firebase

You’ve probably heard about Firebase, but may not know much about how it works and how it fits in with your application. Well, you’ve come to the right place. We’ll go over what Firebase is and how to integrate it with your Android project straight from Android Studio. Buckle up.

您可能已经听说过Firebase,但对Firebase的工作方式以及它如何适合您的应用程序可能不太了解。 好吧,您来对地方了。 我们将介绍什么是Firebase,以及如何直接从Android Studio将其与您的Android项目集成。 扣上安全带

火什么? (Fire-what?)

Essentially, Firebase fits into the group of , which means, Mobile Backend as a Service. If you are a frontend developer, you will need various services that may require backend capabilities. Think file storage, database, push notifications, analytics, advertisements and more. You can use Firebase to help you in connecting your application with those services. To read more about it, go .

本质上,Firebase适合的组,即移动后端即服务 。 如果您是前端开发人员,则需要各种可能需要后端功能的服务。 考虑文件存储,数据库,推送通知,分析,广告等。 您可以使用Firebase帮助您将应用程序与这些服务连接。 要了解更多信息,请转到 。

跟着这些步骤 (Follow These Steps)

  1. After opening your project in Android Studio, click on the Tools tab and select Firebase

    在Android Studio中打开项目后,点击“ 工具”标签,然后选择Firebase

  2. A new window pops up from the right, the Assistant tab, with all the services Firebase offers.

    右侧会弹出一个新窗口,即“ 助手”选项卡,其中包含Firebase提供的所有服务。

3. Select the service you wish to add to your application by clicking on it. We’ll select Cloud Messaging as an example.

3.通过单击选择要添加到应用程序的服务。 我们将选择Cloud Messaging作为示例。

4. Click on the link that shows up, specifically, Set up Firebase Cloud Messaging.

4.单击显示的链接,特别是“ 设置Firebase Cloud Messaging”。

5. The Assistant window will transform into a new menu:

5.助手窗口将转换为新菜单:

Follow the steps outlined in the Assistant, making sure to pay attention to any code that needs adding (and where it needs to be added).

请遵循“助手”中概述的步骤,确保注意需要添加的任何代码(以及需要添加的位置)。

The first step will always require you to connect your application with Firebase. In order to do so, you have to create a project for your application in the .

第一步始终要求您将应用程序与Firebase连接。 为此,您必须在为您的应用程序创建一个项目。

And the second will guide you to add the specific service you are after. So for our example, FCM stands for Firebase Cloud Messaging.

第二个将指导您添加要使用的特定服务。 因此,在我们的示例中,FCM代表F irebase C大声M消息

The following things we need to do are:

我们需要做的以下事情是:

  • Create a new class which extends FirebaseMessagingService

    创建一个扩展FirebaseMessagingService的新类
  • Override two methods: onNewToken and onMessageReceived

    覆盖两个方法: onNewTokenonMessageReceived

  • Declare the service in your manifest:

    在清单中声明服务:

6. The last step you will encounter is called Next Steps. Here you will be prompted to go to the Firebase Console. This is in order for you to interact with the service you just added.

6.您将遇到的最后一个步骤称为“ 下一步” 。 在此处,系统将提示您转到Firebase控制台。 这是为了让您与刚刚添加的服务进行交互。

You now posses the ability to grant any application you make a powerful backend component that can be up and running in minutes. This will drastically shorten your development time and enable you to focus on what is important for you.

现在,您可以授予您制作强大的后端组件的任何应用程序的功能,这些组件可以在数分钟内启动并运行。 这将大大缩短您的开发时间,并使您能够专注于对您而言重要的事情。

Comments? Questions? Feel free to reach out.

注释? 有什么问题吗 随时与我们联系。

If you liked this article, clap away so that others can enjoy it as well! ?

如果您喜欢这篇文章,请拍一下,以便其他人也能喜欢它!

翻译自:

ios集成firebase

转载地址:http://vvuzd.baihongyu.com/

你可能感兴趣的文章
第2天线性表链式存储
查看>>
python自动化测试-D11-学习笔记之一(yaml文件,ddt)
查看>>
mysql存储过程使用游标循环插入数据
查看>>
Ubuntu 12.04 添加新用户并启用root登录
查看>>
20145309信息安全系统设计基础第9周学习总结上
查看>>
c# 字段、属性get set
查看>>
td内容超出隐藏
查看>>
Spring CommonsMultipartResolver 上传文件
查看>>
Settings app简单学习记录
查看>>
SQLAlchemy
查看>>
多线程
查看>>
使用缓存的9大误区(下)转载
查看>>
appium键值对的应用
查看>>
MyEclipse 8.X 通用算法
查看>>
selenium.Phantomjs设置浏览器请求头
查看>>
Java Bigdecimal使用
查看>>
SQL注入之绕过WAF和Filter
查看>>
jquery validate使用方法
查看>>
DataNode 工作机制
查看>>
windows系统下安装MySQL
查看>>