package com.jcf.sportpager;

import android.util.Log;

import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.iid.FirebaseInstanceIdService;

/**
 * Created by jon on 11/07/2016.
 */
public class MyFirebaseInstanceIdService extends FirebaseInstanceIdService
{
    private final static String TAG = "MyFBInstanceIdService";

    @Override
    public void onTokenRefresh()
    {
        // Get updated InstanceID token.
        String refreshedToken = FirebaseInstanceId.getInstance().getToken();
        if(refreshedToken != null)
        {
            Log.d(TAG, "Refreshed token: " + refreshedToken);
            Aplicacion.DispositivoID(refreshedToken);
        }
        else
        {
            Log.d(TAG, "Refreshed token: NO GENERADO AUN");
        }

        // TODO: Implement this method to send any registration to your app's servers.
        //sendRegistrationToServer(refreshedToken);
    }

    public static String getFBToken()
    {
        return FirebaseInstanceId.getInstance().getToken();
    }
}
