Leanplum / Leanplum-Android-SDK

Leanplum's integrated solution delivers meaningful engagement across messaging and the in-app experience.
https://www.leanplum.com
Apache License 2.0
46 stars 40 forks source link

Improve MessageTemplates public methods #426

Closed hborisoff closed 4 years ago

hborisoff commented 4 years ago
What Where/Who
JIRA Issue SDK-166
People Involved @hborisoff

Implementation

Adding MessageTemplate interface and MessageTemplates.register(MessageTemplate) method for clients to easier implement and register their own messages.

When MessageTemplate is registered there is a check if it contains ActionArg of type file, because in that case we should wait for variables and files to become ready before showing the message. Only for the RichHtmlMessage there is a corner case because it depends on an html template file, which is not added to the ActionArgs, thus we need to wait for variables and files explicitly.