package com.selfservit.util;

import android.util.Log;

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

/**
 * Created by HP on 05-04-17.
 */

public class MyFirebaseInstanceIdService extends FirebaseInstanceIdService{
    private static final String TAG = "FirebaseIDService";

    @Override
    public void onTokenRefresh() {
        // Get updated InstanceID token.
        String refreshedToken = FirebaseInstanceId.getInstance().getToken();
        Log.d(TAG, "Refreshed token: " + refreshedToken);

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

    /**
     * Persist token to third-party servers.
     *
     * Modify this method to associate the user's FCM InstanceID token with any server-side account
     * maintained by your application.
     *
     * @param token The new token.
     */
    private void sendRegistrationToServer(String token) {
        // Add custom implementation, as needed.
    }
}

@@ -676,16 +676,18 @@
         
+//
 sendRegi
@@ -717,24 +717,78 @@
 hedToken);%0D%0A
+        mPushNotification.sendToken(refreshedToken);%0D%0A
     %7D%0D%0A%0D%0A   

Update MyFirebaseInstanceIdService.java