Closed fumito-ito closed 3 years ago
I found a few problems with this issue:
There’s this issue indeed. I’ve faced it myself, and I think I’ll look into it.
@fumito-ito As a quick fix, you can determine message type by type-casting the messageForDisplay
instance, like that:
switch messageForDisplay {
case let bannerMessage as InAppMessagingBannerDisplay:
print(bannerMessage)
case let cardMessage as InAppMessagingCardDisplay:
print(cardMessage)
case let imageOnlyMessage as InAppMessagingImageOnlyDisplay:
print(imageOnlyMessage)
case let modalMessage as InAppMessagingModalDisplay:
print(modalMessage)
default:
break
}
In fact, that’s the way message type is determined in the original implementation of IAM.
This is a one-liner fix that will go out with the next release.
Bug is here.
Thanks for the report @fumito-ito.
[REQUIRED] Step 1: Describe your environment
Carthage
[REQUIRED] Step 2: Describe the problem
ImageOnly message shows incorrect message type. It may be a bug of parsing passing data.
Steps to reproduce:
Image Only
message at Firebase ConsoleRelevant Code: