Q:

iOS : Error when I read a video from Google Drive a certain amount of times

When I read videos in my iOS application which it uses the Google Drive API, at a certain time of reading a video, I have this error : Error Domain=com.google.HTTPStatus Code=403 "(null)"
And I can read the other videos until a certain amount of times, when I still have this error.
Here is my code :
if ([file.mimeType isEqualToString:@"video/quicktime"])
{

    GTMHTTPFetcher *fetcher = [service.fetcherService fetcherWithURLString:file.downloadUrl];

    [fetcher beginFetchWithCompletionHandler:^(NSData *data, NSError *error) {
        if (error == nil) {
            NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
            NSString* accessToken = [userDefaults objectForKey:@"accessToken"];
            player = [[MPMoviePlayerController alloc]initWithContentURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@&access_token=%@",file.downloadUrl,accessToken]]];
            [[player view] setFrame:CGRectMake(self.view.frame.size.width/2-150, self.navigationController.navigationBar.frame.size.height+30, 300, 400)];
            player.contentURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@&access_token=%@",file.downloadUrl,accessToken]];
            [player setContentURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@&access_token=%@",file.downloadUrl,accessToken]]];
            [player setMovieSourceType:MPMovieSourceTypeFile];

            player.scalingMode = MPMovieScalingModeNone;
            player.controlStyle = MPMovieControlStyleDefault;
            player.backgroundView.backgroundColor = [UIColor whiteColor];
            player.repeatMode = MPMovieRepeatModeNone;

            [self.view addSubview: [player view]];
            [player play];

        } else {
            NSLog(@"An error occurred: %@", error);
        }
    }];
}

Is it a cause of the amount of data downloaded ? Did I forget anything to enable or disable ?

A:

I don't use GTMHTTPFetcher but If your problem is about HTTPStatus Code=403 , it's forbidden to access the service. So you can't do anything in this case. You should show a message to user when they try to reach forbidden video. 
You can check the statusCode 
if(HTTPStatusCode == 403){
   //Show an alertView to user
}

or you should control video which has permissions. Otherwise your app will crash.
More info about HTTP status code 403
Checking other status code will clear your application.
Status are so important to fetch data. If something went wrong you should check it. 

