403 Error: disallowed_useragent
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;
}
Getting 403 disallowed_useragent on Azure B2C + Ionic Capacitor InAppBrowser google login
I solve it by adding the overrideUserAgent
to the capacitor.config.json like this
"cordova": {
"preferences": {
"OverrideUserAgent": "Mozilla/5.0 Google"
}
},
This object was added to the root of the file.
The problem is that Cordova preferences are added to capacitor preferences when we run cap init
command, After that to add Cordova preferences we should use Cordova object inside capacitor.config.json as I did above.
https://capacitorjs.com/docs/cordova/migrating-from-cordova-to-capacitor#cordova-plugin-preferences
Related Topics
How to Use Addtarget Method in Swift 3
How to Set Kerning in iPhone Uilabel
iOS Gps Tracking App That Runs All the Time
Swift - Download a Video from Distant Url and Save It in an Photo Album
How to Change the Uinavigationcontroller Back Button Name
How to Show Uialertcontroller from Appdelegate
Disabling Automatic Scrolling of Uitableview When Editing Uitextfield Inside Uitableviewcell
Restore Already Bought In-App-Purchases on Iphone
Add Lefthand Margin to Uitextfield
Crashlytics in iOS Won't Proceed Past "Build Your Project" in Fabric App
How to Get Data from Firebase in Descending Order of Value
More Efficient Way to Retrieve Firebase Data
You Are Not Authorised to Use This Service Itunes App Upload Error