firebase – How can I assign content to certain logged in users in Flamelink and React Native?

I am using Firebase with React Native and have just started using Flamelink as a CMS.

Before using Flamelink, I was able to get certain content from a logged in user through a real-time Firebase database because the scheme was as follows:

**fruits**
mwaKRypUrNb8rJdsj9YUxw0sA892
-M055RlZ7HBzgRD9LS1d
-M055Why2psB2kqE4mYO
-M05W3LK8C1kgFsPNRqa
-M05W47cbhJ2VA_Y2nnT
-M05W5Wu9Pp6TZJJPc8t
-M05W6Xc_iP1upbyENpj
-M05W7JnVt3t3DsjNaRT
-M05W8OuZph-1gDDY9UX
-M05W9Fws0_hsNCAyKDt
**users**
-zFWGnGhEmbfhjAJsUT99ZbkJBZ33

As you can see, the fruit scheme had user-specific content.

With Flamelink the scheme looks like this:

**flamelink**
--environments
----production
------content
--------**fruitEntryForm**
----------en-US
------------1582070066847
------------1582074440836
------------1582080914427

**schemas**
**media**
**permissions**
**settings**
**users**
--zFWGnGhEmbfhjAJsUT99ZbkJBZ33

My native response code is below:

const user = navigation.getParam("user");
     const currentUserData = await firebase
      .database()
      .ref("flamelink/users")
      .child(user.uid)
      .once("value");

const fruits = await app.content.get("content");

How can I change Flamelink so that I can manage content based on the logged in user?

Java – Contact the Firebase node

How are you

I have the following structure in a node:

Insert picture description here

How do I consult this knot?

Because it only returns true if I enter all data in the search "38,41,116 …", but if I only enter "38" or a loose value that has the return, it is false.

This means that I can only display the result if I enter everything within the node and not just a part of it.

I tried .startAt (text) .endAt (text + " uf8ff"); but it didn't work either.

The structure is: state / area / area_01 / area_loja

java – Retrieves all data under the node in the Firebase real-time database

I have a real-time Firebase database and I want to use the data to make a ranking. I'm trying to get all the data in my Scores node, but I'm not sure how to go through it to get all users' scores.

The database structure is as follows:
Enter image description here

The code I tried is the following:

package com.example.securityapp;

import androidx.appcompat.app.AppCompatActivity;

import android.nfc.Tag;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.Query;
import com.google.firebase.database.ValueEventListener;

import static java.lang.System.in;

public class leaderboard extends AppCompatActivity {

    DatabaseReference databaseUsers;
    FirebaseDatabase database = FirebaseDatabase.getInstance();
    FirebaseAuth mAuth;
    TextView score;
    private static final String TAG = "leaderboard";



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_leaderboard);

        databaseUsers = database.getReference().child("Scores");
        mAuth = FirebaseAuth.getInstance();
        FirebaseUser user = mAuth.getCurrentUser();
        score = (TextView) findViewById(R.id.leaderboard_score);


        databaseUsers.child("Scores").addValueEventListener(new ValueEventListener() {
            public void onDataChange(DataSnapshot dataSnapshot) {
                for (DataSnapshot snapshot : dataSnapshot.getChildren()) {
                        System.out.println("The scores are " + dataSnapshot.child("Points").getValue().toString());
                    }
                }


            @Override
            public void onCancelled(DatabaseError databaseError) {
             // Getting Post failed, log a message
             Log.w(TAG, "loadPost:onCancelled", databaseError.toException());

    }


});

        }
}

json – Search Delegate does not work with Firebase Flutter

I am trying to use a search delegate in my Flatter app, but if you run it and write something on the bar, it will only load and show no results in the "Participants" list. Here is the code of the button that appears on the screen:

        Widget _botonBusqueda() {
      return FloatingActionButton(
        heroTag: "buscar",
        child: Icon(Icons.search),
        onPressed: (){
          showSearch(context: context, 
            delegate: DataSearch(),
          );
        },
      );
    }

