Ali Rao
Ali Rao

Reputation: 21

is it possible to add Firebase Admin SDK into the android app which using realtime database and Firebase storage

I have successfully build two apps (Admin and User) both using same Firebase realtime database. I want to separate the admin and the user app. Admin add the user, but the problem is that the user add by the admin is signing in user app and also in admin app. Kindly help me. I have no idea about admin Sdk, is there any way to get rid of this problem

Upvotes: 2

Views: 778

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598775

The Admin SDKs are meant to be used in a trusted environment, such as your development machine, a server you control, or Cloud Functions. They are explicitly not meant to be used in client-side applications.

The common approach to create an administrative app is to:

  1. Create your own server-side API, with either Cloud Functions or on your own server, and expose URL endpoints that can be called from an app. In this code you'll use the Admin SDK, and you'll implement both the logic you need (i.e. creating user accounts), and the logic to secure access to it.
  2. Then call this custom API endpoint from within you Android application.

Also see:

Upvotes: 1

Related Questions