Archive

Archive for the ‘App store’ Category

SOLVED: Application executable is missing a required architecture. At least one of the following architecture(s) must be present: armv6

June 24, 2011 11 comments

The Problem :

I upgraded to a recent version of XCode, let us call it 4.x.x and when I submit my app to the appstore after making a release build, Application Loader slaps me in my face with this error “iPhone/iPod Touch: Application executable is missing a required architecture. At least one of the following architecture(s) must be present: armv6″
When I went to build settings for my project and saw the architecture settings, I could only see armV7. ArmV6 was completely missing and I couldn’t do anything to add armV6 back.

My 2 days of effort to solve this problem. Here goes :

  1. Tried every damn thing to resolve the architecture issue as suggested by these posts ( I have tried 10 more posts but lost the links to those :
  2. Installed the previous stable version of XCode, this completely fuc….ed! my XCode. I mean XCode wouldn’t even launch after this.
  3. Installed the latest version of XCode again, stuck with same problem
  4. Finally uninstalled latest version of XCode using this command : sudo /Developer/Library/uninstall-devtools –mode=all. Don’t forget to REBOOT !! I forgot to do that and had to pay the price with 2 more hours of wasted effort.
  5. Reinstalled old stable version after SUDO command and reboot in step#4. Things started to look better, but ended up with this new problem. Basically, my project’s name disappeared from the Dropdown next to the RUN and STOP buttons in the top-left corner. I could only see the libraries I was using.
  6. Finally solved that by clicking Product –>Manage Schemes and clicking “AutoGenerate Schemes”, which added my project name back in the list

I am a happy camper now :) The whole point of me blogging about all this stuff is to share my experiences and help a fellow developer out there so that he/she doesn’t have to waste the same time and effort which I had to. Hope it helps someone!

How to check for Network Connection in your IOS apps

June 16, 2011 4 comments

The Problem :

IOS apps need to handle network connectivity very carefully. An iOS user may travel from a Wifi connection to a 3G connection to a dead spot all while using your app. For this reason, Apple is extremely strict about developers handling network connectivity problems elegantly. They will outright reject your app if it errors out due to no network.

Why doesn’t Apple do it for me? 

Since this is such a common requirement, you must be wondering why IOS (even IOS5) doesn’t handle this for the app. All Apple has to do is allow developers to add a .plist setting called “NetworkRequired=1″ and iOS should handle the error for you. Since, all network calls will go through iOS SDK stack, it should be able to catch the errors right?

The most obvious reason that comes to my mind about why they want you to handle the issue is – Only your App knows what to do when a network failure occurs.

  • Maybe the network failure is something which you don’t care about and the app can continue working.
  • Maybe it is a critical error and you need to notify the user about it.
  • Maybe your app can afford to retry the operation based on the nature of the network API call.

So, it makes sense for your app to handle the network issues.

The Solution :

So, the solution is very simple. First make sure that you have a helper class that you use to make every single network/API call. This way the network/API code is in one place. Easier to maintain and easier to add error handling.

In Loqly (iTunes Link), we use the below two functions to check for internet.

  • (BOOL) connectedToNetwork  is used when we just want to check for a network connection and not notify the user if an error occurs.
  • (BOOL) checkInternet is the same but automatically shows user an error message to notify him if no internet connection is present.

There is no rocket science here. In fact this code is available in one of Apple’s own samples and we have just used it in our app.

- (BOOL) connectedToNetwork
{
	Reachability *r = [Reachability reachabilityWithHostName:@"www.google.com"];
	NetworkStatus internetStatus = [r currentReachabilityStatus];
	BOOL internet;
	if ((internetStatus != ReachableViaWiFi) && (internetStatus != ReachableViaWWAN)) {
		internet = NO;
	} else {
		internet = YES;
	}
	return internet;
} 

-(BOOL) checkInternet
{
	//Make sure we have internet connectivity
	if([self connectedToNetwork] != YES)
	{
		[self showMessage: @"No network connection found. An Internet connection is required for this application to work"
				withTitle:@"No Network Connectivity!"];
		return NO;
	}
	else {
		return YES;
	}
}

Someone has answered this question in great detail on Stackexchange as well
WARNING: As must be obvious from the above,  don’t use the IP address of a user to uniquely identify him for any purpose. Since the user could travel from wifi to 3G to edge to another wifi in minutes, his IP is likely to keep changing. UDID is a good option for this.

Beta testing your IOS Apps with TestFlightApp.com

You are almost done implementing that brilliant “iPhone app idea” in your mind and cannot control your excitement for sharing your iPhone app with the world.  But you know in your heart that, it is the programmer speaking within yourself.

The cold businessman/entrepreneur within you unfortunately knows, that there is a Beta testing period ahead where you will want to get at least 50-100 users to use your app, report bugs and suggest changes before you can even think of releasing the app to the AppStore.

The Problem :

The problem now is Apple has made it so difficult for you to do an Adhoc distribution for your app, it is nothing short of a nightmare. Let us start with a few things you would have to do for Ad-hoc dist :

  1. Find users of course, to test your app in Beta. These would ideally be non-technical users who represent a real audience, rather than you and your geeky friends doing the testing for you.
  2. Generate an AD-HOC cert from Apple developer portal, download it and sign your app with that
  3. Email all these non-techie users and ask them to send you their UDID (good luck with that!). Most probably they will think you are asking for their SSN !
  4. Add these UDIDs to the provisioning portal and download a new provisioning profile and update it in your project
  5. Make an AD-HOC build, create an .IPA file and email it to your beta testers.
  6. Get your beta testers to download the .IPA to their desktop, drag and drop it to their iTunes and sync their phone (again good luck with this! Nobody every syncs their iPhone to the desktop iTunes btw.)
  7. We tried to do this with Loqly (iTunes Link) and out of 80 users who were willing to help, 10 users replied with UDIDs and believe it or not, 2 users were able to install the app through iTunes.
  8. Now, imagine fixing a bug and sending out an update. In our case, only 1 person tried to update and his iTunes kept erroring out.

The Solution :

Enter the awesome folks at http://testflightapp.com. We discovered them when were on step 8 above. i.e our Beta testing was pretty much halted!! Testflightapp was in their Beta at that time. And they were God sent angels for us. Let us see how testflight helped us :

  • Step#1 and #2 above – We had to take care of it ourselves of course.
  • Step# 3 – You add a user’s email ID to testflight app and it automatically emails them and the moment they click accept/register on their iPhone, their UDID magically shows up in testflight app portal.
  • Step#4,#5 – You still do it manually
  • Step#6 – This is where the magic happens. The beta tester gets an email on his IOS device, he clicks the install button and bam! the app is installed.
  • Once we integrated testflightapp.com, we got 70 users to do our beta testing for us.

Bottomline : As you may have noticed, there is nothing magical about testflightapp, since it just adds a layer on top of what Apple offers you. But the key is to notice that they have taken care of the main pain points. i.e Getting the users to Signup for beta, download the app and receive future updates.

Error reporting in your IOS apps

The Problem :

You are a good programmer who likes to know what the code is doing before copying and pasting it from the internet. You always write efficient code and your code never leaks memory. You use instruments and profiling to profile your leaks, zombies, allocations etc.

But shit happens! And no matter how hard you try and how good your testing team is, your app will eventually crash. I have seen all sorts of good apps crashing. Google App, Loopt, Facebook, Heytell, Instagram to name a few which have crashed on me. I am a power user though, which means I have around 70 apps easily running on my iPhone all the time. This causes apps to run out of memory and guess what..when you run out of memory–>BAD THINGS HAPPEN! = CRASH!

The Solution :

So, as a good developer, you should definitely build some error logging/reporting capabilities in your apps. Yes, Apple iTunes has the option to collect your crash logs and stuff. But hey! please leave a comment on this post; I am curious to know how many people use it.

At Loqly – http://bit.ly/e5u4jv, we use something called Hoptoad for error reporting for both our server side errors and IOS app errors. It is amazing that with a few lines of code how nicely Hoptoad takes care of everything for you. If your app crashes, the next time you run the app, Hoptoad presents this screen to the user, allowing him to send a crash report to you. The crash report has the standard stacktrace and it normally takes me 10 seconds to narrow down the culprit by looking at the report.

Obviously, I won't show a Loqly crash report here :)

Yes, it is debatable if you want to admit on the user’s  face that your app crashed last time. It is a little shameful yes, but hey who are we kidding here? Do you really think the user doesn’t realize that your app crashed, just because IOS simply closes your app and you don’t see the nasty Windows Dr. Watson message.

How not to get your IOS app rejected by iTunes AppStore

Just sharing stuff I learned from my own experience of writing IOS apps. Check out our latest app Loqly – http://loqly.me. Here is the iTunes link:http://bit.ly/e5u4jv (it is free!)

  1. Do not use a screenshot which shows your app running in an IPhone. App Store does not like images of their IPhone in the screenshots. They will reject it immediately. Just take a shot of your application ‘s screen only.
  2. Apple asks you to submit a Main Logo (512 * 512 px PNG) which shows up as the big preview in ITunes and a small logo (47 * 47 px) which should be included as part of your App Bundle. They are extremely particular about the sizes and your main logo should match the mini logo. I made the mistake of submitting two different pictures (with the same theme) but promptly got rejected.
  3. Make an application which at least in Apple’s eyes will serve some purpose to the public. I know that they rejected this app called “Pull my Finger” (and it farts) and it never made it to the App Store, because Apple said it serves no purpose. Although, with weird apps like Flashlight etc, I don’t know why some apps make it to the app store and some don’t.
  4. DO NOT use any undocumented APIs. This is a recipe for rejection right away. eg. UIProgressHUD is the most common API that people use to show hourglasses but get rejected right away.
  5. Do not write an app which provides competition to any built in IPhone apps. eg. Providing a much better Photos application will probably cause Apple to think that it is giving competition to their own photos app
  6. Do not write an app which provides functionality which is “unofficial”. You must have heard of how the app which would allow you to tether you IPhone to your computer to share internet got rejected by App Store.
  7. Also, make sure your app complies with the UI guidelines. For eg. if it takes too long to load or shows an hourglass for too long, it will get rejected. Why? Because Apple doesn’t want its users to perceive that the IPhone is slow just because your app is slow.
  8. And PLEASE FOR GOD SAKE! Don’t do this (unless your are looking for media coverage) : http://www.pcworld.com/article/163717/baby_shaker_app_approved_then_removed.html
  9. If your app needs an internet connection, but does not notify the user if there is no internet connection present, it will get rejected. Gracefully handle lack of internet connection and notify the user. See this Post for how to do this
  10. With AT&T adding 200MB and 2GB caps to the previously unlimited data plan, Apple is very mindful of the amount of data your app transmits. I don’t write media streaming apps, so no advice there. But for a typical app supported by a backend webservice, use JSON or BJSON format  instead of XML. Only pass data that is required and cache on the IOS device if possible. Three20 lib has a nice TTImage which will cache images on the device and will not request them again if they haven’t changed on the server.

App rejected because of undocumented API: UIProgressHUD

When we first released Loqly (http://loqly.me) in Dec 2010, we had used UIProgressHUD to show please wait type hourglass messages to the user when the app was doing something in the background. UIProgressHUD is the same API which Apple internally uses in their apps to show the nice translucent hourglass.

Unfortunately, Appstore took 5 minutes to slap us with a rejection. Worst part is, I had been coding all night and submitted the app at 5AM in the morning in the hopes of getting at least 3-4 hour nap. But 5:10 AM, my iPhone gave me the new mail sound. And there it was…the dreaded rejection email !! I was so tired by that time that I let my team know about the rejection and just passed out.

Next day after doing some research, I came across MBProgressHUD by Jonathan George. It is an excellent replacement for UIProgressHUD and in fact has much more functionality. We just added Jonathan’s code and we were approved in no time!!

Click here to view full size

How are your users using your App – Analytics

May 10, 2011 1 comment

The Problem :

You have tens of thousands of users and you are very happy about blowing past the chicken-egg problem of acquiring users. But now you have a new set of problems.

  • You have no idea how people are using your app?
  • Which screens do your users use the most?
  • How often do they use your app?
  • On an average how long doe they use your app for (Session length)?
  • Which countries or states have the most users? etc etc etc.

These are common questions which any app developer should have. And you can always solve it by adding lot of logging and write complex SQL queries to mine this information. But don’t you think this ought to be a common problem and there ought to be a common solution for this? Just like Google Analytics and other services work for your website.

The Solution :

The answer is yes !! There are quite a few products which allow you to do this. What we have used in Loqly -bit.ly/e5u4jv is a free product called Flurry Analytics. This is an excellent product and the best part is it is free. What more can you ask for. The amount of data you can gather is mind blowing. And it presents it nicely in a graph too. Even my grandma can see those graphs and answer all the above questions for me :)

Click here to view full size

How to get people to rate your IOS app

May 10, 2011 4 comments

The problem :

Everybody knows that Appstore’s rating system is at least partially broken. I mean how many people are there who after downloading your app, will again go back to AppStore, search for your app, go to rate screen and give you a rating. The only reason people normally rate is when they are pissed off by your app or are annoyed by the advertisements and are deleting your app. At that time, they will simply go and leave bad reviews for you.

So, how do you make sure that a person who is actually enjoying your app and using it on a daily basis leaves a favorable review for you ?

The solution :

This is what we have used in Loqly – bit.ly/e5u4jv It is not the be-all, end-all solution, but is definitely one of the things you may have noticed in other apps. Please feel free to leave comments if you know of any better mechanism

Enter Appirater, written by Arash Payan. Frankly speaking, Apple should have included this kind of functionality in the SDK itself. You would simply add a setting in your .plist file to enable prompts for rating and IOS should keep track of how or when to prompt a user.

Since, we all do not live in an ideal world but are still fortunate that there are people like Arash who like to share their work with the developer community, you can use his code. Just one line of code will get you going.

And appirater is quite configurable too. For eg. you can tell it to prompt the user to rate your app, after the user has used it for 20 consecutive times in past 2 weeks. If someone is using your app that much, there is high likelihood that they will rate your app if you ask them to do so.

Someone pointed out that I have written this article and yet Loqly has only 7 ratings. Good question but here is my answer: First of, I have just shared a good way of getting people to rate your app. I am not claiming that it will bring you any kind of success or will drive users to your app. But to specificially address the issue, we added this feature to Loqly only a few weeks back and in order not to spam users to rate us, we wait for a long time and several usages to prompt the user. So, basically the rating logic hasn’t “kicked in” yet.  Will report here what I find out though.

Emergency Rollback to Previous Version of your App

May 10, 2011 1 comment

The problem :

So you worked your ass off on some cool new features in your IOS app. Submitted it to the appstore and can’t wait for it to get released. Finally, the email shows up “Your application is ready for Sale”. Yipee! you jump with joy, download the latest and greatest update from Appstore to do a smoke test to make sure it works as expected. But wait! something went wrong. You accidentally introduced a major bug in your app and it is crashing.

You know that there is nothing called a quick fix, because Appstore takes a week easily to approve your updates. You start to panic, start googling on how to rollback your update. But don’t find anything. Then you end up on my blog…..

The solution :

Don’t worry. We at Loqly – bit.ly/e5u4jv were in the same boat some time back as you are right now. And here is what I did to get my bug fix out in 4 hours !!!

  1. First of there is nothing called a rollback to previous version on Appstore. I have no idea why Apple has done that.
  2. Second and most important –> fix your bug!! I know you are panicking but please stay calm and take your time to test the app thoroughly. Lot of times developers only test new functionality but fail to regression test existing functionality. So, take a chill pill and do not repeat the mistake you made earlier. Make sure that your bug is fixed and everything else looks okay.
  3. Now, submit your app to itunesconnect.apple.com as a regular update.
  4. All done! Now send an email to App review team. Here is what I sent them when we ran into problems
  5. End result : The update was approved in 4 hours. Good luck !

EMAIL TO APPSTORE REVIEW TEAM
We would like to request an expedited review of XXX as there was a critical bug accidentally introduced in the last released version (xxx), which causes our app to crash (or show NULLs)

——————————

To test this scenario you can do this : blah blah (you need to tell them how to recreate the bug)
———————————-
We have fixed this in xxx.1.4 and would like to request you to please expedite our review so that our customers are not affected by the bug.This is also the first time we are requesting an expedited review and we assure you that we have a proper testing team in place and we will make sure to take necessary steps so that these kind of problems do not arise in the future.

Follow

Get every new post delivered to your Inbox.