Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FirebaseOptions options = new FirebaseOptions.Builder()
- .setServiceAccount(getServletContext().getResourceAsStream("/WEB-INF/xxx.json"))
- .setDatabaseUrl("https://xxx.firebaseio.com")
- .build();
- FirebaseApp.initializeApp(options);
- DatabaseReference ref = FirebaseDatabase
- .getInstance()
- .getReference();
- ref.child("users").setValue("aaa");
- var config = {
- apiKey: "xxx",
- authDomain: "xxx.firebaseapp.com",
- databaseURL: "https://xxx.firebaseio.com",
- storageBucket: "xxx",
- messagingSenderId: "xxx"
- };
- firebase.initializeApp(config);
- var database = firebase.database();
- var myRef = firebase.database().ref("users");
- myRef.on('value', function(snapshot) {
- alert(5);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement