corodva cannot find symbol import com.google.firebase.iid.FirebaseInstanceIdService; code example

Example: cordova cannot find symbol import com.google.firebase.iid.FirebaseMessagingService;

// override the file:
// platforms/android/app/src/main/java/com/adobe/phonegap/push/PushInstanceIDListenerService.java
// by this content
package com.adobe.phonegap.push;

import android.content.Intent;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;

import com.google.firebase.iid.FirebaseInstanceId;
import com.google.firebase.messaging.FirebaseMessagingService;

import org.json.JSONException;

import java.io.IOException;

public class PushInstanceIDListenerService extends FirebaseMessagingService implements PushConstants {
    public static final String LOG_TAG = "Push_InsIdService";

    @Override
    public void onNewToken(String token) {
        // Get updated InstanceID token.
        String refreshedToken = FirebaseInstanceId.getInstance().getToken();
        Log.d(LOG_TAG, "Refreshed token: " + refreshedToken);
        // TODO: Implement this method to send any registration to your app's servers.
        //sendRegistrationToServer(refreshedToken);
    }
}

Tags:

Java Example