i’m trying to implement the interface FIRMessagingDelegate like following:
FIRMessaging.messaging().setDelegate(new FIRMessagingDelegate() {
@Override
public void messagingDidRefreshRegistrationToken(FIRMessaging messaging, String fcmToken) {
Foundation.NSLog("New Token is %s" , fcmToken);
}
@Override
public void messagingDidReceiveMessage(FIRMessaging messaging, FIRMessagingRemoteMessage remoteMessage) {
}
});
and I’m getting the exception messaging:didRefreshRegistrationToken:]: unrecognized selector sent to instance 0x60800000f4b0
org.moe.natj.objc.ObjCException. This exception occurs only when i run the app for first time.
The following is the generated binding interface i need to implement and pass to “setDelegate” (which is looking weird)
@Generated
@Library("FirebaseMessaging")
@Runtime(ObjCRuntime.class)
@ObjCProtocolName("FIRMessagingDelegate")
public interface FIRMessagingDelegate {
@Generated
@IsOptional
@Deprecated
@Selector("applicationReceivedRemoteMessage:")
default void applicationReceivedRemoteMessage(
FIRMessagingRemoteMessage remoteMessage) {
throw new java.lang.UnsupportedOperationException();
}
@Generated
@IsOptional
@Selector("messaging:didReceiveMessage:")
default void messagingDidReceiveMessage(FIRMessaging messaging,
FIRMessagingRemoteMessage remoteMessage) {
throw new java.lang.UnsupportedOperationException();
}
@Generated
@Selector("messaging:didRefreshRegistrationToken:")
void messagingDidRefreshRegistrationToken(FIRMessaging messaging,
String fcmToken);
}
It is an interface for this protocol
Also I’m wondering why the plugin generates a body for interface method ?!
is this just for suppressing “optional” methods or something went wrong as a bug ?