mixpanel-flutter icon indicating copy to clipboard operation
mixpanel-flutter copied to clipboard

[iOS] Using the 'reset' method is opting out the user

Open toussam opened this issue 1 year ago • 0 comments

Hi 👋

First thing first, thank you for your work and maintaining this package.

We're currently using the '2.2.0' version of this last one and noticed an issue on the iOS platform with the 'reset' method that we are using, as suggested into the documentation, during the user's logout.

The issue is that if the user was opt-in then logging her / him out (aka using the 'reset' method & Co), killing the application and launching it back will lead the user to be opt-out. Please notice that killing the application and launching it back is important! Indeed, before doing so (aka post logout), the tracking is still working properly on the "non signed" pages.

To prevent such behavior, we did a temporary fix which is opting-in back the user (only if she / he was obv.) after using the 'reset' method. Doing so is making things work as expected aka user still being opt-in even after killing and launching back the app.

Here is a list of the package's methods ordered by their execution time to reproduce the issue in a simplified way:

  • init
  • optional: registerSuperProperties
  • optional: setServerURL
  • optInTracking
  • identify
  • optional: getPeople + set
  • hasOptedOutTracking (to check the returned value - should be false)
  • reset
  • optional: registerSuperProperties
  • (kill the app and launch it back)
  • hasOptedOutTracking (to check the returned value - should be false too, but will be true if you reproduce the issue)

* optional methods are being listed to be fully transparent about our current implementation, but we don't think that they may have any impact on the described issue.

We are aware that the package is mostly a wrapper of the native SDK, but we felt like it was best to create a ticket into this repository. Let us know if you need any other information to reproduce the said issue.

Thanks in advance for everything 🙏

toussam avatar Jan 09 '24 13:01 toussam