This is a tweak targeting #526 in its own PR for readability. I've made the swizzling automatic push config static on Appcues for a couple reasons:
Swizzling affects the whole app, not just the instance. So in the theoretical multiple Appcues instance app, it'd be very strange to suggest that you could automatically configure one instance but not the other.
A static config option better sets us up for x-plat success. More here, but since the x-plat libraries create the Appcues instance on-demand, that may be too late for the config necessary in didFinishLaunching.
The static observer list pattern I've added means that,
If an Appcues instance is created before the push auto config, then it's already in the observer list for when the swizzled methods start getting called, and
If the auto config is done, and then a new Appcues instant is created, the instance will add itself to the observer list and start receiving any push events from that point forward.
This is a tweak targeting #526 in its own PR for readability. I've made the swizzling automatic push config static on
Appcues
for a couple reasons:Appcues
instance on-demand, that may be too late for the config necessary indidFinishLaunching
.The static observer list pattern I've added means that,
Appcues
instance is created before the push auto config, then it's already in the observer list for when the swizzled methods start getting called, andAppcues
instant is created, the instance will add itself to the observer list and start receiving any push events from that point forward.