I am working in an application and trying to adding Google API to use Google drive where user can store/share my application files. I found good tutorial for that Google Drive tutorial I downloaded the sample code worked on it, I downloaded the code yesterday it was
working good the files are storing as expected, Today agin I am checking, every time I am getting error meesage. please find the console message
An error occurred: Error Domain=com.google.GTLJSONRPCErrorDomain
Code=400 "The operation couldn’t be completed. (Unsupported content
with type: application/json-rpc; charset=utf-8)" UserInfo=0x75b11f0
{error=Unsupported content with type: application/json-rpc;
charset=utf-8, GTLStructuredError=GTLErrorObject 0x75a3f90:
{message:"Unsupported content with type: application/json-rpc;
charset=utf-8" code:400 data:[1]},
NSLocalizedFailureReason=(Unsupported content with type:
application/json-rpc; charset=utf-8)}
can some one suggest me the alternative to integrate the Google drive in iOS app.
if this is happen with the sample code it self how could be the Google API for iOS reliable to integrate in our apps.
Note: I created the kClientSecret and kClientId also to use DrEdit sample code given by the Google.
Very recent changes in the Google Drive service obliges you to specify a mime type different than "application/json-rpc" when uploading a file. This mime type is used by default when using the ObjectiveC SDK, so you need to specify one.
To make the sample that ships with the SDK work, open DriveWindowController.m and in the "uploadFileAtPath:" method under "newFile.title = filename;" add "newFile.mimeType = #"image/png";". Change "image/png" to the MIME type of the file you are uploading.
GTLDriveFile *newFile = [GTLDriveFile object];
newFile.title = filename;
newFile.mimeType = #"image/png";
Edited: It also seems that there is temporary problem on Google's servers
Related
Places SDK error: Error Domain=com.google.places.ErrorDomain Code=-3 "An internal error occurred in the Places SDK library. If you believe this error represents a bug, please file a report using the instructions on our community and support page (https://developers.google.com/places/ios-sdk/support)." UserInfo={NSLocalizedFailureReason=An internal error occurred in the Places SDK library. If you believe this error represents a bug, please file a report using the instructions on our community and support page (https://developers.google.com/places/ios-sdk/support)., NSUnderlyingError=0x6000036d3090 {Error Domain=com.google.places.server.ErrorDomain Code=-1 "(null)" UserInfo={NSUnderlyingError=0x6000036d2dc0 {Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={body=<48545450 2f312e31 20343034 204e6f74 20466f75 6e640d0a 436f6e74 656e742d 54797065 3a207465 78742f68 746d6c3b 20636861 72736574 3d555446 2d380d0a 44617465 3a204d6f 6e2c2031 34204f63 74203230 31392031 333a3430 3a303520 474d540d 0a457870 69726573 3a204d6f 6e2c2031 34204f63 74203230 31392031 333a3430 3a303520 474d540d 0a436163 68652d43 6f6e7472 6f6c3a20 70726976 6174652c 206d6178 2d616765 3d300d0a 436f6e74 656e742d 4c656e67 74683a20 390d0a0d 0a4e6f74 20466f75 6e64>, contentID=gtlr_23, GTLRStructuredError=GMSx_GTLRErrorObject 0x600003523d80: {code:3840 message:"The data couldn’t be read because it isn’t in the correct format."}, NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.}}}}}
Error Image
Please note that the Place Picker has been deprecated as of January 29, 2019. This feature was turned off on July 29, 2019, and is no longer be available after that date. Please note that the old users that used Places SDK for iOS/Android are the only one who can still use the Place Picker during the deprecation period. The use of Places SDK for both platforms are now through enabling Places API and does not support the use of Place Picker anymore. You may see the deprecation notice in https://developers.google.com/places/ios-sdk/placepicker.
PlacePicker is no more.
Check out the following:
No Billing account linked to this project.
Use of an old Places SDK.
Reaching requests limits.
Restricting App Key.
If all of this didn't fix your problem, I would recommend reaching out to Google Support Team as this error commonly has something to do with your configuration in the GCP console wherein only the support team of Google Maps Platform can assist you.
I'm trying to grab info from: http://api.geonames.org/earthquakesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&username=demo to display in my app but I keep on getting a "Network Request Failed" error.
I am literally copying and pasting (well i've edited the params a bit of things so that the earthquake data can be taken) the code from Facebook's React Native Movies tutorial (https://facebook.github.io/react-native/releases/0.27/docs/sample-application-movies.html#final-source-code) and replacing
var REQUEST_URL = 'https://raw.githubusercontent.com/facebook/react-native/master/docs/MoviesExample.json'
with
var REQUEST_URL = 'http://api.geonames.org/earthquakesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&username=demo'
I have already changed info.plist to allow like everything possible.
Are you using the demo account as you have specified in the link?. If so you need to sign in and enable free webservice for your account to get things to work.
I was looking for a workaround to use openURL in iOS 10 to open the settings App with a string like this: prefs:root=SOMETHING
Finally I found this solution which uses a "grey API" which I think is just a private API using the runtime headers of LSApplicationWorkspace.
I tried to get it working also regarding this post but I'm not able to compile it without any errors.
Does anybody know how to use this LSApplicationWorkspace code:
//url = "prefs:root=SOMETHING"
[[LSApplicationWorkspace defaultWorkspace] openSensitiveURL:url withOptions:nil];
I'm always getting multiple errors compiling the header file saying: unknown type name followed by for example: "LSInstallProgressDelegate" but maybe there is a better way of using this code and the "grey API" in general. I'm fine using private API, due to the fact that this is a in-House App.
Please refer to this link that I tried out and it worked. https://gist.github.com/johnny77221/bcaa5384a242b64bfd0b8a715f48e69f
I have a simple iOS app into which I am integrating Google Maps. However, the API key I've provided results in several of these error messages when my map view is displayed:
ClientParametersRequest failed, 3 attempts remaining (0 vs 5). Error Domain=com.google.HTTPStatus Code=400 "The operation couldn’t be completed. (com.google.HTTPStatus error 400.)" UserInfo=0x1818bf40 {data=<CFData 0x18137410 [0x302aec8]>{length = 145, capacity = 256, bytes = ...}}
Here is what I have already tried to no avail:
Calling [GMSServices provideAPIKey:] as the first line of code within didFinishLaunchingWithOptions
Double-checking that my API key is correct and is an iOS API key (I copy/pasted it directly from the Google Cloud Console into my app)
Providing the API key both with {} and without
Confirming my bundle name by outputting it with [[Bundle mainBundle] bundleIdentifier]
Omitting bundle identifier restrictions altogether
Regenerating the API key
I am not sure what else to try. My bundle name is in this format: net.company.MyApp and I have entered it exactly that way into the Google Cloud Console (I know bundle IDs are case-sensitive).
Could it be that Google doesn't support bundle identifiers of a certain type (e.g., with upper-case letters or beginning with net.)?
You need to enable maps service in Google developer Console. In new layout, choose APIs & auth section and APIs subitem in the left column. Next, in the right one enable Maps SDK for iOS by clicking on the Off button.
I found the issue. Google Maps SDK for iOS must be enabled for keys to work. I already had Google Maps API v3 enabled and I thought that was enough, but it wasn't.
if you are doing a manual integration of SDK, it is no longer supported in latest version. Also GoogleMapsM4B version needs to be deleted and only keep GoogleMaps SDK in your project. This worked for me.
i'm trying to upload a file using the dropbox SDK for ios, i have setup correctly the framework, and link with the dropbox account, but now when i'm trying to upload the file i receive this error:
[WARNING] DropboxSDK: error making request to /1/files_put/sandbox/DBApp.sqlite - (403) Forbidden
2013-08-28 15:07:12.418 MyApp[3761:c07] File upload failed with error - Error Domain=dropbox.com Code=403 "The operation couldn’t be completed. (dropbox.com error 403.)" UserInfo=0x11e77ef0 {sourcePath=/Users/Piero/Library/Application Support/iPhone Simulator/6.1/Applications/553ACC67-D119-44A9-B7E0-7188773AD496/Documents/DBApp.sqlite, destinationPath=/sandbox/DBApp.sqlite, error=Forbidden}
this is the code i use:
NSString *filename = #"DBApp.sqlite";
NSString *destDir = #"/";
NSString *oldPath = [[self applicationDocumentsDirectory] stringByAppendingPathComponent:#"DBApp.sqlite"];
[[self restClient] uploadFile:filename toPath:destDir withParentRev:nil fromPath:oldPath];
anyone can help me?
i have found the problem, i have wrong to create the type account of the app in the dropbox page, i have choose Datastore Only, instead i have to choose file and Datastore, i have delete the account, and create a new one, and know with the code above works!
Just for detail description, I was also getting the same error and followed a sample project from the Ray Wenderlich tutorial sites.
Steps I have taken are as follows:
register(create) your app on drop box developer.
Choose DropBox API App
Choose sub type i.e What type of data does your app need to store on Dropbox: Files and Data-stores
Choose appropriate option Can your app be limited to its own folder?
What type of files does your app need access to? ----> choose specific file type
For a full understanding have a look at attached snapshot:
Ya I support Piero answer and another reason is that the access token is invalid so I suggest you to add the DBRestClient instance in your appdelegate OpenURL function so, your appdelegate class will have some thing like this
AppDelegate .m
and in your ViewController add the DBRestClient instance from AppDelegate class in ViewDidLoad Method and your ViewController will looks something like this
This solves the issue and working fine