2个应用程序在Firebase中具有相同的数据库 [英] 2 apps with the same database in Firebase

查看:33
本文介绍了2个应用程序在Firebase中具有相同的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目是创建一个与Uber类似的应用程序.

My project is to create an app similar to Uber.

有2个应用程序,一个用于合作伙伴,另一个用于客户,我发现我可以在同一个Firebase项目中创建多个应用程序,这样我就可以为两个应用程序使用相同的数据库.

There are 2 APPs, one for partners and the other for clients and I saw that I can create more than one app within the same Firebase project,that way I can use the same database for both APPs.

我不明白的是,如何区分合作伙伴和客户?

What I did not understand, how to do is differentiate the partners and the clients?

在身份验证"菜单中,我必须使用布尔值来区分它们.

In the "Auth" menu, I would have to differentiate them with a Boolean.

我可以使用Firebase做到这一点吗?如果没有,是否有人知道给我显示另一种方法?或另一个数据库?

Can I do this using Firebase? If not, does anyone know show me another way to do? or another database?

我还有一个关于部分付款的问题,我如何在Firebase中存储信用卡数据?它对此有支持吗?有谁知道给我看个图书馆来直接通过应用程序付款?

Another question I have is in relation to part of the payment, How I store the data of the credit card at Firebase? It support for this? Does anyone know show me a library to make payments straight through the app?

推荐答案

我认为您无法通过身份验证"菜单执行此操作.仅允许用户注册并登录到您的应用的唯一目的是使用此身份验证"功能.

I don't think you can do that from the "Auth" Menu. This "Auth" function is only there for the sole purpose of letting user signup and login to your app.

您只需要在实时数据库中实现用户类别.使用键:值"userType":"client"或"userType":"partner"存储用户的uID.

You just need to implement the user category in your Real time database. Store the user's uID, with key:value "userType":"client" or "userType":"partner".

每当关联的uID成功登录到您的应用程序时.您需要从实时数据库中读取信息,以确定该用户是客户端"还是合作伙伴",并相应地显示适当的功能(或将其定向到其他View控制器,例如:ClientViewController/PartnerViewController).或者,如果您有2个完全独立的应用程序.然后,这可以用作验证,只是确保该用户是否确实是合作伙伴/客户.

And whenever the associated uID logs into your app succesfully. you need to read from the Real Time database to determine whether this user is a "client" or "partner" and show the appropriate functionality accordingly (or direct them to a different View controller eg: ClientViewController / PartnerViewController). Or if you have 2 entirely separate apps. Then this can act as a verification, just to make sure if this user is indeed a partner / client.

我不确定该如何处理支付系统.但是您可以看一下Braintree之类的图书馆.

I'm not sure what to do with the payment system. But you can look at library like Braintree or something.

这篇关于2个应用程序在Firebase中具有相同的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