Definite way to make iOS App validation fail? - ios

Sorry, if there is an obvious answer, but I didn't find anything.
Is there a known way to definitely make the App Store validation process (the one while uploading the App) fail but will still work for Ad-Hoc-Distributions? In code, not info.plist configurations or something.
I tried private APIs such as "[UIApplication addStatusBarImageNamed:....]" but they only seem to be checked during the actual review, that's not what I want.
I'm being a bit paranoid about my builds configurations (and using the wrong one for a live submission) and want to have an "assert" style fail option in there that makes sure I don't upload a build created with a wrong configuration.

You could use a different (developer) code signing identity for your "wrong" build configuration. This will make the upload process fail.
Or maybe you could use "invalid" combinations of iOS requirements / supported architectures. For example only support armv7 but minimum require iOS 3.0 - that should be able to compile, but not work on a device.

Add a entitlements file this is signed with a code signing identity of a specific app. Just add this and usually it's not building.

Related

How to work out which frameworks are triggering privacy-sensitive .plist issues

I've got the classic problem of iTunes rejecting my .ipa because it's missing a bunch of .plist entries for 'privacy-senstive data' (in my case calendar, contacts, microphone, Apple Music and Siri!), despite my app having nothing to do with these frameworks.
I want to work out which 3rd party frameworks in my app are triggering this problem, rather than take the easy way out and just add the .plist entries.
Is there a way to analyse your .ipa or the files it contains to work out which 3rd party dependency is causing this issue?
Just to be clear, I understand I could just add the required .plist entries and this problem would go away - my question is specifically how to work out which dependencies are triggering this problem.
despite my app having nothing to do with these frameworks.
Is your Link Behavior in your release configuration set to Don't Link?
If so, the non-stripped Xamarin.iOS.dll references everything and will cause all kinds of privacy/entitlement issues just due to the fact that your app is linked to them but actually never uses them.
The default Release configuration used to be Link Framework SDKs Only (-linksdk) but in the recent releases that does not seem to be the case even though the documentation states that it is.
Change the behavior to Link Framework SDKs Only, create another archive and ipa and see if Apple likes that version ;-)

Uploading multiple builds of same iOS Application

I want to upload two build of same app with little UI changes on app store with different account. Can I upload the builds?
I have an app with multiple client so I want to upload builds for each client with their own account. I have modified the UI for each clients.
Yes, you can. What I do in similar situations is that I use one project for that (as you already have). And then I crate a copy of a target, so that I can customise it (custom logo, custom icon, ...).
To apply customisation in code I take advantage of "Custom Build Configurations". Here on SO I've described how I do this (as of writing it's the third answer to the question) custom Build Configurations
Sure you can, just make sure that the bundle identifier is different.
No issues in doing that. Just take care of the following things which must be different:
Logo
Bundle Identifier (as suggested by Fabio)
package ids of in app purchase items, if any
App preview images/videos
If you are using iAds for showing ads in your app, make sure you do not use the same provider account.

How to programatically determine whether iOS app is from app store or has been copied to device during development?

I have some debugging code that I want to run when my app is either running in the simulator, or running on a development device (with or without debugger attached). I don't want this debugging code to run when the app is running on a device after being downloaded from the app store.
Is there any easy way to achieve this?
Note: The above-mentioned code will be in a library that will be used by other developers, so I would prefer to use some code that I can embed in this library, without requiring any further action from the developers using the library.
Although my library is a C# library (Xamarin.iOS), any Objective-C, Swift, or Xamarin.iOS answers would all be useful.
When you're running it on the simulator or in Xcode, you can set the Scheme to debug and just put if-statments in. When it runs from the store it won't be in debug mode unless you've hard coded that somewhere.
To answer your question directly: No you're not able to detect the apps source (App Store Vs Xcode deployment) as far as I know.
You can use DEBUG macro, it's defined in Objective-C projects for debug builds. But better way is to use your own macro to enable additional logging. Add information about this macro to docs and developer will decide to enable logging or not by defining it in his project. Also how to set preprocessor macros I described in this answer.

Will Appstore reviewers allow us to use dynamic library in iOS8?

I read many articles about dynamic library usage including this page "Can you build dynamic library...".
As apple document said, "Frameworks for iOS. iOS developers can now create dynamic frameworks. Frameworks are a collection of code and resources to encapsulate functionality that is valuable across multiple projects. Frameworks work perfectly with extensions, sharing logic that can be used by both the main application and the bundled extensions.", see full page from here.
Taking the security issue as consideration, I got the reject reason of dynamic library before iOS8, see details from "DarkDust's answer". But, how does it "just work" in iOS8? #appstore_reviewers?
Anyway, currently I'm writing a sample demo app and try to upload it to Appstore for review, the main feature is downloading a framework from internet to client and dlopen it. Hope that really "just works"!
Besides, the deployment target is iOS7.0, not sure it could works well in it.
I didn't get a so clear understand on differences between "dynamic library" and "framework", I think they are the same and in this thread I mean "Cocoa-touch framework" which could create in Xcode 6.
Some background: I'm trying to build an iOS app which does't contain extension feature, my cocoa-touch framework is for easy expand without uploading a new version as it comes from internet....
UPDATE
I published a demo project GMDemo here, will try to upload to Appstore.
UPDATE2
I failed to dlopen my dynamic framework with invalid code signing error after many tries in iOS device. Sorry, no good news here. (Almost forgot to update this question, sorry! BTW)
App Store Review Guidelines explicitly prohibit that in 2.4.5 Apps that download code in any way or form will be rejected https://developer.apple.com/app-store/review/guidelines/
UPDATE3 just use the same code signing!!!
I have test it in ad-hoc environment!
when my dynamic library use the code signing with the same code signing,It works,
otherwise,crush!!

Defining Facebook URL Scheme at compile time on iOS

This question could also be a general "How to change info.plist contents at compile-time" but I know it's a complex issue that is handled differently on iOS and MacOSX. The thing is that specifically when working with the Facebook SDK, it feels kind of wrong supplying my FB app-id twice - once in the "URL types" dictionary under "URL schemes" in the app's info.plist and once in my code. I want to be able to change the app-id dynamically from within my code without touching the info.plist file. I looked into Apple's launch services and found a potentially helpful "LSSetDefaultHandlerForURLScheme" method, only to find out that I was looking at the MAC developer library. I saw some other SO questions about this issue but the general opinion seems to be that this is not doable. Any ideas that don't involve pulling information out of the plist at compile time? (I want to be able to support several app-ids that are defined in a specific header file in my code).
Thanks!

Resources