summaryrefslogtreecommitdiff
path: root/StoneIsland/plugins/cordova-plugin-firebasex/src/android/FirebasePluginMessageReceiver.java
blob: 1bb76d089197615824e62c5b4891d640f60e2d53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package org.apache.cordova.firebase;

import android.os.Bundle;

import com.google.firebase.messaging.RemoteMessage;

public abstract class FirebasePluginMessageReceiver {

    public FirebasePluginMessageReceiver() {
        FirebasePluginMessageReceiverManager.register(this);
    }

    /**
     * Concrete subclasses should override this and return true if they handle the received message.
     *
     * @param remoteMessage
     * @return true if the received message was handled by the receiver so should not be handled by FirebasePluginMessagingService.onMessageReceived()
     */
    public abstract boolean onMessageReceived(RemoteMessage remoteMessage);

    /**
     * Concrete subclasses should override this and return true if they handle the message bundle before it's sent to FirebasePlugin.sendMessage().
     *
     * @param bundle
     * @return true if the received bundle was handled by the receiver so should not be handled by FirebasePlugin.
     */
    public abstract boolean sendMessage(Bundle bundle);
}