firebase / firebase-unity-sdk

The Firebase SDK for Unity
http://firebase.google.com
Apache License 2.0
220 stars 35 forks source link

"Missing Push Notification Entitlement" warning after adding Crashlytics SDK #375

Open oct-test opened 4 years ago

oct-test commented 4 years ago

Unity editor version: 2019.3.0f3 Firebase Unity SDK version: 6.13 Firebase plugins in use (Auth, Database, etc.): Crashlytics Additional SDKs you are using (Facebook, AdMob, etc.): Facebook Analytics, Appsflyer Platform you are using the Unity editor on (Mac, Windows, or Linux): Mac Platform you are targeting (iOS, Android, and/or desktop): iOS Scripting Runtime (Mono, and/or IL2CPP): IL2CPP

Issue: I received a warning email from Apple for recent App Store submission saying "ITMS-90078: Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the "aps-environment" entitlement.". My game is not using the push notification service.

Before adding the Firebase Crashlytics SDK, there was no such warning email from Apple. Hence, I am suspecting that this warning email arrived due to Firebase SDK.

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? No, I can't do that as to this bug I have to submit a build to App Store.

What's the issue repro rate? 100%

google-oss-bot commented 4 years ago

This issue does not seem to follow the issue template. Make sure you provide all the required information.

chkuang-g commented 4 years ago

@oct-test

AFAIK, Crashlytics does not require Push Notification either. Are you sure you did not switch Push Notifications to On in your Xcode project? If this is off, even any SDK wants to receive push notification, none can receive it.

Also, aps-environment seems only used for macOS. And Crashlytics does not support macOS. https://developer.apple.com/documentation/bundleresources/entitlements/aps-environment

oct-test commented 4 years ago

Thank you for the response @chkuang-g. I did check my Xcode project settings and I haven't enabled push notifications.

I understand that the game won't receive any push notifications but I wanted to get rid of that annoying warning email from Apple. Are there any other settings I could check to help you figure out the problem?

chkuang-g commented 4 years ago

Not as I aware of. Apple should only determine either your app is using push notification based on your Xcode project configuration.

I think you should consult with Apple and see why this email occurred.

oct-test commented 4 years ago

Thank you @chkuang-g. Let me check with Apple on this issue. I will let you know the information I will receive from them.

google-oss-bot commented 4 years ago

Hey @oct-test. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

oct-test commented 4 years ago

Hello @chkuang-g. I checked with Apple and they informed me that there must be an AppDelegate file implementing method "didRegisterForRemoteNotificationsWithDeviceToken".

I found a file named "GULAppDelegateSwizzler.m" with that text. Can this method cause this problem?

patm1987 commented 4 years ago

Hi @oct-test ,

It looks like GULAppDelegateSwizzler.m does its best to not trigger that very Apple warning. In particular, it goes out of its way to not add that selector unless it already exists (you can see the workaround by searching for that selector here).

Is there any way for you to verify that that selector is not included by any other SDKs you've included? If your question is "does Crashlytics use push notifications", the answer is no. If you're permitted to ship in the current state you should be safe from the Firebase front.

If you are able to test it (maybe submit an app for review with some subset of the SDKs you listed, then pull it), it would help immensely. Either to see if shipping the test app has the issue, or if some other SDK is having a bad interaction with Firebase. It would be useful to know if the workaround doesn't work anymore or if it's having a bad interaction with one of your other SDKs, but the running theory seems to be another SDK is causing an issue. I'd love to get you unstuck though (even if this is a non-blocking false positive, it's not a friendly experience!).

--Patrick

charlotteliang commented 4 years ago

@renkelvin @maksymmalyhin Looks like auth is calling the proxyOriginalDelegateIncludingAPNSMethods, should developers just disable swizzling for this case? https://github.com/firebase/firebase-ios-sdk/tree/master/GoogleUtilities/AppDelegateSwizzler#disabling-app-delegate-swizzling-by-app-developers

Is there a way they can continue to use auth but just disable apns part?

patm1987 commented 4 years ago

Chatting with an internal support expert, they were just going to recommend that you disable swizzling with the caveat that including Auth will give you that warning no matter what. You can follow this issue, but it doesn't look feasible at the moment: https://github.com/firebase/firebase-ios-sdk/issues/2807

Are you using Firebase Authentication? I don't believe that it's a requirement for Crashlytics, and you should generally just include the Firebase plugins that you're using (each unitypkg is self contained, so you don't have to install them all).

If you do decide to disable swizzling, you may have to implement a custom app delegate. I do not believe that this is the case for Crashlytics, but I'd have to verify that to be certain.

--Patrick

maksymmalyhin commented 4 years ago

As far as I can see from the code latest versions of Firebase iOS SDK (that is used under the hood by Firebase Unity SDK) APNs registrations is triggered only when Firebase Auth Phone Number method is used. Please make sure you configure your project according to the guide or disable Phone Number Auth method to avoid enabling APNs.

