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

App-tracking authorization wrapper example has errors #109

Open
b099l3 opened this issue Jun 26, 2023 · 0 comments
Open

App-tracking authorization wrapper example has errors #109

b099l3 opened this issue Jun 26, 2023 · 0 comments

Comments

@b099l3
Copy link

b099l3 commented Jun 26, 2023

The Example here for App-tracking authorization wrapper has an error where the type num cant be used in the switch case, the error:

The type 'num' is not exhaustively matched by the switch cases since it doesn't match 'double()'.
Try adding a default case or cases that match 'double()'.

Suggested changes:

  1. (quick fix) Convert status to int in the example
if (Platform.isIOS) {
  Adjust.requestTrackingAuthorizationWithCompletionHandler().then((statusNum) {
    final status = statusNum.toInt();
    switch (status) {
      case 0:
        // ATTrackingManagerAuthorizationStatusNotDetermined case
        break;
      case 1:
        // ATTrackingManagerAuthorizationStatusRestricted case
        break;
      case 2:
        // ATTrackingManagerAuthorizationStatusDenied case
        break;
      case 3:
        // ATTrackingManagerAuthorizationStatusAuthorized case
        break;
    }
  });
}

OR

  1. (better fix) Let requestTrackingAuthorizationWithCompletionHandler return a double or int not a num
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

1 participant