NSPhotoLibraryUsageDescription in Xcode8 - app-store-connect

Update:
I attempt to add a String value to the "NSPhotoLibraryUsageDescription" key.
And it works.My build version is now available on my TestFlight.
ps: 构建版本 means Build Version
But I want to know why Apple Store just let me add String value for "NSPhotoLibraryUsageDescription" key rather than "Camera Usage Description" or "Location When In Use Usage Description"?
And how to localize the info.plist.
Old:
I've uploaded many build versions to iTunes Connect.But TestFlight shows none of these build versions.
Then I search this issue on stackoverflow. And I know this is caused by usage description. I add the NSPhotoLibraryUsageDescription in my Info.plist.
However, Apple Store team email and tell me that:
Dear developer,
We have discovered one or more issues with your recent delivery for "Family Health Tracker". To process your delivery, the following issues must be corrected:
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
Once these issues have been corrected, you can then redeliver the corrected binary.
Regards,
The App Store team
They still tell me add NSPhotoLibraryUsageDescription

Localizing of info.plist file may be very unuseful, especially if you use many languages in your apps.
The simplest way for localizing NSPhotoLibraryUsageDescription, NSLocationWhenInUseUsageDescriptionor NSCameraUsageDescription keys is to describe it in InfoPlist.strings file.
Create new *.strings file with name InfoPlist;
Press Localize... button in file inspector and choose the default language;
Add new records in your new InfoPlist.strings file. For example
in English:
NSLocationWhenInUseUsageDescription = "Location usage description";
NSPhotoLibraryUsageDescription = "Photos usage description";
NSCameraUsageDescription = "Camera usage description";
For more information Apple docs

Make sure that "NSPhotoLibraryUsageDescription" has value assigned before uploading the app to iTunesConnect.

Simply add these lines to your info.plist file
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo Library Access Warning</string> //For NSPhotoLibraryUsageDescription issue.

To localize the Info.plist:
Click your Info.plist
Show your Utilities, then click File inspector
This is a button Localize, click it.

I had the same problem with two applications, the solution shows you the itunnes connect via mail:
info.plist review your file and tries to add the following fields:
Privacy - Photo Library Usage Description
Bluetooth Sharing - NSBluetoothPeripheralUsageDescription
each with a text explaining the reason for its use.
You can check here the permissions that now requires iOS 10 in its info.plist here:
https://blog.xamarin.com/new-ios-10-privacy-permission-settings/
This worked for me.

Try this it work for us,
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires access to the photo library.</string>
For more details please refer Best Answer
Hope this will help for some .

The missing keys are related to some APIs requiring some usage descriptions defined in the .plist keys. Before adding any keys if you know that your app doesn't make any specific usage I will recommend you take a look at this official guide from Apple to identity faulty API classes. As an example I simply have a comment out on a line containing UIImagePickerController. This was enough to get the binary rejection from Apple; while I didn't access to the user photo library. Once you validated this step you can go ahead with other solutions mentioned here.

Related

Titanium: Notification with download status

I want to create a notification that will include a download status, such as the photo below (marked in yellow:
Is there a special way of doing these? A code sample would be nice...
There indeed is a special way of doing it. Usually these kind of features require a module to be included. This can easily be done by using Gitt.io.
The module in question is nc.progressnotification
You can find the module on Github, or through Gitt.io.
An example is added to the app.js file in the example folder

Icons, Asset Catalog and Info.plist confusion

I have an app that started life for iOS 5 and has been updated ever since. For iOS 7 I have switched over to using an Asset Catalog for all the resources, which is nice and appears to work well. However, when I try to submit to Apple I get validation errors:
Invalid Image Path - No image found at the path referenced under key 'CFBundleIconFiles': 'Icon#2x.png'
I get the same error for the other icons, too. These icons do appear in the Asset Catalog and the names -- right down to the case -- match exactly as far as I can tell. The Asset Catalog is in the "Copy Bundle Resources" and all the resources appear in the right place when I run the app on both my iPhone and iPad (in iOS 7) and in the Simulator for iOS 6.
I have updated the app to use the minimum deployment target of iOS 6.
So, how do I successfully submit my update to Apple? Do I need the references in the Info.plist? Are there any other settings that I should check? Is the warning spurious and something that I should ignore (after raising a Radar)?
When an asset catalog is compiled for iOS 6 and lower, the images are put in the root of the app bundle, as if you were just copying them the old way. When this happens, Apple names the images according to the asset name, rather than the filename, which means we can still use +[UIImage imageNamed:] to get the assets on iOS 6 and lower.
This is true for the App Icon asset, when we have the following icons set in our asset catalog:
They become compiled like so:
As iOS 6 is still iOS 6, these files must be referenced in the Info.plist, otherwise the existing system wouldn't work. Looking in the compiled Info.plist for this test app, you see that Xcode has added CFBundleIconFiles for us and so we don't need to.
I have uploaded the test project I used to github.com/danielctull-tests/AssetTest.
Okay, so here is what I ended up doing. I'm not 100% sure it's correct but I thought that it was worth sharing.
I removed CFBundleIconFile, which I don't think is used in iOS 6 and above
I used the asset name rather than the icon filename in CFBundleIconFiles
I'm not clear what the proper names are so, for the sake of clarity: by icon filename I mean the name visible in the Attribute Inspector of the Asset Catalog when the icon is selected; and by asset name I mean AppIcon, which refers to seven actual icons in my case.
This both passes Apple's validation step and appears to look okay. I don't currently have an iOS 6 device but it displays correctly in the Simulator.
I had also a lot of Problems on this matter - I was constantly getting the error with the missing CFBundleIconName and that my Icons where not found. So here is my story, maybe it will be of help for somebody. By the way, I am using Visual Studio with Xamarin.
Add an Asset Catalogue to your Project with AppIcons (the actual name of the asset is not important but just that it is for the application icons). Add all of the necessary icon sizes. For the 'App Store' icon I have added an icon without a # in the name as someone in the forums suggested, but I am not sure, if it is 100% necessary. For generating the different icon sizes there are a lot of Websites and tools that can do that for you and you just need to provide the 1024x1024 one. They will generate the rest.
In the Info.plist under 'Visual Assets' and then 'App Icons' set the source to the asset that you have just created.
Now check your Info.plist. Do not open it with an external Editor, because all of your changes will be overwritten once you build your project. Do the following - right mouse click on the Info.plist in the Solution Explorer then select Open With -> Generic PList Editor.
Check that you have the following entries:
-Property = CFBundleIconName, Type = String. Value = Assets.xcassets/AppIcons.appiconset
-Property = XSAppIconAssets, Type = String. Value = Assets.xcassets/AppIcons.appiconset
Note that Visual Studio automatically adds, when it adds something altogether, 'Resources/Assets.xcassets/AppIcons.appiconset' as the Value. But in my case the Asset Catalog was created outside of the Resources folder and therefore, my icons where not found. So, check where your assets folder was created.
CFBundleIconFiles was not needed, because Apple uses the Asset Catalog instead now.
I hope that I was of some help :)