The Apple review warning also could be triggered by old Firebase iOS SDK version but the issue was fixed a while ago (see https://github.com/firebase/firebase-ios-sdk/issues/2807 for details). Please make sure you use up-to-date SDK version.

Please let me know if you still have any questions.

seansaleh commented 4 years ago

We also ran into this problem upon adding firebase-crashlytics-unity 6.11.0 to our project in Unity 2019.2.19f1

And I've reproduced it with the latest versions of Firebase Crashlytics and Unity using Unity's EndlessRunnerSampleGame.

Here are the details on this new project and test: Unity editor version: 2019.3.10f1 Firebase Unity SDK version: 6.13.0 Source you installed the SDK (.unitypackage or Unity Package Manager): .unitypackage Firebase plugins in use (Auth, Database, etc.): Crashlytics Additional SDKs you are using (Facebook, AdMob, etc.): None Platform you are using the Unity editor on (Mac, Windows, or Linux): Building on Mac & Developping on Windows Platform you are targeting (iOS, Android, and/or desktop): iOS Scripting Runtime (Mono, and/or IL2CPP): IL2CPP

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? Not yet, am running tests now and will edit/update this thread when done What's the issue repro rate? (eg 100%, 1/5 etc) 100%

This project differs from the Unity sample by using the latest unity version and removing com.unity.ads, com.unity.analytics, com.unity.purchasing. You can read the commits for exact details. Other unique parts of this project are that we change the Google.IOSResolver settings to use xcodeproject instead of workspace integration and we disabled PodToolExecutionViaShellEnabled to work better on our build machine. This project for repro-ing this issue can be found at: https://github.com/seansaleh/EndlessRunnerSampleGame

The issue: When running a build before adding Firebase Crashlytics (Tag WithoutExternalProjects in the repo) we do not get any build warnings from apple.

Then running and submitting a build to testflight with Firebase Crashlytics added, as seen at the tag WithFirebaseCrashlytics we got the following message:

ITMS-90078: Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the "aps-environment" entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the "aps-environment" entitlement. Xcode does not automatically copy the aps-environment entitlement from provisioning profiles at build time. This behavior is intentional. To use this entitlement, either enable Push Notifications in the project editor's Capabilities pane, or manually add the entitlement to your entitlements file. For more information, see https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html#//apple_ref/doc/uid/TP40008194-CH6-SW1.

To be super clear, the only difference between the two apple submissions is the addition of Firebase Crashlytics, as seen in this diff

maksymmalyhin commented 4 years ago

@patm1987 Could you help us to understand what Firebase iOS SDK versions are used in Firebase Unity SDK 6.13.0?

@samedson may help to investigate Crashlytics iOS part.

seansaleh commented 4 years ago

FYI I redid this with the quickstart-unity app, after updating it to 2019.3 and got the same result.

Unity editor version: 2019.3.10f1 Firebase Unity SDK version: 6.13.0 Source you installed the SDK (.unitypackage or Unity Package Manager): Unity Package Manager Firebase plugins in use (Auth, Database, etc.): Crashlytics Additional SDKs you are using (Facebook, AdMob, etc.): None Platform you are using the Unity editor on (Mac, Windows, or Linux): Mac build machine Platform you are targeting (iOS, Android, and/or desktop): iOS Scripting Runtime (Mono, and/or IL2CPP): IL2CPP

After updating this project to Unity 2019.3.10f1, but before adding crashlytics (as seen in this release tag) the app does not have any warning from Apple upon submitting to TestFlight After adding crashlytics (as seen in this release tag] and submitting to TestFlight we received the Apple warning "ITMS-90078: Missing Push Notification Entitlement"

You can see the diff between the two at: https://github.com/seansaleh/quickstart-unity/compare/WithoutExternalProjects...seansaleh:WithFirebaseCrashlytics

Have you been able to reproduce this issue with just the Firebase Unity quickstarts (this GitHub project)? Yes

What's the issue repro rate? (eg 100%, 1/5 etc) 100%

google-oss-bot commented 4 years ago

Hey @oct-test. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

seansaleh commented 4 years ago

Can we update this issue to add the bug label and remove needs info, type:question, and stale At this point I've provided a repo and there's no other info needed from outside the project. Thanks!

samedson commented 4 years ago

I can validate that the Crashlytics iOS SDK and the Crashlytics-specific parts of the Unity plugin do not require the push notification entitlement.

The only Firebase SDKs that call didRegisterForRemoteNotificationsWithDeviceToken are Auth and messaging, via [GULAppDelegateSwizzler proxyOriginalDelegateIncludingAPNSMethods]. Maybe some SDKs are being included in the Firebase App Unity build?

bovesan commented 4 years ago

I am receiving this same warning after adding FirebaseAnalytics.unitypackage 6.14.0.

google-oss-bot commented 4 years ago

Hey @oct-test. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 4 years ago

Hey @oct-test. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 4 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@oct-test if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

seansaleh commented 4 years ago

Can we reopen this issue? As I said above, can we add the bug label and remove needs info, type:question, and stale There is a clear repro of the issue and multiple people confirming it, even in the latest version. Thanks!

seansaleh commented 4 years ago

Thanks @chkuang-g! Furthermore I managed to test this with not crashlytics, just using the base com.google.firebase.app and com.google.firebase.storage modules, and was able to repro it. You can see my work at https://github.com/seansaleh/quickstart-unity/commit/3b9d5ebbbc16a4f697e920d71633b83e451684fe and how I used the storage quickstart project for the repro. I also updated to Firebase Unity SDK version: 6.14.0 and still have the issue.

patm1987 commented 4 years ago

Guidance in the past is that this message should be safe to ignore. I will open an internal bug to help track this down, but if y'all can verify that it's still occuring on 6.15 and whether or not there's an even more minimal set of APIs (say if you get this error if you just include Analytics) - it would help the internal team a ton!

seansaleh commented 4 years ago

I can confirm it (ITMS-90078: Missing Push Notification Entitlement) is still occurring on 6.15.0 and the latest unity, 2019.4.1f1 I still get the error even when just using the Firebase SDK for Cloud Storage, with no Crashlytics. I chose that plugin since it should be the simplest one, nothing to do with push notifications

judasbenhur commented 4 years ago

has there been any progress on this? We're getting the same warning as described by @seansaleh in Unity 2019.4.1f1.

pachermann commented 4 years ago

@google-oss-bot We have the same issue with Unity 207.4.1 LTE. @seansaleh any Updates on this? @patm1987 sry to ping you, but is it really save to commit the app to apple with this error in it?

pachermann commented 4 years ago

We just solved the issue by manually creating the push notification profile as described here: https://stackoverflow.com/questions/14807129/missing-push-notification-entitlement

use are using Unity 207.4.1 LTE latest firebase

jonahgoldsaito commented 4 years ago

Same error on with 6.15.2 building in 2019.3.8 on OSX

I'm using:

msclower commented 4 years ago

Currently getting same error on unity 2018.4.13f. But I don't use Crashlytics but I do use Firbase Auth and Analytics.

chkuang-g commented 3 years ago

Hi folks,

It has been awhile, and I am wondering if any of you are still seeing the same issue with the later version of Firebase SDK, ex. 7.0.0 or above?

edumlauer commented 3 years ago

Yes, just had this issue. Unity 2020.2.2f1 and Firebase with Crashlytics, version 7.1.0

dpedrinha commented 3 years ago

I'm having the same problem and I'm not even using Crashlytics or unity. I'm using Flutter Core, Auth, dynamic links, firestore.

maksymmalyhin commented 3 years ago

@dpedrinha Thank you for your update. I think your case is slightly different. Firebase Auth SDK actually has methods to handle push notifications (see here). Though push notifications are used only for phone based auth, currently there is no way to exclude this code if phone auth is not used in you app. Would you mind opening a separate for Firebase Auth SDK to provide a way to exclude the push notifications code if it is not used?

Note: from our previous experience the "Missing Push Notification Entitlement" warning was just for your information and didn't trigger the app rejection. Please let us know if you have different experience.

@rosalyntan Do you if you have anything to add/correct pleased do.

uchar commented 2 years ago

@chkuang-g I have still the same issue with Firebase Analytics 8.8.0 and unity 2020.3.30

MScottAdams commented 2 years ago

Getting this issue also. Using

  1. com.google.firebase.analytics-9.4.0.tgz
  2. com.google.firebase.app-9.4.0.tgz
  3. Unity 2021.3.8f1
r-koubou commented 1 year ago

Same here.

filgreen3 commented 1 year ago

Same here

  1. Unity 2021.3.14f1
  2. firebase-analytics-unity 10.7.0
vincentatherlabs commented 1 year ago

Why is this closed? I am having same problem:

  1. Unity 2022.3.3f1
  2. firebase_unity_sdk_11.4.0
Tonieh commented 1 year ago

Why is this closed? I am having same problem:

  1. Unity 2022.3.3f1
  2. firebase_unity_sdk_11.4.0

Hi! Same here. I Posted a new thread, hope someone tell a solution

mrcarriere commented 8 months ago

We're also experiencing this with the following:

While I understand that the build will successfully pass through review and not block submission, this warning can oftentimes unsettle management that something we're doing needs further review. Any help in disabling this when not in use would be appreciated.

jundato commented 7 months ago

Having the same problem here. Unity - 2023.3.14f1 Firebase - 10.7.0