And here is the code within the search delegate:

    import 'package:flutter/material.dart';
    import 'package:timing_ready/src/models/evento_model.dart';
    import 'package:timing_ready/src/providers/eventos_provider.dart';

    class DataSearch extends SearchDelegate{

    final eventosProvider = EventosProvider();
    EventoModel evento =  EventoModel();
    Participantes participantes =  Participantes();

      @override
      List buildActions(BuildContext context) {
        // Acciones del AppBar
        return (
          IconButton(
            icon: Icon(Icons.clear),
            onPressed: () {
              query = " ";
            },
          )
        );
      }

      @override
      Widget buildLeading(BuildContext context) {
        // Icono a la izquierda del AppBar
        return IconButton(
          icon: AnimatedIcon(
            icon: AnimatedIcons.menu_arrow,
            progress: transitionAnimation,
          ),
          onPressed: () {
            close(context, null);
          },
        );
      }

      @override
      Widget buildResults(BuildContext context) {
        // Builder de los resultados
        return Container();
      }

      @override
      Widget buildSuggestions(BuildContext context) {
        // Sugerencias al escribir
        if ( query.isEmpty ) {
          return Container();
        }

        return FutureBuilder>(
          future: eventosProvider.buscarParticipantes(evento, participantes),
          builder: (BuildContext context, AsyncSnapshot snapshot) {
            if (snapshot.hasData) {
              final participantes = snapshot.data;
              return ListView.builder(
                itemCount: participantes.length,
                itemBuilder: (context, i) { 
                  return _crearParticipante(context, participantes(i));
                }
              );
            } else {
              return Center(
                child: CircularProgressIndicator(),
              );
            }
          },
        );
      }
      Widget _crearParticipante(BuildContext context, Participantes participantes) {
        return ListTile(
          title: Text('${participantes.apellido}',
            textAlign: TextAlign.left,
            softWrap: true,
            style: TextStyle(
              color: Colors.black,
              fontFamily: "Lato_LightItalic",
              fontStyle: FontStyle.italic,
              fontSize: 18.0,
              fontWeight: FontWeight.w300
            ),
          ),
          subtitle: Text('Numero: ${ participantes.numero }',
            style: TextStyle(
              color: Colors.black,
              fontFamily: "Lato_LightItalic",
              fontStyle: FontStyle.italic,
              fontSize: 16.0,
              fontWeight: FontWeight.w300
            ),
          ),
        );
      }

    }

The future of the "search for participants" looks like this:

         Future> buscarParticipantes( EventoModel evento, Participantes participantes ) async {

        final url = "$_url/eventos/${ evento.id }/participantes.json";
        final resp = await http.get(url);
        final respBody = json.decode(resp.body) as List;
        final participantes = respBody;
        return participantes;

      }

If I load the participant list on the previous page but it doesn't work, this data is billed by a Firebase database, which it sends to me in a JSON file

My Android application saves the data in Firebase with the alphabet when I download it from the Play Store and from the PC when it is saved normally?

I have all of my well-named objects, but if I only save them, they will be shown.
Even if I install it from the PC, it saves everything well, but if I do it when downloading from the Play Store, it only saves me.

Thanks for your comment. I hope you are very specific, or you are sharing me as I communicate with you to solve this problem.

to: "https: //lh6.googleusercontent.com/-I6ASJfOfZlQ / …"
b: DJ1558

firebase – Android Can't find the FirebaseInitProvider class

When I add Firebase authentication and database to my project, the following problem occurs:

FATAL EXCEPTION: main Process: com.myapp, PID: 4024 java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList((zip file "/data/app/com.myapp-NTr4rdWkzRUXkEy5dItLzQ==/base.apk"),nativeLibraryDirectories=(/data/app/com.myapp-NTr4rdWkzRUXkEy5dItLzQ==/lib/arm64, /system/lib64, /system/vendor/lib64))

And so the app closes, I searched the internet and found that it might be Multidex, but I tried to add Multidex and the following error occurred:

FATAL EXCEPTION: main Process: com.myapp, PID: java.lang.ClassNotFoundException: Didn't find class ".MyApplication" on path: DexPathList((zip file "/data/app/com.myapp-NTr4rdWkzRUXkEy5dItLzQ==/base.apk"),nativeLibraryDirectories=(/data/app/com.myapp-NTr4rdWkzRUXkEy5dItLzQ==/lib/arm64, /system/lib64, /system/vendor/lib64))

This is my gradle file:

apply plugin: 'com.android.application'

android {
compileSdkVersion 29

defaultConfig {
    applicationId "com.x.xx"
    minSdkVersion 16
    targetSdkVersion 29
    versionCode 1
    versionName "1.0.0"
    multiDexEnabled true
  }
  buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'            
    }
}
}

