android - remoteMessage.getMessageType returns null in onMessageReceived -
public class firebasemessagingservice extends com.google.firebase.messaging.firebasemessagingservice{ string tag = "firebasemessagingservice"; @override public void onmessagereceived(remotemessage remotemessage){ log.i(tag," input string :"+ string.valueof(remotemessage.getdata())); /** * parse remote input , pass id, action, frequency , payload eventhandler. * **/ string messagetype = remotemessage.getmessagetype();// messagetype null if(messagetype.equalsignorecase("data")){ log.i(tag, " data notification received"); } else if(messagetype.equalsignorecase("notification")){ log.i(tag, " push notification received"); } }
i'm not sure getmessagetype()
supposed return. seem unlikely returns either data
or notification
, since a single message can contain both notification , data information.
Comments
Post a Comment