Is it possible to customize “X would like to use your current location” on the iPhone?

Is it possible to style the location alert box: "(app name) would like to use your current location” on the iPhone?
You can only tell user the reason for using his location by setting purpose property of CLLocationManager.
EDIT:
The purpose property is deprecated in iOS 6. But there is a replacement. For iOS 6 and above you should add NSLocationUsageDescription key to your Info.plist file. If your app targets iOS versions lower than 6.0, you might want to do both.
No, it is an operating system level feature designed to protect privacy.
If it could be customized, someone would change it to something like "Do you like kittens?" and be able to gain access to location information of people that like kittens.
No this is a system feature, but you can provide a descriptif text for why you want to use the users location, this text is added to the dialog box. The property you need to use for this is called purpose and is a property on the CLLocationManager class.
Please check out this documentation: http://developer.apple.com/library/ios/ipad/#documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/doc/uid/TP40007125

How to intercept reading of plist values in Objective-C code?

We're using the new Urban Airship iOS plugin for PhoneGap.
In the plugin's plist file, we're supposed to enter the app-specific keys needed to enable push notifications.
The problem is we have two versions, free and paid, of the same app, but the plist file only accommodates one version.
Essentially, we need to modify the Objective-C code to read different plist values, depending on whether it's the free or premium version.
We currently manage both versions with the same code base and Xcode project. Unless we change the plugin code, it seems like we need to create a new Xcode project, which we don't want to do.
How do we adjust Urban Airship's Objective-C files to read different values from the plsit file?
Sorry to keep you waiting, I wanted to give you a very detailed answer instead of rushing last night :) So here we go.
First in your project we need to add a new target. Go to your project settings and right click your target. Click duplicate.
You'll get a new target probably named Target-copy. You'll also get a new info.plist file just for that target.
Next we're going to edit our Pro version's Built Settings. Scroll or search and find Apple LLVM compiler 4.0 Preprocessing. Add to both your Debug and Release configurations. I normally just go with the simple PRO=1. You also need to add PRO=0 to your lite version or it will be undefined when you try to build that version.
Now lets look at how to add a custom plist like I'm sure you'll need. First create two folders. Its important these are folders not groups. In each folder we can create a plist with the exact same filename.
Since Now you can add something to each of them. I just added a key property and a value pro string / lite string. Finally to the code. In the sample project I made I simple overrode viewDidLoad but obviously this will work anywhere. Since the plists have the same name you can load them with one line of code. They'll never get mixed up because they are only copied to their respective target. If you need to do code level based logic you can use the PRO preprocessor we made.
- (void)viewDidLoad
{
[super viewDidLoad];
// This will load the proper plist automatically.
NSLog(#"Plist Value: %#",[[NSDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:#"Property List" ofType:#"plist"]] objectForKey:#"property"]);
// Also remember we set up a preprocessor PRO. you can use it as well.
if (PRO) {
NSLog(#"Only Show for Pro");
} else {
NSLog(#"Only Show for Lite");
}
NSLog(#"This will show for both");
}
This is the method I use for all my lite/pro version apps so I can share a common codebase without copying it between projects or other complicated systems. It has worked pretty well for me so far :) Happy Coding!
Source
Figured someone may be able to use the project to look at so here it is on GitHub.

NSUbiquitousKeyValueStore error : "com.mycompany.myappname" has no valid com.apple.developer.ubiquity-kvstore-identifier entitlment

I set the entitlements file correctly.
I'm getting the cloud url.
the error happen after im trying to save values in the keyValue store.
I can write and read from the NSUbiquitousKeyValueStore,
But after the method finished, I got the error I wrote in the title of the question.
this error happen on ipad 1,
when compiling the same project to the iphone, it works ok without error.
This usually happens when you download your app from the AppStore and update it using XCode.
Have a look at the "Recommended Testing Procedure" in Technote 2285
Are you using different targets for iPhone and iPad versions of your app? Check your entitlements file and make sure it has the correct values for organization all targets.
You might also want to do a text search in your projects folder and see if any files contain the line "com.mycompany.myappname".