dependencies {
compile 'com.google.firebase:firebase-auth:+'
compile 'com.google.firebase:firebase-database:+'
compile fileTree(dir: 'libs', include: ('*.jar'))
compile 'androidx.multidex:multidex:2.0.0+'
compile 'androidx.appcompat:appcompat:1.0.0'
compile 'androidx.legacy:legacy-support-v4:1.0.0'
compile 'com.google.android.material:material:1.0.0-rc01'
compile 'androidx.cardview:cardview:1.0.0'
}

As stated in some forums, the app must include the MyApplication class

public class MyApplication extends Application { 
protected void attachBaseContext(Context base) { 
super.attachBaseContext(base);
MultiDex.install(this); 
 } 
  }

And in the application tag

android: name = "MyApplication"

Any solution?

Java – Receive notification when the Firebase node is updated

I have 2 apps, a customer booking app and an admin recipient app. They are both connected to the same Firebase database. When a customer makes a booking, I can view this in my admin app. But how can I get a notification in the admin app as soon as a booking is made in the customer app?

I found this code, but how do I view the notification even if the admin app isn't open?

 Uri notificationSoundURI = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
    NotificationCompat.Builder mNotificationBuilder = new NotificationCompat.Builder(this)
            .setSmallIcon(R.mipmap.ic_launcher)
            .setContentTitle(subject)
            .setContentText(object.getString("body"))
            .setAutoCancel(true)
            .setSound(notificationSoundURI)
            .setContentIntent(resultIntent);

    NotificationManager notificationManager =
            (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

    notificationManager.notify(0, mNotificationBuilder.build());

    ToneGenerator toneG = new ToneGenerator(AudioManager.STREAM_ALARM, ToneGenerator.MAX_VOLUME);
    toneG.startTone(ToneGenerator.TONE_CDMA_HIGH_L, 3000);
    ((Vibrator)getSystemService(VIBRATOR_SERVICE)).vibrate(2000);

javascript – How do I check if a coordinate is in an area with firebase firestore ionic angle google maps?

I am looking for my getCollection function to return events in my area with a radius of 15 km depending on my location. Without the need to consult all events without limit and then to guide them through the function of the Google Maps filter code according to the placed coordinates

    first(latitud: string, longitud: string) {

  this.filteredMarkers = ();
  this.eventosFiltrados = ();
  this.markers = ();

  this._data = new BehaviorSubject(());
  this.data = this._data.asObservable();

  // LLamada a la coleccion y traida de eventos por filtros
  this.getCollection('event_register', ref => ref
    .orderBy('final_date', 'asc')
    .where('final_date', '>=', this.hoy)
    .limit(10))
    .subscribe( async (data) => {

      // 10 Eventos traidos de la base de datos
      console.log('eventos servicios', data);

      await this.mapsAPILoader.load().then( async () => {
      const center = new google.maps.LatLng(latitud, longitud); // Coordenadas del centro de mi ubicacion
      // Guarda en FilteredMarkers los eventos dentro de un rango de 15km a la redonda
      this.filteredMarkers = data.filter(m => {
        // Coordenadas de la ubicacion del evento
        const markerLoc = new google.maps.LatLng(m.latitud, m.longitud);
        // Saca la distancia que hay entre el evento y el centro
        const distanceInKm = google.maps.geometry.spherical.computeDistanceBetween(markerLoc, center) / 1000;
        if (distanceInKm < 15.0) {
          // Regresa los eventos que estan dentro de un rango de 15km de mi centro
          return m;
          }
      });
      });

      // Arreglo con los eventos dentro del area seleccionada
      this._data.next(this.filteredMarkers);

      if (data.length > 0) {
        this.latestEntry = data(data.length - 1);
      }

    });

  }

android studio – Firebase: restore a father with only one of his children

I have a BD Firebase with the following structure:

Enter image description here

In the branch empresa I have a key for every company and I have a branch in each one tiendas With a key for every business.

So far everything works fine for me and I can create, delete and change both companies and branches.

What I need now is to be able to: a DataSnapShot from a empresa with one tienda,

One way to do this is to regain the company with all of its businesses and then go on the tour DataSnapShot Until you find the store. But what I want to do is that DataSnapShot only from the company and with the business that interests me to know the key of the company and the business in advance.

Is it possible to do it?