quickstart-unity icon indicating copy to clipboard operation
quickstart-unity copied to clipboard

[FR] App store rejection due to App Tracking Transparency Framework. Better way to manage Pod deps

Open DaniilKarpenko opened this issue 4 years ago • 25 comments

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2018.4.23f1
  • Firebase Unity SDK version: 6.16.1
  • Source you installed the SDK: Unity Package Manager
  • Problematic Firebase Component: probably Analytics
  • Other Firebase Components in use: Firebase App, Firebase Dynamic Links, Firebase Remote Config, Google Analytics for Firebase
  • Additional SDKs you are using: none
  • Platform you are using the Unity editor on: Windows
  • Platform you are targeting: iOS
  • Scripting Runtime: IL2CPP

[REQUIRED] Please describe the question here:

Hello. I tried to publish the app in Kids Category and received the reject:

Your app implements the App Tracking Transparency framework, which is used when apps collect data about users and share it with third-parties for tracking purposes. Since Kids Category apps are not allowed to collect, transmit or share identifiable information with third-parties, you should not implement App Tracking Transparency in your app.

To resolve this issue, please check the NSUserTrackingUsageDescription located within Firebase framework -[APMIdentity retrieveAdTrackingConsentStatus] and remove this functionality or revise your app so that no personally identifiable information or device information is sent to third parties.

Can you help me? What should I do to remove this part from Firebase?

DaniilKarpenko avatar Mar 01 '21 20:03 DaniilKarpenko

Same issue! Is there any solution?

daneric avatar Mar 04 '21 02:03 daneric

My environment: Unity editor version: 2019.2.21f1 Firebase Unity SDK version: 7.0.2 Firebase Components in use: Analytics, Remote Config, Google Analytics for Firebase

daneric avatar Mar 04 '21 03:03 daneric

@DaniilKarpenko @daneric I suspect this is because you are using Google Analytics for Firebase. However, I am not an expert in Apple policy here.

I will transfer you to firebase-ios-sdk repo. They should be able to give you a better answer.

chkuang-g avatar Mar 06 '21 06:03 chkuang-g

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Mar 06 '21 06:03 google-oss-bot

Hi firebase-ios-sdk folks,

Our Firebase Unity SDK users had trouble publishing their app in Kids Category due to the use of App Tracking Transparency framework. This seems like something related to Analytics. Could you give them some guideline for this situation?

Shawn

chkuang-g avatar Mar 06 '21 06:03 chkuang-g

This is a duplicate of firebase/firebase-ios-sdk#7652. We have a fix staged for Firebase iOS SDK 7.8.0 planned to release within the next week. Please have any follow up discussion there.

paulb777 avatar Mar 06 '21 22:03 paulb777

@paulb777 Thanks for the information.

Seems like Firebase iOS 7.8.0 has been released. However, the latest Firebase Unity SDK 7.1.0 still depends on iOS SDK 7.5.0.

Since we have not release a Unity SDK which includes this change yet, let me transfer this back to quickstart-unity and assign a Milestone to it.

@DaniilKarpenko If you need to resolve this immediately, you can try to bump up Pod version to 7.8.0. However, we have not tested the latest Unity SDK again Pod 7.8.0 yet. Make sure if you test your app thoroughly after making the change.

If this is the risk you can take, here is the steps to bump up Pod version:

  • Upgrade Firebase Unity SDK to 7.1.0 first. There are many breaking changes from 6.16.1 to 7.1.0. But I am 100% sure Unity SDK 6.16.1 will NOT be compatible to iOS Pod 7.8.0
  • There are two ways you can bump up Pod version, both have pros and cons
    • Modify Podfile in Xcode project directly.
      • Pro: easiest to change.
      • Con: EDM4U may override your change after rebuilding Xcode project. To prevent EDM4U from override your changes, you can disable Podfile Generation settings in Assets > External Dependency Manager > iOS Resolver > Settings menu item.
    • Modify all files in your project which ends with Dependencies.xml and bump up the iosPod version to 7.8.0
      • Pro: EDM4U will use this version number when rebuilding Xcode project
      • Con: Since you will need to modify a file in the package, you will need to migrate from Unity Package Manager to .unitypackage. Otherwise, Unity Package Manager tend to revert your changes after modification. Make sure Firebase and EDM4U are uninstalled from Unity Package Manager before installing .unitypackage version.

Hope this helps! Shawn

chkuang-g avatar Mar 12 '21 20:03 chkuang-g

