chore(flags): use new `/flags` endpoint instead of `/decide`
:bulb: Motivation and Context
Update the iOS SDK to use the new /flags endpoint instead of the legacy /decide one.
@ioannisj can you review it? Also, I'd debug https://github.com/PostHog/posthog-ios/issues/344 first since its a different endpoint now (and likely easier to reproduce if there's a bug)
@dmarticus Getting a 400 Bad Request - Failed to decode request: unsupported content type: application/json; charset=utf-8. Please check your request format and try again. when testing on a demo project.
Other than this and reverting the commit from ./scripts/prepare-release.sh that @marandaneto mentioned, LG to me. I don't see any other logic other than changing the endpoint affected
@ioannisj I fixed the issue with https://github.com/PostHog/posthog/pull/31798, can you give it a try on your side again?
@ioannisj I fixed the issue with https://github.com/PostHog/posthog/pull/31798, can you give it a try on your side again?
Yeah getting a response now.
We need to think how sessionRecording should be handled though cause we depend on that on /decide endpoint (talked about this privately already)
similar to https://github.com/PostHog/posthog-android/pull/245#issuecomment-2893824253 but here https://github.com/PostHog/posthog-ios/blob/479ce5ba9ce899dfe969dea7c88cd110adb800e7/PostHog/PostHogRemoteConfig.swift#L187C18-L187C35 and probably more places, @ioannisj would know more
@ioannisj with this commit ce2f2ac (#345) I've added support for all of the /decide fields to the /flags endpoint, how does this look to you?