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

[fastlane] Delete IDFA declarations for Apple App Store submission #22003

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fr0l
Copy link

@fr0l fr0l commented May 2, 2024

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.
  • I've added or updated relevant unit tests.

Motivation and Context

Resolves #21998

Seems Seems that the IDFA-related APIs were deprecated in v1.5 by Apple and finally removed.

The Advertising Identifier (IDFA) Declarations resource and all its associated endpoints and objects are now deprecated, including: Create an IDFA Declaration, Modify an IDFA Declaration, Delete an IDFA Declaration, Read the IDFA Declaration Information of an App Store Version, IdfaDeclaration, IdfaDeclarationCreateRequest, IdfaDeclarationUpdateRequest, and IdfaDeclarationResponse.

The PR is just to delete the deprecated IDFA-related code.

the issue #21998 itself can be mitigated by:

  • a) setting add_id_info_uses_idfa to false
  • b) deleting add_id_info_uses_idfa from Deliverfile / call to deliver method

the PR is just code removal

Description

Testing Steps

@fr0l
Copy link
Author

fr0l commented May 2, 2024

Here is a diff between openapi.1.4.1.json and openapi.3.4.1.json

diff -u openapi.1.4.1.json openapi.3.4.1.json|colordiff|grep -i idfa

-                  "idfaDeclaration",
-                  "usesIdfa",
-                  "idfaDeclaration",
-            "description": "the fields to include for returned resources of type idfaDeclarations",
-            "name": "fields[idfaDeclarations]",
-                  "idfaDeclaration",
-                  "usesIdfa",
-                  "idfaDeclaration",
-                  "usesIdfa",
-    "/v1/appStoreVersions/{id}/idfaDeclaration": {
-        "operationId": "appStoreVersions-idfaDeclaration-get_to_one_related",
-            "description": "the fields to include for returned resources of type idfaDeclarations",
-            "name": "fields[idfaDeclarations]",
-                  "$ref": "#/components/schemas/IdfaDeclarationResponse"
-                  "idfaDeclaration",
-                  "usesIdfa",
-                  "idfaDeclaration",
-                  "usesIdfa",
-            "description": "the fields to include for returned resources of type idfaDeclarations",
-            "name": "fields[idfaDeclarations]",
-                  "idfaDeclaration",
-                  "usesIdfa",
-                  "idfaDeclaration",
-                  "idfaDeclaration",
-                  "usesIdfa",
-                  "idfaDeclaration",
-                  "usesIdfa",
-                  "idfaDeclaration",
-                  "usesIdfa",
-    "/v1/idfaDeclarations": {
-        "operationId": "idfaDeclarations-create_instance",
-                "$ref": "#/components/schemas/IdfaDeclarationCreateRequest"
-          "description": "IdfaDeclaration representation",
-                  "$ref": "#/components/schemas/IdfaDeclarationResponse"
-            "description": "Single IdfaDeclaration"
-          "IdfaDeclarations"
-    "/v1/idfaDeclarations/{id}": {
-        "operationId": "idfaDeclarations-delete_instance",
-          "IdfaDeclarations"
-        "operationId": "idfaDeclarations-update_instance",
-                "$ref": "#/components/schemas/IdfaDeclarationUpdateRequest"
-          "description": "IdfaDeclaration representation",
-                  "$ref": "#/components/schemas/IdfaDeclarationResponse"
-            "description": "Single IdfaDeclaration"
-          "IdfaDeclarations"
-              "usesIdfa": {
-              "idfaDeclaration": {
-                          "idfaDeclarations"
-                  "usesIdfa": {
-                  "$ref": "#/components/schemas/IdfaDeclaration"
-                  "usesIdfa": {
-                  "$ref": "#/components/schemas/IdfaDeclaration"
-      "IdfaDeclaration": {
-              "idfaDeclarations"
-        "title": "IdfaDeclaration",
-      "IdfaDeclarationCreateRequest": {
-                  "idfaDeclarations"
-        "title": "IdfaDeclarationCreateRequest",
-      "IdfaDeclarationResponse": {
-            "$ref": "#/components/schemas/IdfaDeclaration"
-        "title": "IdfaDeclarationResponse",
-      "IdfaDeclarationUpdateRequest": {
-                  "idfaDeclarations"
-        "title": "IdfaDeclarationUpdateRequest",

Copy link
Contributor

@AliSoftware AliSoftware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this!

I know you said it's still in progress, but from a quick skim of the diff and what was deleted and cleaned up, this looks good and very promising 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for remembering to also update the docs! 🙇

@AliSoftware
Copy link
Contributor

In case you don't have access to our CircleCI logs to see the test failure, here's the logs of rspec failing:

Failures:

  1) Deliver::SubmitForReview submit app submit fails needs to set export_compliance_uses_encryption
     Failure/Error:
       expect do
         review_submitter.submit!(options)
       end.to raise_error("boom")

       expected Exception with "boom", got #<RSpec::Mocks::MockExpectationError: #<Double "app"> received unexpected message :get_in_progress_review_submission with ({:platform=>"IOS"})> with backtrace:
         # ./deliver/lib/deliver/submit_for_review.rb:33:in `create_review_submission'
         # ./deliver/lib/deliver/submit_for_review.rb:25:in `submit!'
         # ./deliver/spec/submit_for_review_spec.rb:80:in `block (5 levels) in <top (required)>'
         # ./deliver/spec/submit_for_review_spec.rb:79:in `block (4 levels) in <top (required)>'
         # ./.bundle/ruby/3.2.0/gems/webmock-3.18.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'
     # ./deliver/spec/submit_for_review_spec.rb:79:in `block (4 levels) in <top (required)>'
     # ./.bundle/ruby/3.2.0/gems/webmock-3.18.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

@fr0l fr0l force-pushed the delete_IDFA_declarations branch from 99199a2 to f8653e1 Compare May 9, 2024 04:33
@EthanSK
Copy link

EthanSK commented May 9, 2024

Is this going to be merged in soon? I can't submit with fastlane atm. I either get "the specified resource does not exist - The path provided does not match a defined resource type" when add_id_info_uses_idfa is true or Use of Advertising Identifier (IDFA) is required to submit

@AliSoftware
Copy link
Contributor

@EthanSK you can just remove add_id_info_uses_idfa from your call to deliver / submit_to_app_store in your Fastfile (or from your Deliverfile) in your project and you'll be able to submit again.

(This PR is only to clean up what will now be dead code, as people stop using that attribute in their Fastfile and we start ignoring it now that it shouldn't be used anymore.)

@cooksimo
Copy link
Contributor

cooksimo commented May 10, 2024

@EthanSK you can just remove add_id_info_uses_idfa from your call to deliver / submit_to_app_store in your Fastfile (or from your Deliverfile) in your project and you'll be able to submit again.

(This PR is only to clean up what will now be dead code, as people stop using that attribute in their Fastfile and we start ignoring it now that it shouldn't be used anymore.)

This doesn't work because fastlane bails out of the submit if the idfa stuff is missing. It worked for us last release, but now I assume something has changed and the idfa declaration is missing which trips this issue: deliver/lib/deliver/submit_for_review.rb:148

@dave-perry
Copy link

@EthanSK you can just remove add_id_info_uses_idfa from your call to deliver / submit_to_app_store in your Fastfile (or from your Deliverfile) in your project and you'll be able to submit again.
(This PR is only to clean up what will now be dead code, as people stop using that attribute in their Fastfile and we start ignoring it now that it shouldn't be used anymore.)

This doesn't work because fastlane bails out of the submit if the idfa stuff is missing. It worked for us last release, but now I assume something has changed and the idfa declaration is missing which trips this issue: deliver/lib/deliver/submit_for_review.rb:148

Having this exact same issue.

@fr0l
Copy link
Author

fr0l commented May 10, 2024

the PR should be good to go. I have performed several submissions with the IDFA deleted, and it seems OK so far

@fr0l
Copy link
Author

fr0l commented May 10, 2024

@EthanSK you can just remove add_id_info_uses_idfa from your call to deliver / submit_to_app_store in your Fastfile (or from your Deliverfile) in your project and you'll be able to submit again.
(This PR is only to clean up what will now be dead code, as people stop using that attribute in their Fastfile and we start ignoring it now that it shouldn't be used anymore.)

This doesn't work because fastlane bails out of the submit if the idfa stuff is missing. It worked for us last release, but now I assume something has changed and the idfa declaration is missing which trips this issue: deliver/lib/deliver/submit_for_review.rb:148

Having this exact same issue.

Hey @dave-perry and @cooksimo !
Please could you try with current release of fastlane 2.220.0 with using

submission_information({
  ...
  add_id_info_uses_idfa: false,
  ...
})

in Deliverfile

(in order to unblock you)

I've just tried one submission and it seems to work

Just for example. This is what I see in logs:

DEBUG [2024-05-10 12:12:30.31]: Updating app store version for IDFA status of 'false'
INFO  [12:12:30]: >> PATCH appStoreVersions/blah-blah-blah: {"data":{"type":"appStoreVersions","id":"blah-blah-blah","attributes":{"usesIdfa":false}}} 
DEBUG [12:12:31]: << PATCH appStoreVersions/blah-blah-blah: 200 {"data"=>{"type"=>"appStoreVersions", "id"=>"blah-blah-blah", "attributes"=>{"platform"=>"IOS", "versionString"=>"2.354.0", "appStoreState"=>"PREPARE_FOR_SUBMISSION", "appVersionState"=>"PREPARE_FOR_SUBMISSION", "copyright"=>"© 2003-2024 Blah-Blah Limited", "reviewType"=>"APP_STORE", "releaseType"=>"MANUAL", "earliestReleaseDate"=>nil, "usesIdfa"=>false, "downloadable"=>true, "createdDate"=>"2024-05-08T03:43:35-07:00"}, "relationships"=>{"ageRatingDeclaration"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/ageRatingDeclaration", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/ageRatingDeclaration"}}, "appStoreVersionLocalizations"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appStoreVersionLocalizations", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appStoreVersionLocalizations"}}, "build"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/build", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/build"}}, "appStoreVersionPhasedRelease"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appStoreVersionPhasedRelease", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appStoreVersionPhasedRelease"}}, "gameCenterAppVersion"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/gameCenterAppVersion", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/gameCenterAppVersion"}}, "routingAppCoverage"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/routingAppCoverage", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/routingAppCoverage"}}, "appStoreReviewDetail"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appStoreReviewDetail", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appStoreReviewDetail"}}, "appStoreVersionSubmission"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appStoreVersionSubmission", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appStoreVersionSubmission"}}, "idfaDeclaration"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/idfaDeclaration", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/idfaDeclaration"}}, "appClipDefaultExperience"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appClipDefaultExperience", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appClipDefaultExperience"}}, "appStoreVersionExperiments"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appStoreVersionExperiments", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appStoreVersionExperiments"}}, "appStoreVersionExperimentsV2"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appStoreVersionExperimentsV2", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appStoreVersionExperimentsV2"}}, "customerReviews"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/customerReviews", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/customerReviews"}}, "alternativeDistributionPackage"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/alternativeDistributionPackage", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/alternativeDistributionPackage"}}}, "links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah"}}, "links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah"}}
DEBUG [2024-05-10 12:12:31.10]: Updated app store version for IDFA status of 'false'
INFO [2024-05-10 12:12:31.10]: Successfully updated IDFA declarations on App Store Connect

