Tuesday, September 20, 2011

App Store Approval Process +iphone app










this is from ......
 https://developer.apple.com/appstore/resources/approval/


App Store Approval Process

Ensure your app is ready for the approval process

Read the App Store Review Guidelines

Before you submit your app for approval, ensure that it follows the technical, design, and content specifications detailed in the App Store Review Guidelines and Human Interface Guidelines. Apps that do not follow these guidelines will be returned for modification before they can be posted to the App Store. Read the Guidelines       View additional app review resources
App Store Review Guidelines

Test on Devices

Test your app thoroughly on iPad, iPhone, and iPod touch before uploading it to iTunes Connect. The iPhone Simulator is ideal for prototyping your ideas, debugging memory leaks, simulating memory warnings, and getting a good feel for how your app is going to work. However, since the iPhone Simulator simulates iOS, not hardware, it is not a replacement for testing on an actual device.

What to expect during the review of your app

App Store Review Status

iOS submissions reviewed within the last 7 days:

97%
New Apps

99%
App Updates

The App Review Team checks every app submitted in order to protect consumer privacy, safeguard children from inappropriate content, and avoid applications that degrade the core experience of iPad, iPhone, and iPod touch. All aspects of your app must comply with the criteria outlined in the App Store Review Guidelines and should conform to the iPhone and iPad Human Interface Guidelines.
After your app has been reviewed and approved, it will be set to the Ready for Sale state (or Pending Contract if your contracts are not yet in effect). If an issue is discovered during the review of your app, you will receive an email detailing the reason why the application cannot be approved as submitted. This email will provide you with a description of the issue and in many cases also provide instructions and related technical documentation to help you resolve the issue. We encourage you to modify your app and resubmit it for review.
If you have any questions about the information you receive from the App Review Team, you can send an email to appreview@apple.com. In addition, you may appeal the rejection of your app to the App Review Board. Should you need code-level assistance in making modifications to your app, you can contact Apple Developer Technical Support. Visit the Support Center for details about requesting technical support.

Check the status of your app in iTunes Connect

Once youʼve reviewed and submitted your app, you will be taken back to the Manage your Applications page. Here youʼll find the application name, version, date submitted, Apple ID, as well as the status of your application. There are 16 colored status indicators that can appear on the Manage Your Applications page after submitting an app. Log in to iTunes Connect
Waiting for Upload (Yellow)
Appears when you've completed entering your metadata, however, you have not finished uploading your binary or have chosen to upload your binary at a later time. Your app must be in the Waiting For Upload state before you can deliver your binary through Application Loader.



Prepare for Upload (Yellow)
Appears when you have created a new version, but you have not yet clicked the Ready to Submit Binary button. This state also indicates that you can now deliver your binary through Application Loader.



Upload Received (Yellow)
Appears when your binary has been received through Application Loader, but is still being processed by the iTunes Connect system.


Invalid Binary (Red)
Appears when a binary is received through Application Loader, has been processed, but your binary is invalid.  Examples of an invalid binary are: your binary icon does not meet our requirements, you have placed the payload directory at the wrong level in the .app wrapper, you attempted to use a non-increasing CFBundleVersion, etc.



Missing Screenshot (Red)
Appears when your app is missing a required screenshot for iPhone and iPod touch or iPad for your default language app or for your added localizations. At least one screenshot is required for both iPhone and iPod touch and for iPad if you are submitting a universal app.


Waiting for Review (Yellow)
Appears after you submit a new application or update and prior to the application being reviewed by Apple. This status means that your app has been added to the app review queue, but has not yet started the review process.



Waiting For Export Compliance (Yellow)

Appears when your CCATS is in review with Export Compliance.


In Review (Yellow)
Appears when we are reviewing your app prior to the application being approved or rejected. It takes time to review binaries so we appreciate your patience and ask that you allow sufficient time for the processing of your application.  When the status of your application is in review, you have the option to reject the binary you have submitted by clicking Reject Binary. This will remove your binary from the review queue and will allow for another update to be submitted. If you reject your binary, the status of your app will change to Developer Rejected and when your binary is re-submitted, the review process will start over from the beginning.



Pending Contract (Yellow)
Appears when your application has been reviewed and is Ready for Sale but your contracts are not yet in effect. You may check the progress of your contracts in iTunes Connect by clicking on the Contracts, Tax & Banking information module.



Pending Developer Release (Yellow)
Appears when the version of your app has been approved by Apple and you have turned on the Version Release Control, but have not yet clicked Send Version Live. You should also see a pending action symbol on the version. Your version will remain in this state, and thus will not be live on the App Store until you click Send Version Live.



Processing for App Store (Yellow)
Appears when the version is being processed to go live on the App Store. Once the processing is complete, the version state will change to "Ready for Sale." This is a temporary state (approx. 1 - 2 hours). 



Ready for Sale (Green)
Appears once your application been approved and posted to the App Store. When your application is in this status, you have the option to remove it from the store by going to the Rights and Pricing page and removing all App Store territories.



Rejected (Red)
Appears when the binary has been rejected.


Removed from Sale (Red)
Appears when the binary has been removed from the App Store.



Developer Rejected (Red)
Appears when youʼve rejected the binary from the review process. Existing versions of your application on the App Store will not be affected by self-rejecting binaries in review.


Important: When you self-reject your binary, you lose your place in the review queue. Your binary will be placed at the end of the queue when you resubmit.
Developer Removed from Sale (Red)
Appears when you’ve removed your application from the App Store.

Status Update notification email

You can opt-in to receive email notifications alerting you to a change in the status of your applications. Visit the Manage Users section of iTunes Connect, click Edit Profile, select the Notifications tab and click the Status Update box(es).

App Status History

You can view a log with the status history of your app within iTunes Connect.  Once a change has been made to your app, a link titled "Status History" will appear with your app details in the Manage Your Applications section. Click the link to view a history of the status changes your app has gone through. You will also be able to see which user on your iTunes Connect account made the change, if the change was initiated by Apple, and the date and time the change was made.
Determine the availability date of your app

Determine the availability date of your app

You can set the date your application will be available for purchase on the App Store when you submit your binary. If your application has not been approved by Apple prior to this date, your application will go live as soon as it has been approved. This is a global date, and applies to all territories selected. If you change this date, it will apply to all versions of your application, not just the version where you are making the change. In addition, if you set this date in the future for the release of an update that is in review, you will remove any existing versions of this app from the App Store.

Monday, September 19, 2011

List of All countries into UIPicker View +iphone

- (void)ViewDidLoad{

cityPicker = [[[UIPickerView alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height+44, 320, 216)] autorelease];
    cityPicker.tag = 10;
    cityPicker.showsSelectionIndicator = YES;
    cityPicker.delegate = self;
    cityPicker.dataSource = self;
   
    pickerToolBar = [[[UIToolbar alloc] initWithFrame:CGRectMake(0, self.view.bounds.size.height, 320, 44)] autorelease];
    pickerToolBar.tag = 11;
    pickerToolBar.barStyle = UIBarStyleBlackTranslucent;
   
    canclePikerBtn = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(dismisscityPicker:)] autorelease];
    spacer = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil] autorelease];
    doneBtn = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(donecityPicker:)] autorelease];
   
    [pickerToolBar setItems:[NSArray arrayWithObjects:canclePikerBtn, spacer, doneBtn, nil]];
    [self.view addSubview:pickerToolBar];
   
       
    [self.view addSubview:cityPicker];
   
countriesArray = [[NSMutableArray alloc] init];
    NSMutableDictionary *countriesDict = [[NSMutableDictionary alloc] init];
    NSLocale *locale = [[[NSLocale alloc] initWithLocaleIdentifier: @"en_US"] autorelease];
   
    NSArray *countryArray = [NSLocale ISOCountryCodes];
    for (NSString *countryCode in countryArray)
    {
        NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
       
        NSString *displayNameString = [locale displayNameForKey:NSLocaleCountryCode value:countryCode];
        [countriesArray addObject:displayNameString];
        [countriesDict setObject:countryCode forKey: displayNameString];
        [pool release];
       
    }
    NSLog(@"countriesDict..%@",countriesDict);
    NSLog(@"countriesArray..%@",countriesArray);
   
    [countriesArray sortUsingSelector:@selector(compare:)];
    }




   
 }

// now calling button methods




- (IBAction)countrysupportBtnclicked :(id)sender{
    scroll.frame = CGRectMake(0, 0, 320, scroll.frame.size.height - (cityPicker.frame.size.height + 70) );
    [scroll scrollRectToVisible:countrysupportBtn.frame animated:YES];
    CGRect cityPickerTargetFrame = CGRectMake(0, self.view.bounds.size.height-216, 320, 216);
    CGRect toolbarTargetFrame = CGRectMake(0, self.view.bounds.size.height-216-44, 320, 44);
    [UIView beginAnimations:@"MoveIn" context:nil];
    [self.view viewWithTag:10].frame = cityPickerTargetFrame;
    [self.view viewWithTag:11].frame = toolbarTargetFrame;
    [UIView setAnimationDelegate:self];
    [UIView commitAnimations];

}
-(IBAction)dismisscityPicker:(id)sender{
    scroll.frame = CGRectMake(0, 0, 320, 480);
    CGRect toolbarTargetFrame = CGRectMake(0, self.view.bounds.size.height, 320, 44);
    CGRect cityPickerTargetFrame = CGRectMake(0, self.view.bounds.size.height+44, 320, 216);
    [UIView beginAnimations:@"MoveOut" context:nil];
    [self.view viewWithTag:9].alpha = 0;
    [self.view viewWithTag:10].frame = cityPickerTargetFrame;
    [self.view viewWithTag:11].frame = toolbarTargetFrame;
    [UIView setAnimationDelegate:self];
    [UIView commitAnimations];
}
-(IBAction)donecityPicker:(id)sender{
   
   
    scroll.frame = CGRectMake(0, 0, 320, 480);
   
    CGRect toolbarTargetFrame = CGRectMake(0, self.view.bounds.size.height, 320, 44);
    CGRect cityPickerTargetFrame = CGRectMake(0, self.view.bounds.size.height+44, 320, 216);
    [UIView beginAnimations:@"MoveOut" context:nil];
    [self.view viewWithTag:9].alpha = 0;
    [self.view viewWithTag:10].frame = cityPickerTargetFrame;
    [self.view viewWithTag:11].frame = toolbarTargetFrame;
    [UIView setAnimationDelegate:self];
    [UIView commitAnimations];
   
   
}


#pragma mark -
#pragma mark UIPickerView delegate

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
    return 1;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component{
    return  self.countriesArray.count;
}

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{
    NSLog(@"countriesArray..%@",countriesArray);
    return [self.countriesArray objectAtIndex:row];
}

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
    countryNameLbl.text = [self.countriesArray objectAtIndex:row];
    [registerInfoDic setObject:countryNameLbl.text forKey:COUNTRY_SUPPORT];
}
//pickerview

eMail validation on iphone

- (BOOL) validateEmail:(NSString*)email
{
    if( (0 != [email rangeOfString:@"@"].length) &&  (0 != [email rangeOfString:@"."].length) )
    {
        NSMutableCharacterSet *invalidCharSet = [[[[NSCharacterSet alphanumericCharacterSet] invertedSet]mutableCopy]autorelease];
        [invalidCharSet removeCharactersInString:@"_-"];
       
        NSRange range1 = [email rangeOfString:@"@" options:NSCaseInsensitiveSearch];
       
        // If username part contains any character other than "."  "_" "-"
       
        NSString *usernamePart = [email substringToIndex:range1.location];
        NSArray *stringsArray1 = [usernamePart componentsSeparatedByString:@"."];
        for (NSString *string in stringsArray1) {
            NSRange rangeOfInavlidChars=[string rangeOfCharacterFromSet: invalidCharSet];
            if(rangeOfInavlidChars.length !=0 || [string isEqualToString:@""])
                return NO;
        }
       
        NSString *domainPart = [email substringFromIndex:range1.location+1];
        NSArray *stringsArray2 = [domainPart componentsSeparatedByString:@"."];
       
        for (NSString *string in stringsArray2) {
            NSRange rangeOfInavlidChars=[string rangeOfCharacterFromSet:invalidCharSet];
            if(rangeOfInavlidChars.length !=0 || [string isEqualToString:@""])
                return NO;
        }
       
        return YES;
    }
    else // no '@' or '.' present
        return NO;
}

Tuesday, August 30, 2011

remove duplicate values from NSMutableArray in Objective-C

NSArray *copy = [YourMutableArray copy];
 
NSInteger index = [copy count] - 1;
 
for (id object in [copy reverseObjectEnumerator]) {
 
    if ([YourMutableArray
         indexOfObject:object inRange:NSMakeRange(0, index)] 
         != NSNotFound) 
 {
        [YourMutableArray removeObjectAtIndex:index];
 
    }
 
    index--;
}
[copy release];

Monday, August 29, 2011

stretch image in UIWebView

NSString *imageName = [[NSBundle mainBundle]
                        pathForResource:@"YourImageName" 
                        ofType:@"png"];
 
NSURL *imageURL = [NSURL fileURLWithPath: imageName];
 
NSURLRequest *imageRequest =[NSURLRequest requestWithURL:imageURL];
 
	// Load image in UIWebView 
 
imageWebView.scalesPageToFit = YES;
 
 
[imageWebView loadRequest: imageRequest];

Submitting iPhone Apps To The Apple App Store

Here’s a quick step by step guideline that you can print and keep hand, to use when your app is ready for submission. I am assuming that the reader of this article has an iPhone Developer License.

====== Step 1 ======

Certificate is an essential element to submit or test an application on iphone. It comes with code sign(Signatures) which would verified when an application is submitted on apple store or when tested on iphone.

One can bypass these if an application is installed on jail-break iphone or  when submitted on Cydia but this is not possible when one wants submit it to Appstore.


One has to through 2 step procedure to create a certificate from developer portal. I simply copied those two from “iphone developer portal”

[1] Generating Certificate Signing Request

[2] Submitting a Certificate Signing Request for Approval

Generating a Certificate Signing Request:
[3] Open the Utilities folder and launch Keychain Access from the Applications folder.

[4] Set the value of Online Certificate Status Protocol (OCSP) and Certificate Revocation List (CRL)
to “off” in the Preferences Menu.

[5] Select Keychain Access -> Certificate Assistant -> Request a Certificate from a Certificate Authority.

[6] Fill in your email address in User Email Address Field. Confirm that this email address is same as provided at the time of registering as iPhone developer.

[7] Fill in your name in the Common Name field. Confirm that this name is same as provided at the time of registering as iPhone developer.

[8] It is not necessary to have an Certificate Authority (CA). The ‘Required’ message would be eliminated after finishing the following step.

[9] Click the ‘save to disk’ radio button if prompted, choose ‘Let me specify key pair information’ and proceed.

[10] If  you choose ‘Let me specify key pair’ option then one has provide a file name and click ‘Save’. Select ‘2048 bits’ for Key Size and ‘RSA’ for the algorithm in next screen and proceed.

[11] CSR file would created on the desktop by Certificate Authority.


Submitting a Certificate Signing Request for Approval:
[1] Once CSR file is created log in to the iPhone developer program portal and go to ‘Certificates’> ‘Development’ and select ‘Add Certificate’.

[2] Click the ‘Choose file’ button, select your CSR and click ‘Submit’. The portal will reject the CSR if Key Size is not set to 2048 bit at the time of CSR creation.

[3] This will followed by notification to Team Admins by email of the certificate request.

[4] The change in the certificate status would informed by email on approval or rejection of the CSR by Team Admin.


Download/Installing Certificate on your machine
[5] Once the CSR is approved the Team Members and Team Admins can download their certificates via the ‘Certification’ section of the Program Portal.  Choose ‘Download’ next to the certificate name to download your iPhone development certificate to your local machine.

[6] Once this is done double-click the .cer file to launch Keychain Access and install your certificate.
On installation of certificate on your MAC the next step is to create an App ID.

Note: You have to follow this step only once and late you don’t have to make certificates for your other applications.


====== Step 2 ======


Follow the following steps to create an App ID:
[1] Go to ‘App IDs’ and click ‘App ID’ after logging in to iPhone developer program portal.

[2] Populate the ‘App Id Name’ field with your application name (that is – iPhone app) and in ‘App Id’

enter something like com.yourdomain.applicationname (i.e com.vijay.iphoneapp) and click submit.

[3] Please do note down the “App Id” as this would be utilized in Info.plist, bundle identifier tag.


====== Step 3 ======


Next step would be to create a Provisioning file for our Xcode and is the last step for creating binary which would submit it to Appstore.

[1] After you navigate to ‘Provisioning’> ‘Distribution’ click ‘Add Profile’ in iphone developer program portal.
 
[2] Choose “App Store” in “Distribution Method”.

[3] In “Profile Name” enter your application name (i.e iphoneapp) which will be your provisioning profile name as well.

[4] In “App ID” select the app name(i.e. iphoneapp) which you created in Step 2.

[5] After downloading the Provisioning profile copy it to your/YourUserName/Library/MobileDevice/Provisioning Profile.


====== Step 4 ======


Now everything is step up, open your project in Xcode
[1] Click “i” Info button after selecting your project from “Group & File” in left side bar.

[2] Navigate to “Configuration” tab and select “Release”. Click the “Duplicate” button from bottom, name is “iphoneDistribution”.

[3] Click on “Build” tab and choose “iphoneDistribution” and enter in “Search in Build Settings” filed ‘Base SDK’ and select the current selected Device and  change to what gadget your application is targeting (I prefer “Device-iPhone OS 2.0)

[4] Now in “Search in build setting” field enter “code signing identity” and choose the provisioning profile created earlier in Step 3. Apply the same to the child property “Any iPhone OS Device”.

[5] Once this done close the Info screen and select the “Target”> “Your App” from “Group & File” in left side bar and click on “Info” button again from Xcode.

[6] To be on the safer side repeat step 3 and 4.

[7] With the Info screen still open click on “Properties” tab and enter “App Id”(i.e. com.vijay.iphoneapp) in Identifier field.

[8] Now that all is done, click on “Build” (cmd+B) from Xcode>Build.

[9] You will find your binary file created on right clicking on “Product”> “YourApp” and selecting “Reveal in Finder”. Zip this file.

====== Step 5 ======


The next step is to submit the binary file created to itunesconnect.
[1] In your browser type https://itunesconnect.apple.com/ (this website is very slow over https) and login using your iPhone developer account.

[2] Click on “Manage Your Account” > “Add Application”

[3] On replying to a simple question from apple you can sumbit your application to app store. You also need few things in your system before you submit your application.

a) Application Name (must be unique)

b) Application description

c) Application Category

d) URL for your application feedback.

e) Icon of your application in 512 x 512 size.

f) Main picture of your application in 320 x 480 or 320 x 460 size. (You have option to submit up to 4  more pictures of your application).

Wednesday, August 17, 2011

Creating an image thumbnail

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo{
 
// set the image we have chosen to the background of the current view. (OPTIONAL!)
imageView.image  = image;
 
// write the file to the TEMP Directory in the iphone, then when the user has completed
 
 
// selecting their image from the picker, we want to write both the full sized file, and the
 
// thumbnail to the /tmp directory for use later (whatever you want)
 
NSData *pngImage = UIImagePNGRepresentation(image);
 
if([pngImage writeToFile:[NSString stringWithFormat:@"%@/tempImage.png"
TEMP_FOLDER] atomically:YES]){
 
// now that we have saved our image, lets generate a thumbnail from that image, and
// save that one as well.
 
// lets essentially make a copy of the selected image.
 
 
UIImage *myThumbNail    = [[UIImage alloc] initWithData:pngImage];
 
// begin an image context that will essentially "hold" our new image
 
 
UIGraphicsBeginImageContext(CGSizeMake(60.0,60.0));
 
// now redraw our image in a smaller rectangle.
 
 
[myThumbNail drawInRect:CGRectMake(0.0, 0.0, 60.0, 60.0)];

 
// make a "copy" of the image from the current context
 
UIImage *newImage    = UIGraphicsGetImageFromCurrentImageContext();
 
UIGraphicsEndImageContext();
 
// create a new view to place on our screen (OPTIONAL-- testing)
 
UIImageView *thumbView    = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 60.0, 60.0)];
 
thumbView.image    = newImage;
 
[self.view addSubview:thumbView];
 
// now grab the PNG representation of our image
 
NSData    *thumbData    = UIImagePNGRepresentation(newImage);
 
// now finally we can write our new thumbnail to the tmp directory on the phone.
 
 
if([thumbData writeToFile:[NSString stringWithFormat:@"%@/tempImageThumb.png", TEMP_FOLDER] atomically:YES]){
NSLog(@"thumb written!");
}
 
// close the modal view
 
[picker dismissModalViewControllerAnimated:YES];
 
}else{
 
// there was an error writing the image file to the tmp folder....
 
 
NSLog(@" there was an error writing the file to the temp directory");
   }
}