Talking about Javascript.
Do you know Firebase? Firebase is a mobile platform that helps you quickly develop high-quality apps, grow your user base, and earn more money. Firebase is made up of complementary features that you can mix-and-match to fit your needs.![](/wp-content/uploads/2016/05/firebase.png)
![](/wp-content/uploads/2016/05/firebase01.png)
![](/wp-content/uploads/2016/05/firebase02.png)
![](/wp-content/uploads/2016/05/firebase03.png)
![](/wp-content/uploads/2016/05/firebase04.png)
![](/wp-content/uploads/2016/05/firebase05.png)
![](/wp-content/uploads/2016/05/firebase06.png)
![](/wp-content/uploads/2016/05/firebase07.png)
<html>
<head>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://www.gstatic.com/firebasejs/live/3.0/firebase.js"></script>
<script>
$(document).ready(function(){
var config = {
apiKey: "AIzaSyD4NczHDYCUHIeX8X-ZXxErwQZvdTLiflA",
authDomain: "test-c2cc1.firebaseapp.com",
databaseURL: "https://test-c2cc1.firebaseio.com",
storageBucket: "test-c2cc1.appspot.com",
};
firebase.initializeApp(config);
firebase.auth().onAuthStateChanged(function(user){
if(user){
var uid = user.uid
$("#message").html('user authenticated with uid ' + uid + ' - <a id = "signout" href = "#">sign out</a>')
}
else{
$("#message").html('user not authenticated - <a id = "authenticate" href = "#">authenticate</a>');
}
})
$(document).on("click", "#authenticate", function(){
firebase.auth().signInAnonymously();
});
$(document).on("click", "#signout", function(){
firebase.auth().signOut();
})
});
</script>
</head>
<body>
<div id = "message" style = "font: normal 20px Helvetica"></div>
</body>
</html>
firebase.initializeApp(config);
: creates and intializes a Firebase app. config
is an object with configuration options.
firebase.auth().signInAnonymously();
: asynchronously signs in as an anonymous user. If there is already an anonymous user signed in, that user will be returned; otherwise, a new anonymous user identity will be created and returned.
firebase.auth().signOut();
: signs out the current user.
firebase.auth().onAuthStateChanged(callback);
: adds a listener for auth state changes and executes callback function.
That’s all at the moment, next time I will show you how to integrate this features and more features in your games. Never miss an update! Subscribe, and I will bother you by email only when a new game or full source code comes out.