var request = require('request');
var sp = require('../scripts/sp');


var datos = {
				"data": {
				"score": "5x1",
				"time": "15:10"
				},

				"to" : "cyytAyfUj2A:APA91bFJKe1DUajyuisS_hDKQo1WlTGiEbTuW-9mLRbK8Iv9AfWheWevkefOV57-HBbEE89_C1SRWZY6S10L8gcv-z2PQz6AqaD7kpM4_j3OCaVfKiUabEHMLCVT74_fOIBsthykSG2A",
				//"to" : "ci4r0IRIiSk:APA91bEBi3rOW5D1Zo-I8Ybh9bEcQzXPbINtly6AHARzegQZU4i828asre35Q5SApYmnrHV41AmdtED-5CFlZ8WTQmC1-kIpYpukDb6w6T3WBYvtMWtXcTygZa9ccSGtlWlB52MH57_g",
				//"to" : "cmSmCTJPleo:APA91bF3jLxnb-vdMS95Z9DCmcDVBJS4FIQc8ENZx9HtQMvoWBNN4LyDDtngQylTxSe-16hD2BjBOsdpifGTWoovh7XP6WBI-K5tUUVXDuXr7JB3M09XttggVusuBHOLzaebQdS58J88",
				"notification" : {
					"body" : "body de la notificacion 12",
					"title" : "title de la notificacion 12",
					"icon" : "firebase_lockup_400"
					//"sound": 
				}
			};

var mensajeView = "Sin mensaje";			


// GET firebase/notificacion

exports.notificacion = function(req, res) {

	console.log("Entrando en exports.notificacion");
	sp.init();
	res.send("OK");

	/*
	var post_options = {
		url: 'https://fcm.googleapis.com/fcm/send',
		method: 'POST',
		json: true,
		headers: {
			'Content-Type': 'application/json',
			'Authorization': 'key=AIzaSyDSjS3_iWi7rwJdf4CxX0Kl4yC-mOD2Z4M',
		},
		body: datos
	};

	function callback(error, response, body) {

	  if (!error && response.statusCode == 200) { 
	   
		console.log("Notifications OK!: " + response.statusMessage + " " + JSON.stringify(body));

	  }
	  else {
		console.log("Falló notifications: " + error + " " + response + " " + JSON.stringify(body));
	  }

	  mensajeView = JSON.stringify(body);
	  res.render('firebase/notificacion', {mensaje: mensajeView});
	}

	request(post_options, callback);
	*/

	
}