[Update] Cool. We just found out the iOS SDK 7.8.0 does NOT work. https://github.com/firebase/firebase-ios-sdk/issues/7695

Let's wait for iOS team to fix this first.

chkuang-g avatar Mar 12 '21 20:03 chkuang-g

Seems like it is fixed in 7.8.1.

Please try the instruction here https://github.com/firebase/quickstart-unity/issues/994#issuecomment-797731070, and let us know if you run into any issue.

And we will include this in the next release

chkuang-g avatar Mar 12 '21 22:03 chkuang-g

We`ve tried to pop up pod version to the latest 7.8.1 and still got reject. @daneric were you able to fix it with this instruction?

Seleznov avatar Mar 17 '21 09:03 Seleznov

We`ve tried to pop up pod version to the latest 7.8.1 and still got reject. @daneric were you able to fix it with this instruction?

We were trying to update to 7.8.1 and stopped because of your comment Are you sure that you are not using other SDK's? AppsFlyer had similar issue and they patched it yesterday

adityathoutam avatar Mar 17 '21 11:03 adityathoutam

Are you sure that you are not using other SDK's?

@adityathoutam we use only Firebase Remote Config and Firebase Analytics

Seleznov avatar Mar 19 '21 13:03 Seleznov

Are you sure that you are not using other SDK's?

@adityathoutam we use only Firebase Remote Config and Firebase Analytics

Cool. We removed Firebase Analytics completely and our app passed through the App review yesterday.

adityathoutam avatar Mar 19 '21 14:03 adityathoutam

If I understand the situation about Unity SDK now we have to wait this issue https://github.com/firebase/firebase-ios-sdk/issues/7736 to be fixed first. @chkuang-g am I correct?

Seleznov avatar Mar 25 '21 14:03 Seleznov

Same here! We have been rejected since 1st of March and found this issue few days ago. We removed Firebase Analytics iOS sdk and we passed the Apple review. I guess we have to wait for a fix.

ArnauKokoro avatar Mar 25 '21 18:03 ArnauKokoro

Hi all!

Sorry for the silence, I've been digging around to find the current state of the matter. As mentioned by @Seleznov : this is blocked by firebase/firebase-ios-sdk#7736 -- the games SDKs are dependent on the underlying platform SDKs (in this case iOS), so fixing that should fix this. I won't mark this as a duplicate since I figure that this bug will get resolved in two steps:

  1. the iOS SDK eventually gets patched, and the workaround becomes modify your AnalyticsDependencies.xml file as mentioned here
  2. the games/Unity SDK will get a subsequent update to make this version default (and to run it through our own unit testing framework to ensure stability) fully resolving the issue at hand

Sorry for the inconvenience, this is obviously not the developer experience Firebase wants to deliver and folks are working on it

patm1987 avatar Mar 25 '21 20:03 patm1987

We use(d) Firebase Analytics and other Firebase SDKs on our app through Unity Package Manager. To submit our app successfully we we had to do the following:

  1. Remove Firebase Analytics from Package Manager
  2. Create a Post Processing Build editor script that removes "Firebase/Core" dependency from the Pod file:
using System.IO;
public class PostProcessIOS : MonoBehaviour {
	[PostProcessBuildAttribute(45)]//must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and that it's added before "pod install" (50)
	private static void PostProcessBuild_iOS(BuildTarget target, string buildPath)
	{
		string podfileFilePath = Path.Combine(buildPath, "Podfile");
				
		Debug.LogFormat("[FixFirebasePodfile] Processing file at path: {0}", podfileFilePath);
		var lines = File.ReadAllLines(podfileFilePath);
		
		var sb = new StringBuilder();
		foreach (string line in lines)
		{
			if (line.Contains("Firebase/Core"))
			{
				Debug.LogFormat("[FixFirebasePodfile] Skipping line to ignore 'Firebase/Core' Pod Dependency. It is a workaround to prevent it dragging along 'FirebaseAnalytics'.\n" +
								"Line content: \"{0}\"\n" +
								"File path: {1}",
					line, podfileFilePath);
				continue;
			}

			sb.AppendLine(line);
		}
		
		File.WriteAllText(podfileFilePath, sb.ToString());
	}
}

bilck avatar Mar 31 '21 18:03 bilck

https://github.com/firebase/firebase-ios-sdk/issues/7736#issuecomment-811340570

kenMarquez avatar Mar 31 '21 19:03 kenMarquez

