We provide AppcuesExperienceDelegate to allow apps visibility into when the presentation lifecycle of Appcues experiences. This protocol was designed before embeds (and therefore multiple render contexts) and so is no longer particularly useful for an app with multiple embed frames in addition to modals/tooltips.
Change
I've created AppcuesPresentationDelegate that contains the same functions, but with a metadata: AppcuesPresentationMetadata value that provides id, name, and renderContext ("modal" or $frameName) to provide more clarity into what experience is triggering the presentation lifecycle methods.
Frame delegate
I've also added presentationDelegate as a property on AppcuesFrameView. It functions exactly the same way, but is scoped to only experiences rendering in the specific frame. This doesn't really provide any new functionality since the metadata["renderContext"] from the global Appcues.presentationDelegate would allow you to filter, but it creates a better developer experience because each frame view can have its own delegate logic that can be implemented close to the UI code for the frame itself instead of once globally.
Notes
For the sake of backwards compatibility, AppcuesExperienceDelegate remains untouched, so AppcuesPresentationDelegate is solely additive. We can remove AppcuesExperienceDelegate in SDK v4 if we so choose. I've updated the docs to indicate using presentationDelegate is to be preferred over experienceDelegate.
Having AppcuesPresentationDelegate be objc compatible creates some limitations, so AppcuesPresentationMetadata has to be a class instead of the struct which would be preferred.
AppcuesPresentationMetadata can be enhanced in the future with additional values if we see a need. Note that removing/renaming a value would be a breaking change.
Background
We provide
AppcuesExperienceDelegate
to allow apps visibility into when the presentation lifecycle of Appcues experiences. This protocol was designed before embeds (and therefore multiple render contexts) and so is no longer particularly useful for an app with multiple embed frames in addition to modals/tooltips.Change
I've created
AppcuesPresentationDelegate
that contains the same functions, but with ametadata: AppcuesPresentationMetadata
value that providesid
,name
, andrenderContext
("modal" or $frameName
) to provide more clarity into what experience is triggering the presentation lifecycle methods.Frame delegate
I've also added
presentationDelegate
as a property onAppcuesFrameView
. It functions exactly the same way, but is scoped to only experiences rendering in the specific frame. This doesn't really provide any new functionality since themetadata["renderContext"]
from the globalAppcues.presentationDelegate
would allow you to filter, but it creates a better developer experience because each frame view can have its own delegate logic that can be implemented close to the UI code for the frame itself instead of once globally.Notes
AppcuesExperienceDelegate
remains untouched, soAppcuesPresentationDelegate
is solely additive. We can removeAppcuesExperienceDelegate
in SDK v4 if we so choose. I've updated the docs to indicate usingpresentationDelegate
is to be preferred overexperienceDelegate
.AppcuesPresentationDelegate
be objc compatible creates some limitations, soAppcuesPresentationMetadata
has to be a class instead of the struct which would be preferred.AppcuesPresentationMetadata
can be enhanced in the future with additional values if we see a need. Note that removing/renaming a value would be a breaking change.