Skip to content

Unable to publish to Appstore rejection because of NSCalendarUsageDescription but i have made the Podfile changes as per the Ios setup in the pub dev. #377

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

Closed
praveen-francium opened this issue Aug 31, 2020 · 9 comments
Assignees

Comments

@praveen-francium
Copy link

Screenshot 2020-08-31 at 8 57 43 AM

Permission handler version:
permission_handler: ^5.0.1+1
flutter version:

[✓] Flutter (Channel stable, 1.20.2, on Mac OS X 10.15.6 19G2021, locale en-GB)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Community Edition (version 2019.3.1)
[✓] VS Code (version 1.46.1)
[✓] Connected device (1 available)

Podfile:
```post_install do |installer|
  installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['ENABLE_BITCODE'] = 'NO'
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
              '$(inherited)',
                 ## dart: PermissionGroup.calendar
                  "PERMISSION_EVENTS=0",

                  ## dart: PermissionGroup.reminders
                  "PERMISSION_REMINDERS=0",

                  ## dart: PermissionGroup.contacts
                  "PERMISSION_CONTACTS=0",

                  ## dart: PermissionGroup.microphone
                  "PERMISSION_MICROPHONE=0",

                  ## dart: PermissionGroup.speech
                  "PERMISSION_SPEECH_RECOGNIZER=0",

                  ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
                  "PERMISSION_LOCATION=0",

                  ## dart: PermissionGroup.notification
                  # "PERMISSION_NOTIFICATIONS=0",

                  ## dart: PermissionGroup.mediaLibrary
                  "PERMISSION_MEDIA_LIBRARY=0",

                  ## dart: PermissionGroup.sensors
                  "PERMISSION_SENSORS=0",
        ]
      end
    flutter_additional_ios_build_settings(target)
  end
end
@danielroek
Copy link
Contributor

danielroek commented Aug 31, 2020

Hi @praveen-francium ,

You should comment out the permissions you are using, so in this case "PERMISSION_EVENTS=0", should be # "PERMISSION_EVENTS=0",

@praveen-francium
Copy link
Author

@danielroek Thanks for the reply,But i don't want access to calendar, i need access only to notification so i commented that one.But now why i need to change to #"PERMISSION_EVENTS=0"

@danielroek
Copy link
Contributor

danielroek commented Aug 31, 2020

Did you add all the permissions to your Info.plist file? Apple rejects applications that do not specify the user-facing purpose String when using flutter_permission_handler.
The README states the following

IMPORTANT: You will have to include all permission options when you want to submit your App. This is because the permission_handler plugin touches all different SDKs and because the static code analyser (run by Apple upon App submission) detects this and will assert if it cannot find a matching permission option in the Info.plist. More information about this can be found here.

The original issue can be found here.

@danielroek danielroek self-assigned this Aug 31, 2020
@praveen-francium
Copy link
Author

@danielroek Yes ,i need only permission for notifications and i have added that in the Info.Plist but i don't need access to calendars but the issue i am facing while publishing to appStore is related to Calendar issue.So please help me how to overcome this issue. Also i have followed up exactly how the Podfile need to be as per the documentation,i have commented only the notification line,but i am facing this issue.

@danielroek
Copy link
Contributor

This issue seems to be linked to this issue. Could you please try if updating your Podfile following the example works? Please let us know if this fixes your issue, that way we're able to update our documentation.

@praveen-francium
Copy link
Author

@danielroek Thanks for the reply,but i have added the podfile to your reference i think i did the same as what been mentioned in the link you provided actually.Please take a look at my Podfile and suggest me what if i am doing anything wrong.Because i just replicated as per the documentation.So please take a look at my Podfile and suggest me the changes.Thanks

@praveen-francium
Copy link
Author

Readding the line mentioned in Ios set up solves the issue.

@Kimhak-Loem
Copy link

@praveen-francium excuse me, could you please share your solutions? Your helps would be appreciated.

@kArtDevelopers
Copy link

Hi, I found the solution, and updated my app on the AppStore.
Open this file ios/.symlinks/plugins/permission_handler/ios/Classes/PermissionHandlerEnums.h:0
and set values
0 - for not using permission.
1 - for using permission.

For an example: (I am using Camera, photos, location and notification permissions)

PermissionHandlerEnums.h

//
// PermissionHandlerEnums.h
// permission_handler
//
// Created by Razvan Lung on 15/02/2019.
//

// ios: PermissionGroupCalendar
// Info.plist: NSCalendarsUsageDescription
// dart: PermissionGroup.calendar
#ifndef PERMISSION_EVENTS
#define PERMISSION_EVENTS 0 //0 for not accessing this permission.
#endif

// ios: PermissionGroupReminders
// Info.plist: NSRemindersUsageDescription
// dart: PermissionGroup.reminders
#ifndef PERMISSION_REMINDERS
#define PERMISSION_REMINDERS 0
#endif

// ios: PermissionGroupContacts
// Info.plist: NSContactsUsageDescription
// dart: PermissionGroup.contacts
#ifndef PERMISSION_CONTACTS
#define PERMISSION_CONTACTS 0
#endif

// ios: PermissionGroupCamera
// Info.plist: NSCameraUsageDescription
// dart: PermissionGroup.camera
#ifndef PERMISSION_CAMERA
#define PERMISSION_CAMERA 1 //1 for accessing camera permission.
#endif

// ios: PermissionGroupMicrophone
// Info.plist: NSMicrophoneUsageDescription
// dart: PermissionGroup.microphone
#ifndef PERMISSION_MICROPHONE
#define PERMISSION_MICROPHONE 0
#endif

// ios: PermissionGroupSpeech
// Info.plist: NSSpeechRecognitionUsageDescription
// dart: PermissionGroup.speech
#ifndef PERMISSION_SPEECH_RECOGNIZER
#define PERMISSION_SPEECH_RECOGNIZER 0
#endif

// ios: PermissionGroupPhotos
// Info.plist: NSPhotoLibraryUsageDescription
// dart: PermissionGroup.photos
#ifndef PERMISSION_PHOTOS
#define PERMISSION_PHOTOS 1
#endif

// ios: PermissionGroupPhotosAddOnly
// Info.plist: NSPhotoLibraryUsageDescription
// dart: PermissionGroup.photosAddOnly
#ifndef PERMISSION_PHOTOS_ADD_ONLY
#define PERMISSION_PHOTOS_ADD_ONLY 1
#endif

// ios: [PermissionGroupLocation, PermissionGroupLocationAlways, PermissionGroupLocationWhenInUse]
// Info.plist: [NSLocationUsageDescription, NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationWhenInUseUsageDescription]
// dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]
#ifndef PERMISSION_LOCATION
#define PERMISSION_LOCATION 1
#endif

// ios: PermissionGroupNotification
// dart: PermissionGroup.notification
#ifndef PERMISSION_NOTIFICATIONS
#define PERMISSION_NOTIFICATIONS 1
#endif

// ios: PermissionGroupMediaLibrary
// Info.plist: [NSAppleMusicUsageDescription, kTCCServiceMediaLibrary]
// dart: PermissionGroup.mediaLibrary
#ifndef PERMISSION_MEDIA_LIBRARY
#define PERMISSION_MEDIA_LIBRARY 0
#endif

// ios: PermissionGroupSensors
// Info.plist: NSMotionUsageDescription
// dart: PermissionGroup.sensors
#ifndef PERMISSION_SENSORS
#define PERMISSION_SENSORS 0
#endif

// ios: PermissionGroupBluetooth
// Info.plist: [NSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription]
// dart: PermissionGroup.bluetooth
#ifndef PERMISSION_BLUETOOTH
#define PERMISSION_BLUETOOTH 0
#endif

typedef NS_ENUM(int, PermissionGroup) {
PermissionGroupCalendar = 0,
PermissionGroupCamera,
PermissionGroupContacts,
PermissionGroupLocation,
PermissionGroupLocationAlways,
PermissionGroupLocationWhenInUse,
PermissionGroupMediaLibrary,
PermissionGroupMicrophone,
PermissionGroupPhone,
PermissionGroupPhotos,
PermissionGroupPhotosAddOnly,
PermissionGroupReminders,
PermissionGroupSensors,
PermissionGroupSms,
PermissionGroupSpeech,
PermissionGroupStorage,
PermissionGroupIgnoreBatteryOptimizations,
PermissionGroupNotification,
PermissionGroupAccessMediaLocation,
PermissionGroupActivityRecognition,
PermissionGroupUnknown,
PermissionGroupBluetooth,
};

typedef NS_ENUM(int, PermissionStatus) {
PermissionStatusDenied = 0,
PermissionStatusGranted = 1,
PermissionStatusRestricted = 2,
PermissionStatusLimited = 3,
PermissionStatusPermanentlyDenied = 4
};

typedef NS_ENUM(int, ServiceStatus) {
ServiceStatusDisabled = 0,
ServiceStatusEnabled,
ServiceStatusNotApplicable,
};

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

No branches or pull requests

4 participants