[go: nahoru, domu]

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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[upload_app_privacy_details_to_app_store] fix error when Info.plist contains NSUserTrackingUsageDescription #20695

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rogerluan
Copy link
Member
@rogerluan rogerluan commented Sep 25, 2022

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I see several green ci/circleci builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

Resolves #17895
Resolves #19487
Resolves #19781

Description

The problem was well described in the associated tickets, but basically: Apple does server side validation when attempting to delete ADVERTISING_DATA and the app's Info.plist contains NSUserTrackingUsageDescription 馃槵 So we can't delete it.

Design Decisions

I thought of adding an option like this:

FastlaneCore::ConfigItem.new(key: :skip_advertising_data_deletion_if_missing,
                             env_name: "UPLOAD_APP_PRIVACY_DETAILS_TO_APP_STORE_SKIP_DELETION_ADVERTISING_DATA",
                             description: "Used to skip the deletion of the advertising data app privacy settings when such setting is present in App Store Connect, but not locally. It should rarely be used",
                             type: Boolean,
                             default_value: false),

But I ended up realizing that it probably would be too useful. People changing these configs are not something common, specially the advertisement one, probably. So when they do, it's a one-off, so they can do it manually via App Store Connect (like I explained in the UI.important messages - please review them 馃 )

Fun Facts

When the data is something like:

{
    "category": "ADVERTISING_DATA",
    "purposes": [
        "THIRD_PARTY_ADVERTISING"
    ],
    "data_protections": [
        "DATA_NOT_LINKED_TO_YOU",
        "DATA_USED_TO_TRACK_YOU"
    ]
}

The API returns 2 elements for ADVERTISING_DATA (DATA_NOT_LINKED_TO_YOU and DATA_USED_TO_TRACK_YOU). If you attempt to delete each of them, both will fail (HTTP 409):

{
  "errors": [
    {
      "id": "b47e8827-0e75-4a1c-ace8-b4f27b9d37e0",
      "status": "409",
      "code": "STATE_ERROR.BINARY_INDICATES_APP_TRACKS_USERS",
      "title": "Your binary indicates that your app tracks users.",
      "detail": "Your app indicates that you track users."
    }
  ]
}

However, the DATA_NOT_LINKED_TO_YOU actually gets deleted although it errors out, whereas the DATA_USED_TO_TRACK_YOU really can't be deleted. 馃し馃し馃し

Testing Steps

To test this branch, modify your Gemfile as:

gem 'fastlane', git: 'https://github.com/fastlane/fastlane.git', branch: 'rogerluan-fix-upload-app-privacy-details-when-tracking-advertising-data'

And run bundle install to apply the changes.

Tagging people who were having issues with this:

Perhaps someone could help me triple check if my fix is alright? 馃檱

@mikebarlow
Copy link

Hey, I'm a colleague of @gavrichards and just tested this.
It did indeed stop us from getting this error message.

Your binary indicates that your app tracks users. - Your app indicates that you track users.

And instead I got this:

[fastlane] [12:37:26]: Looks like you're attempting to make changes to your ADVERTISING_DATA app privacy details.
[fastlane] [12:37:26]: Please make this change manually via App Store Connect. Since this is a one-off (and rare) situation, which the App Store Connect API doesn't really support, unfortunately this is the only solution for now.
[fastlane] [12:37:26]: Don't forget to download the app privacy details using the 'download_app_privacy_details_from_app_store' action when you're done, to update the local json.
[fastlane] [12:37:26]: App data usage is already published

I'm guessing the issue is Apples API not letting you do the things it we need it to do? After that though I was able to get the App submitted to Apple. Whether they approve remains to be seen!

Forewarning for other users though, I did get the following error to start with when using the fix.

[fastlane] [12:37:40]: The provided entity includes a relationship with an invalid value - You cannot create a new version of the App in the current state. - /data/relationships/app
[fastlane] The provided entity includes an attribute with a value that has already been used - The version number has been previously used. - /data/attributes/versionString

After investigating, it was simply because in previous build attempts it had already created this new version within the App Store before it failed on the "Your binary indicates that your app tracks users" error. After realising this I was able to just submit for review manually via App Store Connect.

@rogerluan
Copy link
Member Author
rogerluan commented Dec 27, 2022

@mikebarlow thanks for reporting back! Did you actually do what the message indicated you had to do, though?

Looks like you're attempting to make changes to your ADVERTISING_DATA app privacy details.
Please make this change manually via App Store Connect. Since this is a one-off (and rare) situation, which the App Store Connect API doesn't really support, unfortunately this is the only solution for now.
Don't forget to download the app privacy details using the 'download_app_privacy_details_from_app_store' action when you're done, to update the local json.

If you do that, you're only going to see that message once. Next time it won't happen anymore, and it'll just start working from then on.

@gavrichards
Copy link

We're still seeing this issue. Any chance of this PR being merged?

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