Upload a Firebase Token to Hurree

Open MyFirebaseInstanceIDService and add following lines of code, substituting the appropriate placeholder strings with the real keys and values for your application.

public class MyFirebaseInstanceIDService extends FirebaseInstanceIdService {

    private static final String TAG = MyFirebaseInstanceIDService.class.getSimpleName();
    private MyFirebaseInstanceIDService myFirebaseInstanceIDService = this;

    public void onTokenRefresh() {

        String refreshedToken = FirebaseInstanceId.getInstance().getToken();

        // Sending Reg ID to your server

    private void sendRegistrationToServer(final String token){
                // Your android app key - get this from your Hurree App Group - Android App Settings
                "YOUR APP KEY",
                // Your hurree app group key - get this from your Hurree app group settings
                "YOUR APP GROUP KEY",
                // This is a unique identifier for the user.
                // The token passed to this method
                // The timer value in minutes

        // This is an implicit login call example - this can be moved to explicit login functionality elsewhere
        // See an example of this in the provided sample application.
                "IMAGE URL",
        Analytics.getInstance(this).sendLoginDetails(new CallBack() {
             public void onSuccess(String response) {
                 // Action on Success

             public void onFailure(String error) {
                // Action on Fail


Create a MyFirebaseMessagingService service to handle FCM messages sent from the Hurree server.

  1. From Android Studio, open your project.
  2. Go to File > New > Service > Service. FCM message received service

results matching ""

    No results matching ""