403 Error: disallowed_useragent

前端 未结 4 594
孤城傲影
孤城傲影 2020-12-06 15:49

I am new to mobile application development, I am developing an ios app. In which I am using google drive to get document files into my app from google account.I did that tas

4条回答
  •  -上瘾入骨i
    2020-12-06 16:04

    After Following Google drive API Quick start, Add these 3 lines of code in AppDelegate.m didFinishLaunchingWithOptions as Shown below.. then it works fine ...

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
         NSString *userAgent = @"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/603.1.23 (KHTML, like Gecko) Version/10.0 Mobile/14E5239e Safari/602";
    
         // set default user agent
    
         NSDictionary *dictionary = [[NSDictionary alloc]initWithObjectsAndKeys:userAgent,@"UserAgent", nil];
         [[NSUserDefaults standardUserDefaults] registerDefaults:(dictionary)];
    
        return YES;
    }
    

提交回复
热议问题