Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undocumented API change in V5 #248

Open
Titozzz opened this issue Sep 11, 2024 · 3 comments
Open

Undocumented API change in V5 #248

Titozzz opened this issue Sep 11, 2024 · 3 comments

Comments

@Titozzz
Copy link
Contributor

Titozzz commented Sep 11, 2024

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 🤗

@uerceg
Copy link
Contributor

uerceg commented Sep 11, 2024

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?

@Titozzz
Copy link
Contributor Author

Titozzz commented Sep 11, 2024

I'm honestly fine with both.

@AuroPick
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants