unused code in xcode project - app store update submission - ios

I'm submitting an update to my first application on the iTunes (update 1.1). I was wondering if it would be an issue if I left code in the project that went completely unused.
I have two examples:
I will be doing localization in the update after this but I've
already put in NSLocalizedString and the localizable.strings file.
This really isn't necessary at this point until I get back
translations and I submit 1.3. So currently it's just English.
Next is I'm trying to add "log in with Facebook" to my application. It works perfectly when the user logs into Facebook with apple settings. Unfortunately, if they don't log in via apple settings and only directly in facebook application. when they select log in with facebook on my application I'm getting errors.. I'm still researching how to fix that (super frustrating) but my question is if I just disable/hide the button in my app will apple care that I have a method and hidden button that isn't called/used?
Should I comment out the unused code? or will apple not care that there are unused methods?
Thanks in advance,
James

Apple doesn't care about your code. You can submit it.

They don't care about unused code, as long as you don't use anything that's from private API or so. You can go ahead and submit.

It won't matter as long as your code isn't impacting the stuff that is working. In many cases the dead code won't even be compiled; if it really concerns you, can you force the compiler to perform aggressive dead code stripping.

Related

Does Apple allows force update to newer version for iOS Applications?

Does Apple allows any category of iOS application (i.e games or any type) to force users for new version update, without update later or cancel button (if user don't want to do or intend to do it later)
Apple used to reject applications on such scenarios, Please correct me if I am wrong.
An application which currenly forced me to update is as follows:
https://itunes.apple.com/us/app/farmville-2-country-escape/id824318267?mt=8
Please find screenshot attached.
After new version release whenever I open this application, it has only one button which says "Upgrade Now".
I am unable to use until I click upgrade button.
I am wondering is it mistake on Apple review process or is it really
allowed to do now?
This process never really went through the apple verification process.
The logic for this probably is...
-) On launch check for update
-) If a update exists, show prompt and lock the application
If the application was being reviewed, then the reviewer never saw such scenario. I am pretty sure if the reviewer saw such locking mechanism, they would simply reject the application. Either way if you really want to force a user to a specific version, this seems to be the best way forward.

Xcode for app approval by Apple

I have a rather long app, about 20 pages and some of the code should probably be re-coded, my first app with Xcode and I learned a lot along the way. I could add a few objects to replace string arrays etc and make the code more readable. I was wondering if Apple looks at all the code when submitting to the app store or if they just want it to work with no errors. So I guess the question is ... should I 'fix' my code before submitting it?
I don't think Apple can access your code unless they can decode your binary app back to source somehow (It is very difficult to do that). They do perform some testings on your binary project (such as networking) and play around your app a little bit to check if your function provided is valid and works as described without any serious bug.
As long as your app works and does not violate any of the App Store Review Guidelines you should be fine, you can check the Review guidelines here to get more information about the review process and what Apple expects from your app.

iOS Facebook Login "Given URL is not allowed by the Application configuration"

Believe me, I have read all the other questions on this topic. None of them solved my problem (or were even quite the same problem). Facebook login has been working perfectly fine for me for weeks... Until yesterday when suddenly it started breaking and giving me this error.
Before yesterday, when I logged into my app with the Facebook SDK logInWithReadPermissions method, it would say "You've already authorized [app name]!" and be perfectly happy to log me in and move on. Then suddenly it started failing with this error:
Given URL is not allowed by the Application configuration: One or more of the given URLs is not allowed by the App's settings. To use this URL you must add a valid native platform in your App's settings.
The weird part is I hadn't changed any of the Facebook app's settings at all. This just suddenly started happening; five minutes before it worked, next build it didn't. Nevertheless, I looked up the error message and found a ton of things people suggested to do on the facebook developer page to fix the problem... Mostly involving the Valid OAuth redirect URIs field, not that I could quite get a clear answer of what you're supposed to put in there for an iOS app... They always said to put your website address. I don't have a website, I have an app... What gives?
So I knew I hadn't made any changes to the Facebook developer area to cause it to break, and I'd tried every change there that I could find on the internet. So I pulled down an old working copy to test that, on the off chance that somehow code I'd written was the problem. Nope; code from a week ago, that worked perfectly fine, still gives me the same message.
If the problem isn't in the code, and changing things on the FB site doesn't do it... I'm out of ideas. If there's something else I need to do on the FB app to fix this, suggest away and I'll give it a try... And if it works that's great, but I'm still not going to understand why it broke in the first place when I didn't make any changes... Anybody able to help me out?
I had exactly the same issue.
Actually you just have to add platform in your app settings
So here are the steps
Open https://developers.facebook.com and select your app
Settings > Basic > Add Platform
3.Now select iOS from the window and add your Bundle ID and rest of the information and click on Save changes
and that's it.
Hope it helps you .. All the best
I had exactly the same issue today.
Same thing Facebook kept saying "You've already authorized [app name]!" in the past. Which I found strange since all my other apps didn't display this message.
In the end I figured that I didn't add an iOS platform for the Facebook app in Settings. I don't understand why it worked before :)
So try to add an iOS platform and don't forget to add your bundle ID.
I hope this works for you :)
Ok, I remember having a similar problem with a website that used Facebook to apply a discount "friend of the business page? get x% off your order" - anyhoo, turns out I needed to add both the www and non-www versions of the website to the settings in the Facebook App (https://developers.facebook.com -> My App -> Settings -> App Domains)
I've revisited this and added "iOS" as a native platform (found at My App -> Settings) # This would be first thing to check. The second thing would be to look at the "Quick Start" section for further assistance, which can be found in the top-right section of that iOS app settings.
Facebook can and will change things willy-nilly so it's unpredictable as to when things break or not.
I'd be interested to know when/if and how you resolve this.

CFBundleIdentifier Collision

I am doing an Update to my app. I added a Watch Extension and I had many errors regarding provisioning profiles and so on when trying to submit the binary. However, I somehow managed to get it to work and submitted my update. Today I was rejected because of some small issue. I quickly changed it and now I am trying since hours to resubmit, but now I am getting this error:
CFBundleIdentifier Collision - The Info.plist CFBundleIdentifier value
'com.mentalfaculty.Ensembles' of 'MyAppName.app/Ensembles.bundle'
is already in use by another application.
I don t really understand what is wrong. The thing is, I did just fixed a really small thing, besides this I didn t change anything, I used same provisioning profiles since some days ago when I was able to submit, so I really don t get the problem what has changed from my last submission. I also don t understand this error message: what other application?
"Ensembles" is a framework that does Core Data iCloud Sync. I am using it since two App versions before and never changed something. I just followed the install instructions, and I had to integrate that Ensembles project in my own project. So this framework is kinda a project within my project. It has it s own info.plist. Obviously that error has something to do with it, but since I am not really an expert in these things, I m afraid to change something.
So why was I able to submit two working and approved updates, was able to submit one update binary (that was rejected) and now getting this error all the time although I really didn t change anything and did the same steps when I was able to submit some days ago?
Would be really thankful for any help here !
Thanks !
I am the developer of Ensembles, and started hearing of this error a few days ago. It seems something has changed on Apple's servers, and even bundles that are just Resources, like Ensembles.bundle, must have a unique identifier. It is not clear if this is a new policy, or an overzealous script on their server.
In any case, the solution is reasonably straightforward: you can just go into Ensembles.bundle and change the bundle identifier to something unique of your own. Eg. com.mycompany.ensembles.bundle
Update
Apple seem to have resolved this issue server side.
Thanks Drew for your help again, already helped me with another Ensembles related question in another thread here! Your framework is really great, so easy to implement and it takes away all that iCloud integration pain right out the box. If you want to see your work in action, check my profile, there is a link to my app. Mentioned your work of course in its settings bundle.
Last night I ended up doing exactly that, changing the Bundle Identifier in the Ensembles framework. After that iTunes Connect accepted my built. I was just afraid of changing something there and screw all up, but at least from my tests on my devices, it still seems to work like before... Strange because I uploaded a built just 10 days ago without the need of changing the Bundle Identifier, so Apple must have changed something really recently.
So for others having that problem, what I did:
Ensembles iOS.xcodeproj - Ensembles Ressources iOS - Ensembles Ressources iOS-ibfo.plist
I changed the Bundle identifier from
com.mentalfaculty.${PRODUCT_NAME:rfc1034identifier}
to
com.mentalfaculty.MyCompanyName.${PRODUCT_NAME:rfc1034identifier}
Thanks !

disabled feature in iPad app

i want to release an iPad application to app store. in my application on dashboard there are six buttons and on tap they open six different screens. but among them one is disabled. User is unable to do anything with it. We just kept it in the app as we are going to implement that feature in the next version. is that fine? is there any chances that my app will get reject by app store guys because of this.
Any help would be appreciated. Thanks in advance.
As per my experience Apple will Reject your application saying that either you have to implement that functionality or you have to remove that disabled button.
it may be rejected based on AppStore Review Guideline:
2.9 Apps that are "demo", "trial", or "test" versions will be rejected. Beta Apps may only be submitted through TestFlight and must follow the TestFlight guidelines
it would be more reasonable to implement the functionality; or not showing such features which are not part of the application at all – none of those cases cause rejection.
Why don't you add like a simple alertView saying « This feature will be available in the next version, stay tuned ! » or something ? Would be a way better UX overall. Either that, or hide the button for now. Either way, don't let a button do nothing with no user feedback, this sounds terrible.
I don't think app store will reject your iPad application. You should use rather web view control(in Android) in which you can show any web page or something like that, if you want to provide the facility that after installation of your app, uses can get the updated details from it. Just give it a thought.

Resources