ios集成firebase_如何将Firebase与您的应用程序集成

本文介绍了如何将Firebase集成到iOS应用程序中,包括Firebase作为移动后端服务的作用,以及通过Android Studio实现Cloud Messaging的具体步骤。文章详细阐述了连接Firebase、设置所需服务、创建Firebase项目以及在应用中实现FirebaseMessagingService的方法,帮助开发者快速为应用添加强大的后端功能。
摘要由CSDN通过智能技术生成

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 MBaaS, 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 here.

本质上,Firebase适合MBaaS的组,即移动后端即服务 。 如果您是前端开发人员,则需要各种可能需要后端功能的服务。 考虑文件存储,数据库,推送通知,分析,广告等。 您可以使用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 Console.

第一步始终要求您将应用程序与Firebase连接。 为此,您必须在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! ?

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

翻译自: https://www.freecodecamp.org/news/how-to-integrate-firebase-with-your-application-74fdde01dfe2/

ios集成firebase

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值