I'm not sure if this bug lies with Snapchat, SwiftKey, or Facebook, but for the last few months, if I have any open floating chat heads from Facebook Messenger and SwiftKey is selected as my keyboard when I open a chat, the entire screen flickers rapidly. If I select the default Google keyboard as my input, it does not occur. If I swipe away all open Facebook messenger floating chat heads, it does not occur. The behavior also does not occur in any other applications, or in any other functionality of Snapchat except for chat (taking pictures/video, watching stories are all fine). The only workaround I've discovered via searching online is to enable the "Disable HW overlays" setting in Developer Options for my phone, which unfortunately does not persist across device reboots.
I have opened concurrent cases with Snapchat, SwiftKey, and Facebook Messenger all with the same details, since this behavior only occurs with the specific interactions of these 3 apps.