I hope it helps

@fr0l
Copy link
Author

fr0l commented May 10, 2024

Also PR for docs update fastlane/docs#1246

@EthanSK
Copy link

EthanSK commented May 12, 2024

@EthanSK you can just remove add_id_info_uses_idfa from your call to deliver / submit_to_app_store in your Fastfile (or from your Deliverfile) in your project and you'll be able to submit again.
(This PR is only to clean up what will now be dead code, as people stop using that attribute in their Fastfile and we start ignoring it now that it shouldn't be used anymore.)

This doesn't work because fastlane bails out of the submit if the idfa stuff is missing. It worked for us last release, but now I assume something has changed and the idfa declaration is missing which trips this issue: deliver/lib/deliver/submit_for_review.rb:148

Having this exact same issue.

Hey @dave-perry and @cooksimo ! Please could you try with current release of Fastlane 2.220.0 with using

submission_information({
  ...
  add_id_info_uses_idfa: false,
  ...
})

in Deliverfile

(in order to unblock you)

I've just tried one submission and it seems to work

Just for example. This is what I see in logs:

DEBUG [2024-05-10 12:12:30.31]: Updating app store version for IDFA status of 'false'
INFO  [12:12:30]: >> PATCH appStoreVersions/blah-blah-blah: {"data":{"type":"appStoreVersions","id":"blah-blah-blah","attributes":{"usesIdfa":false}}} 
DEBUG [12:12:31]: << PATCH appStoreVersions/blah-blah-blah: 200 {"data"=>{"type"=>"appStoreVersions", "id"=>"blah-blah-blah", "attributes"=>{"platform"=>"IOS", "versionString"=>"2.354.0", "appStoreState"=>"PREPARE_FOR_SUBMISSION", "appVersionState"=>"PREPARE_FOR_SUBMISSION", "copyright"=>"© 2003-2024 Blah-Blah Limited", "reviewType"=>"APP_STORE", "releaseType"=>"MANUAL", "earliestReleaseDate"=>nil, "usesIdfa"=>false, "downloadable"=>true, "createdDate"=>"2024-05-08T03:43:35-07:00"}, "relationships"=>{"ageRatingDeclaration"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/ageRatingDeclaration", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/ageRatingDeclaration"}}, "appStoreVersionLocalizations"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appStoreVersionLocalizations", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appStoreVersionLocalizations"}}, "build"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/build", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/build"}}, "appStoreVersionPhasedRelease"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appStoreVersionPhasedRelease", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appStoreVersionPhasedRelease"}}, "gameCenterAppVersion"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/gameCenterAppVersion", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/gameCenterAppVersion"}}, "routingAppCoverage"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/routingAppCoverage", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/routingAppCoverage"}}, "appStoreReviewDetail"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appStoreReviewDetail", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appStoreReviewDetail"}}, "appStoreVersionSubmission"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appStoreVersionSubmission", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appStoreVersionSubmission"}}, "idfaDeclaration"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/idfaDeclaration", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/idfaDeclaration"}}, "appClipDefaultExperience"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appClipDefaultExperience", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appClipDefaultExperience"}}, "appStoreVersionExperiments"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appStoreVersionExperiments", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appStoreVersionExperiments"}}, "appStoreVersionExperimentsV2"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/appStoreVersionExperimentsV2", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/appStoreVersionExperimentsV2"}}, "customerReviews"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/customerReviews", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/customerReviews"}}, "alternativeDistributionPackage"=>{"links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/relationships/alternativeDistributionPackage", "related"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah/alternativeDistributionPackage"}}}, "links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah"}}, "links"=>{"self"=>"https://api.appstoreconnect.apple.com/v1/appStoreVersions/blah-blah-blah"}}
DEBUG [2024-05-10 12:12:31.10]: Updated app store version for IDFA status of 'false'
INFO [2024-05-10 12:12:31.10]: Successfully updated IDFA declarations on App Store Connect

I hope it helps

It seems to sometimes work and sometimes not. For me as well, the last submission went through without idfa but then it failed recently...

@fr0l fr0l requested a review from AliSoftware May 13, 2024 19:18
@fr0l
Copy link
Author

fr0l commented May 13, 2024

Feedback addressed @AliSoftware
Please could you give it a second review. should be OK now.
Thank you

@dave-perry
Copy link

Hey @dave-perry and @cooksimo ! Please could you try with current release of fastlane 2.220.0 with using

submission_information({
  ...
  add_id_info_uses_idfa: false,
  ...
})

in Deliverfile

(in order to unblock you)

I've just tried one submission and it seems to work

Thanks, that worked for me (this week! 😅)

@lacostej
Copy link
Collaborator

Question: what happens if you do not update your Deliverfile? Does fastlane fail because the setting doesn't exist?

Has this been tested?

@fr0l
Copy link
Author

fr0l commented May 14, 2024

Question: what happens if you do not update your Deliverfile? Does fastlane fail because the setting doesn't exist?

Has this been tested?

In this PR i've tested that if Deliverfile still contains key add_id_info_uses_idfa, the fastlane will ignore it and will not explode/fail.
Maybe it's good to throw a warning at some point about "unsupported" setting (they key add_id_info_uses_idfa)..
Is there a common place that would help with housekeeping and removing deprecated stuff from user config files (something like Homebrew's brew doctor)?

@angelolloqui
Copy link

I am afraid removing the parameter is not helping. When I get rid of it then I get another error complaining about the IDFA not present but required. I am blocked because no matter what I do it fails. By the way, removing it was fine in las build, but somehow it does no longer work for us. Anyone else with a similar issue?

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

Successfully merging this pull request may close these issues.

deliver fails if IDFA is set
7 participants