@bilck You can probably achieve the same solution by switching to using the unitypackage version of the SDK, opening Assets/Firebase/Editor/AppDependencies.xml, and deleting the lines:

    <iosPod name="Firebase/Core" version="7.5.0" minTargetSdk="9.0">
    </iosPod>

According to the linked iOS bug, it looks like there's a new pod for Firebase/Analytics that might fix the kids thing. To fix that open Assets/Firebase/Editor/AnalyticsDependencies.xml and change:

    <iosPod name="Firebase/Analytics" version="7.5.0" minTargetSdk="9.0">
    </iosPod>

To:

    <iosPod name="Firebase/Analytics" version="7.9.0-k2" minTargetSdk="9.0">
    </iosPod>

This configuration won't have gone through the same level of testing as an official games release, but should work (I'm not aware of any problematic api changes).

These files are what generates the Podfile at the end. If switching to unitypackage releases isn't an option for you then you can probably apply the same changes with the script.

For folks in this thread, let us know if these changes work!

patm1987 avatar Mar 31 '21 20:03 patm1987

@patm1987 Thanks for the feedback.

I would try that out, but since we use Unity Package Manager, the files keep getting changed back to their original versions.

I omitted the code here, but I also was replacing "7.5.0" with "7.9.0" on the Podfile, which is the version that it was mentioned that contained the Analytics fix (which is not true, as lots of people reported that they keep getting rejected - myself included).

Using the Build Post Processing script was the cleanest way to fix the issue without having to resort to the "Unity Package" SDK version (which commits lots of files on the repository).

By the way, where did you get this "7.9.0-k2" from? (especially the k2 part) Do I need to change other Firebase SDK dependencies as well? If I change all of them, will it work?

bilck avatar Mar 31 '21 20:03 bilck

All Firebase dependencies in the Podfile specified with a forward slash to indicate a subspec of the Firebase pod need to change to indicate the 7.9.0-k2 version of the Firebase pod.

paulb777 avatar Mar 31 '21 21:03 paulb777

-k2 came from firebase/firebase-ios-sdk#7736

It's a specific build to address this issue, to my knowledge there isn't any additional documentation around it at this time.

patm1987 avatar Mar 31 '21 22:03 patm1987

FYI, 7.9.0-k2 version works for us as a temporary solution and our app was approved 🎉

Also, thanks for this and that help about how to adapt iOS SDK fix to Unity project.

So waiting for the new release of Unity SDK with this fix.

Seleznov avatar Apr 14 '21 13:04 Seleznov

Got back from iOS team.

Seems like this duo Pods situation will stay for a bit until we know the next step from Apple, and make appropriate changes.

That is,

  • The default Pod dependency specified in Unity SDK, a.k.a. Assets/Firebase/Editor/AnalyticsDependencies.xml, will continue to implement App Tracking Transparency framework
  • If you need to publish for kids category, you will need to follow https://github.com/firebase/quickstart-unity/issues/994#issuecomment-811412184 and change the pod to -k2 version, ex. 7.9.0-k2. This may be slightly challenging if you install using .tgz. In that case, you will need to explode the tgz, modify AnalyticsDependencies.xml, zip it back to tgz, then install it using Unity Package Manager.

Check our release note for future changes. https://firebase.google.com/support/release-notes/unity https://firebase.google.com/support/release-notes/ios

Judged by the available workaround and the situation, allow me to change this to feature request.

The feature can be done in two ways:

  • A Unity editor setting to to automatically modify Analytics pods if the project is set to publish for kids. (We need to evaluate if this duo Pods nature will last for a very long time.)
  • iOS team figure out a way to unify two pods into one.

Shawn

chkuang-g avatar Apr 23 '21 20:04 chkuang-g

Got an update from iOS team.

From iOS SDK 7.11.0, instead of changing version number, you need to change the Pod name to Firebase/AnalyticsWithoutAdIdSupport. https://firebase.google.com/support/release-notes/ios

Here is a table to help you.

Pod name version Kid? :girl: :boy:
Firebase/Analytics 7.9.0 or below :x:
Firebase/Analytics 7.9.0-k2 :white_check_mark:
Firebase/Analytics 7.9.1 :x:
Firebase/Analytics 7.10.0 :x:
Firebase/Analytics 7.11.0 or above :x:
Firebase/AnalyticsWithoutAdIdSupport 7.11.0 or above :white_check_mark:

Still duo pod spec/subspec situation but hope this clarify it.

chkuang-g avatar Apr 23 '21 20:04 chkuang-g

Close since the iOS SDK has fixed the issue.

cynthiajoan avatar Sep 09 '22 18:09 cynthiajoan