mParticle / mparticle-apple-sdk

mParticle Apple SDK
Apache License 2.0
45 stars 66 forks source link

feat: Switch workspaces without restarting app #258

Closed einsteinx2 closed 6 months ago

einsteinx2 commented 6 months ago

Summary

This new feature enables customers to switch to a new workspace while the app is running. It works by uploading any waiting events, completely resetting the internal data/state of the SDK, stopping/uninitializing any kits that support that (none do yet, but the logic is there to handle it), removing any kits that don't support reinitialization to prevent events forwarding to the wrong accounts, removing all sideloaded kits as new instances will be passed in again via the new MParticleOptions object, and then starts the SDK up fresh using the new API key.

NOTE: A change was made to MPKitProtocol to rename deinit to stop to prevent conflicts with Swift since it uses deinit rather than dealloc to deinitialize classes. No kits were using the deinit method in the protocol, so while this is technically a public API breaking change, it should have zero impact.

Testing Plan

mparticle-automation commented 6 months ago

:tada: This PR is included in version 8.20.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: