invertase / notifee

⚛️ A feature rich notifications library for React Native.
https://notifee.app
Apache License 2.0
1.88k stars 228 forks source link

Apple's privacy manifest #1024

Closed xxsnakerxx closed 6 months ago

xxsnakerxx commented 7 months ago

After uploading a build I received an email from Apple

ITMS-91053: Missing API declaration - Your app’s code in the “PlugIns/NotifeeNotificationService.appex/NotifeeNotificationService” file references one or more APIs that require reasons, including the following API categories: NSPrivacyAccessedAPICategoryDiskSpace. While no action is required at this time, starting May 1, 2024, when you upload a new app or app update, you must include a NSPrivacyAccessedAPITypes array in your app’s privacy manifest to provide approved reasons for these APIs used by your app’s code. For more details about this policy, including a list of required reason APIs and approved reasons for usage, visit: https://developer.apple.com/documentation/bundleresources/privacy_manifest_files/describing_use_of_required_reason_api.

They mentioned all 4 APIs

My NotificationService.m code

#import "NotificationService.h"
#import "NotifeeExtensionHelper.h" <--------

@interface NotificationService ()

@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;

@end

@implementation NotificationService

- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
    self.contentHandler = contentHandler;
    self.bestAttemptContent = [request.content mutableCopy];

    [NotifeeExtensionHelper populateNotificationContent:request
                                  withContent: self.bestAttemptContent
                                  withContentHandler:contentHandler];
}

- (void)serviceExtensionTimeWillExpire {
    // Called just before the extension will be terminated by the system.
    // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
    self.contentHandler(self.bestAttemptContent);
}

@end

Could you suggest how to fix it! I understand that I need to add then new manifest file, but what reasons should I choose for each api?! Thank you!

drweizak commented 7 months ago

@xxsnakerxx did you manage to find a workaround for this?

shapournemati-iotty commented 7 months ago

Hi, any chance we can get a response on this? The deadline is just a couple of weeks from now and I think this might be affecting all users of the library

drweizak commented 7 months ago

Hi, any chance we can get a response on this? The deadline is just a couple of weeks from now and I think this might be affecting all users of the library

I manage to bypass it by creating my own privacy file. Actually check this file for the upcoming RN 0.74 https://react-native-community.github.io/upgrade-helper/?from=0.73.6&to=0.74.0-rc.9#-dev-null-RnDiffApp-ios-RnDiffApp-PrivacyInfo.xcprivacy

shapournemati-iotty commented 7 months ago

Hi, any chance we can get a response on this? The deadline is just a couple of weeks from now and I think this might be affecting all users of the library

I manage to bypass it by creating my own privacy file. Actually check this file for the upcoming RN 0.74 https://react-native-community.github.io/upgrade-helper/?from=0.73.6&to=0.74.0-rc.9#-dev-null-RnDiffApp-ios-RnDiffApp-PrivacyInfo.xcprivacy

Thanks for the response! I had investigate this a bit in the past few days, the only concern I have here is NSPrivacyAccessedAPITypeReasons field: are we sure these are the correct and only reasons notifee is making use of the NSPrivacyAccessedAPIType specified above? Did you choose the reasons looking at the code and what they do with the api calls results?

drweizak commented 7 months ago

No, i did not! And i am aware of it! But you are not supposed to mention what your third party packages do. They need to create their own privacy file! In order to Apple stop sending you warning you need to cover privacy for React Native only. Which is what you can find in their RC upgrade helper

github-actions[bot] commented 6 months ago

Hello 👋, to help manage issues we automatically close stale issues.

This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?

This issue will be closed in 15 days if no further activity occurs.

Thank you for your contributions.

anwargul0x commented 5 months ago

is there any further finds ?

vasylnahuliak commented 5 months ago

@anwargul0x Apple still does not do anything bad with my mobile app which has notifee@5.7.0 The project has a weekly release flow and Apple doesn't reject the app. It can be lucky.