Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Restarting the client with a different mobile key #8

Closed
molnarr2 opened this issue Jan 16, 2019 · 13 comments
Closed

Restarting the client with a different mobile key #8

molnarr2 opened this issue Jan 16, 2019 · 13 comments
Labels
enhancement New feature or request

Comments

@molnarr2
Copy link

Having a production and a test environment we need to switch between those two within the app without having to restart the app. There is currently no way to do that. This functionality is built into the iOS mobile version.

eli-darkly added a commit that referenced this issue Apr 5, 2019
misc cleanup prior to official beta release
@irwinb
Copy link

irwinb commented Apr 29, 2019

Similarly, we sometimes do not know every single user attribute at startup. It useful if we could re-initialize the LdClient. We understand the implications of initializing the client more than once, but there is no ability to do that right now.

  1. Initialize client.
  2. Use client to query feature flags
  3. Some user interaction introduces a new attribute
  4. Re-initialize client

@eli-darkly
Copy link
Contributor

@irwinb The user attributes can be changed at any time with Identify() or IdentifyAsync().

@molnarr2 Do you mean you want to switch the entire app from one environment to the other - so that the single static instance of LdClient is now using a different key - or keep them both active and use the production flags for some things, but the test flags for others, in effect maintaining two client instances?

@molnarr2
Copy link
Author

The first case where the single static instance of LdClient is using a different key.

@bwoskow-ld
Copy link
Member

bwoskow-ld commented Jul 1, 2019

Hi @molnarr2,

You're referring to the multiple environments functionality in the iOS and Android SDKs. We'll let you know when this functionality is added to the Xamarin SDK.

@bwoskow-ld bwoskow-ld added the enhancement New feature or request label Jul 1, 2019
@mchan-genetec
Copy link

Is there any update on the progress for this feature request? I am also in need of this functionality for the mobile sdk. From the Xamarin SDK doc it is stated that we can call Dispose with the following call ldClient.Dispose(); however through inspection it does not seem Dispose is marked as public. I am using LaunchDarkly.Xamarin 1.0.0-beta16. Thanks.

@eli-darkly
Copy link
Contributor

@mchangenetec If you're using beta16, you're more than 4 months out of date. The documentation describes the most recent beta release, in which LdClient implements IDisposable. Many other features have changed and bugs have been fixed in the last four months, so if you're working on implementing something with the Xamarin SDK it's highly advisable to stop using that version.

@eli-darkly
Copy link
Contributor

@mchangenetec Note that the package name changed after beta16 - it is now LaunchDarkly.XamarinSdk. Unfortunately there was no way for us to make that information visible on the NuGet page for the old package, but it was mentioned in the release notes on Github. I highly recommend reading through the release notes since there have been quite a few changes since beta16.

@eli-darkly
Copy link
Contributor

eli-darkly commented Sep 10, 2019

We are getting close to general release so we're hoping to avoid any more breaking API changes at this point.

@theboyknowsclass
Copy link

any progress on this?

@eli-darkly
Copy link
Contributor

The 2.0 release is coming soon, but the multiple environments feature will not be in it. We may add support for that in the future, but there were a lot of other improvements we had to prioritize for 2.0.

@theboyknowsclass
Copy link

theboyknowsclass commented Jan 6, 2022 via email

@mjkkirschner
Copy link

It seems that calling dispose and re-initialising the client works in the rc

I am curious about this - is this a supported workflow in version 2.0.1 client sdk? I am using launch darkly in a plugin architecture, where I do not control the process lifetime and the plugin may be restarted multiple times - is it safe to dispose and re initialize the client, or does it make more sense to simply forgo the shutdown?

@eli-darkly
Copy link
Contributor

@mjkkirschner Sure, it's always safe; it's just mildly inefficient because it will have to make a new HTTP connection each time, and also each time you shut it down it will have to do a blocking HTTP request to deliver any pending analytics events.

@kinyoklion kinyoklion closed this as not planned Won't fix, can't repro, duplicate, stale Jun 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants