Skip to content

Undocumented API change in V5 #248

Open

Description

@Titozzz

01b0649 breaks the expectation that the callback will be called (with undefined or more) so it's an undocumented breaking API change.

Example code that this change breaks:

  const updateValues = useCallback(() => {
    Adjust.getAdid((id) => {
      setAdid(id ?? '');
    });
    Adjust.getIdfa((id) => {
      setIdfa(id ?? '');
    });
    Adjust.getGoogleAdId((id) => {
      setGpsAdid(id ?? '');
    });
  }, []);

  useEffect(() => {
    updateValues();
  }, [updateValues]);
.....
  if (adid === undefined || gpsAdid === undefined || idfa === undefined) {
    return null;
  }
....
 return meaningful content

Not asking for revert of anything but please be mindful of changes and document them 🤗

Activity

  1. uerceg commented on Sep 11, 2024

    @uerceg
    Contributor

    Hey @Titozzz,

    Thank you for the feedback and definitely a valid point. 👍

    When it comes to platform specific methods (including the getters you have mentioned), with v5 we have also made them to run only on the platform they semantically belong to. But yes, we will document in the migration guide that iOS platform specific getters will no longer return anything if invoked from Android platform and vice versa.

    Maybe also a question for you: Do you see any value in getting undefined or some invalid value when invoking iOS getters from Android platform or does having the platform specific execution sound better?

  2. Titozzz commented on Sep 11, 2024

    @Titozzz
    ContributorAuthor

    I'm honestly fine with both.

  3. AuroPick commented on Oct 18, 2024

    @AuroPick

    Yes this should be documented. I was using requestTrackingAuthorizationWithCompletionHandler without platform checking. I was continuing app init in handler method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions