Code Monkey home page Code Monkey logo

google-api-objectivec-client-for-rest's Introduction

Google APIs Client Library for Objective-C for REST

Project site https://github.com/google/google-api-objectivec-client-for-rest
Discussion group http://groups.google.com/group/google-api-objectivec-client

CocoaPods SwiftPM ServiceGenerator

Written by Google, this library is a flexible and efficient Objective-C framework for accessing JSON APIs.

This is the recommended library for accessing JSON-based Google APIs for iOS, macOS, tvOS, and watchOS applications.

To get started with Google APIs and the Objective-C client library, please read USING.md for detailed information. The example applications can also help answer some questions, but there isn't an example for every service as there are just too many services.

Generated interfaces for Google APIs are in the GeneratedServices folder.

In addition to the pre generated classes included with the library, you can generate your own source for other services that have a discovery document by using the ServiceGenerator.

If you have a problem or want a new feature to be included in the library, please join the discussion group. Be sure to include http logs for requests and responses when posting questions. Bugs may also be submitted on the issues list.

Externally-included projects: The library is built on top of code from the separate project GTM Session Fetcher. To work with some remote services, it also needs Authentication/Authorization.

Google Data APIs: The much older library for XML-based APIs is still available.

Other useful classes for Mac and iOS developers are available in the Google Toolbox for Mac.

google-api-objectivec-client-for-rest's People

Contributors

altmas5 avatar bhamiltoncx avatar dmaclach avatar grant avatar grantkemp avatar hiteshsondhi88 avatar jackpal avatar jonasgessner avatar jpoumailloux avatar kareman avatar karimhm avatar koedal avatar larrylegend avatar lukescholefield avatar paulb777 avatar r4n avatar sergiocampama avatar thomasvl avatar williamdenniss avatar zkrige avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-api-objectivec-client-for-rest's Issues

ServiceGenerator type/format error

Hey - I am trying to upgrade to the new service generator from the old one which took the rpc discovery doc as input in order to generate the client library for my iOS app. The discovery docs are generated from cloud endpoints, and worked in the past with the old ServiceGenerator.

Now, using the new generator and rest discovery doc, I am getting the following error:

~/workspace/google-api-objectivec-client-for-rest/Source/Tools/ServiceGenerator/build/Release/ServiceGenerator discovery/servUsApi-v1-rest.discovery --outputDir GTLAPI
ERROR: Failure, exception: Looking at parameter 'creditKickbackKash:creditAmount', found a type/format pair of 'number/(null)', and don't how to map that to Objective-C

The discovery doc for that function looks like this:

"creditKickbackKash": {
     "httpMethod": "PUT",
     "id": "servUsApi.admin.creditKickbackKash",
     "parameterOrder": [
      "userId",
      "creditAmount"
     ],
     "parameters": {
      "userId": {
       "format": "int64",
       "location": "path",
       "required": true,
       "type": "string"
      },
      "creditAmount": {
       "location": "path",
       "required": true,
       "type": "number"
      }
     },
     "path": "creditKickbackKash/{userId}/{creditAmount}",
     "response": {
      "$ref": "ResultDTO"
     },
     "scopes": [
      "https://www.googleapis.com/auth/userinfo.email"
     ]
    }

Am I missing something obvious?

default scopes added automatically?

I am requesting DriveFile acces for my app, but always also get email and userprofile too in the window were the user needs to grant access.
is this normal?

iOS Embedded Framework: image not found error

I've tried adding the framework to an iOS app and apparently the framework isn't copied over to the device? I get a dyld error:

dyld: Library not loaded: @loader_path/../Frameworks/GTLR.framework/GTLR
  Referenced from: /var/containers/Bundle/Application/87B4187F-D9FC-40D6-BE4A-4541B848E163/Test.app/Test
  Reason: image not found

I've created a new project from scratch and only added the GTLR project, added the framework to Embedded Binaries and added -DGTLR_USE_FRAMEWORK_IMPORTS=1 to other linker flags. It's very strange because normally the error occurs when you're not properly adding a framework to the embedded binaries but I definitely did that. The framework is built and even added to the .app but I still get the dyld error. Xcode 8b6.

Another thing I noticed: Skip Install is set to NO. It should be YES, otherwise you can't properly archive an app to submit it to the App Store.

'Foundation/Foundation.h' file not found

I'm trying to compile GTLRiOSCore and/or GTLROSCore with no luck. I tried both from within the examples or from the GTLRCore.xcodeproj in Sources but what I get in both cases is 'Foundation/Foundation.h' file not found.

screen shot 2016-10-24 at 4 21 48 pm

I'm on macOs 10.11.4 and using Xcode 7.3.
Anyone encountered the same problem?

Crashed after using GTMAppAuth

*** Terminating app due to uncaught exception 'Attempted to create a token refresh request from a token response with no refresh token.', reason: 'Attempted to create a token refresh request from a token response with no refresh token.'
When run the Drive Sample, it crashed by calling fetchFileList ([service executeQuery:query
completionHandler:^(GTLRServiceTicket *callbackTicket,
GTLRDrive_FileList *fileList,
NSError *callbackError) { ) :

iOS framework requires CFBundleShortVersionString

Hey, the iOS framework (not sure about the OS X framework) requires a CFBundleShortVersionString to be uploaded to iTunes Connect. Currently if you build and try to submit you get this error:

The Info.plist file is missing the required key: CFBundleShortVersionString.

Where is the downloadUrl in V3?

There is a GTLDriveFile.downloadUrl in V2. We use the downloadUrl to stream video from Google Drive to MPMoviePlayerController. However, we cannot find the regarding API in V3. Are there any alternative methods to stream videos?

Implement NSCoding for GTLRBatchResult

GTLRBatchResult is a subclass of GTLRObject, which implements NSSecureCoding. However encoding and decoding a GTLRBatchResult results in an empty batch result, not the original batch result that was encoded. This is not the expected behavior, the batch result class should be codable.

(Swift, iOS) Crash on GTLR_DEBUG_ASSERT because of [rootURLString hasSuffix:@"/"]

Am getting crash because rootURLString (or self.rootURLString) is nil.
Code:

GTLR_DEBUG_ASSERT([rootURLString hasSuffix:@"/"],
                    @"rootURLString should end in a slash: %@", rootURLString);

File: GTLRService line 2017

After looking it up, it turns out that if you write

let service = GTLRService() 

will not call
Objective-c's - (instancetype)init
where is root URL set

self.rootURLString = @"https://www.googleapis.com/";

Thoughts? Maybe I misunderstood something? Thanks in advance.

My cocoapods-1.1.0.rc.3, pod 'GoogleAPIClientForREST/Drive', Xcode 8, Swift 3.0, iOS 10

Unable to authenticate Sheets API with Google SignIn

Trying to migrate my app to use Google SignIn instead of imbedded webUI however I cannot work out how to pass authentication credentials to GTLService? I can authenticate successfully with Google SignIn and it shows that I am requesting access to Google Sheets so I am using the correct scope "https://www.googleapis.com/auth/spreadsheets". However when I try and create a spreadsheet it fails with error "The operation couldn't be completed. (The request does not have valid authentication credentials).
I am trying to pass credentials from Google SignIn to my GTLService object like this:

sheetsService.authorizer = [GIDSignIn sharedInstance].currentUser.authentication.fetcherAuthorizer;

I have successfully tested passing credentials to Google Drive API (GTLServiceDrive Object) using this method but same does not work for Sheets API?

Cloud Endpoints timeout and method

After generating the client library with the service generator, requests to my cloud endpoints timeout with NSUrlErrorDomain 1001 most of the time. When it doesn't timeout, the client makes a POST request when the rest discovery doc says that its supposed to be a GET request.

Also before this I had to add an exception in app transport security for the appspot.com domain

Integrating GTLRStorage

I'm finding it very difficult to integrate the Storage module. I see there is submodules defined in the podspec, but cocoapods doesn't seem to pull the down, even if specified with /Core at the end.

I've also tried to follow the guide and generate a service, but the guide tells your to generate the service with the --gtlrFrameworkName flag, which doesn't work. So I'm a bit stuck.

EDIT: Included Podfile

target 'MyApp Intra' do
  use_frameworks!
  # Pods for MyApp
  pod 'FirebaseOSX'
  pod 'GTMOAuth2'
  pod 'GoogleAPIClientForREST'
  //I've tried below as well. And both together
  pod 'GoogleAPIClientForREST/Core'
  pod 'Alamofire'
  pod 'Sparkle', '~> 1.10'
  pod 'SDWebImage', :git => 'https://github.com/rs/SDWebImage.git', :branch => '4.x'
end

in iOS, how to directly download the content of a shareable link

For example, I got a shareable link, which is targeted at a zip file on Google Drive from other people. On the web, click the shareable link, I will get a web page, via which I can download it from the linkage. Can I directly download it in my iOS app, rather than redirect to a webpage first?

This link provides a way to do this: http://webapps.stackexchange.com/questions/30654/in-google-drive-how-can-you-link-directly-to-download-a-zip-file-and-not-view/30656#30656?newreg=ac981950d09348699d379b0587d262b4. However, i would like to see an official way :)

Thanks

Can't submit to App Store using this libaray

My project has been disabled the BitCode, while submit to App Store, it resports
errors occurred in the app thinning process, and your app couldn’t be thinned. If your app contains bitcode, bitcode processing may have failed. Because of these errors, this build of your app will not be able to be submitted for review or placed on the App Store. For information that may help resolve this issue, see Tech Note 2432.
The following solution does not help.
http://stackoverflow.com/questions/39390546/itunes-connect-errors-occurred-in-the-app-thinning-process-and-your-app-couldn/39484306#39484306

If I remove this lib, everything is OK. Please help

Sync up library version and framework info.plist files

Looks like Apple's signing can want version on the frameworks. Update the framework build process in the projects so the version number from GTLRFrameworkVersion() matches the one in the info.plist.

We should also look at raising the CocoaPods version to match and then keeping them all in sync.

The request did not specify any iOS bundle ID

An error saying "The request did not specify any iOS bundle ID. Please ensure that the client is sending it or use the API Console to update your key restrictions" appears whenever I try to make any request with an iOS API key that has bundle ID restrictions. I am not sending a custom user agent string and I double checked and made sure the user agent string really contains the bundle ID and it does.

I'm not sure if this is a problem on the client side (possibly wrong formatting of the user agent), or a server side issue. There used to be a bug on the server side, which absolutely no one at Google even remotely cared about: https://code.google.com/p/gdata-issues/issues/detail?id=5770 and while the error message here is different it could still be the same bug.
I don't understand how Google would have every bit of this feature implemented in the console for years and now they're even suggesting to use the feature, yet the actual check for the bundle ID always fails (which would essentially be one liner). Seeing how no one cared about that bug report from 2014 it seems pretty plausible though.

Could you clear this up? Is it a bug in this library or still on the server side?

YouTube API: setUploadLocationURL causes 501 error from the API

Hi,

I just migrated some code to the YouTube API.
All works fine until I have a broken download and I try to resume it for the given URL.

The call differs in setting the location URL via:

[query.uploadParameters setUploadLocationURL:uploadResumeUrl];

After invoking the ticket I get an "501 not implemented" response.
What can be the problem of this?

Thank you in advance

Youtube Data API V3 not working for channel with OAuth 2.0

I have authenticated the user with the Google/SignIn. I have the access token, when I create a request to get the channelId for a particular username, it throws the error

{
error = {
code = 403;
errors = (
{
domain = usageLimits;
extendedHelp = "https://code.google.com/apis/console";
message = "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.";
reason = dailyLimitExceededUnreg;
}
);
message = "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.";
};
}

I am sending the accessToken in the http header with the "Authorization".

When I use the APIKey instead of accessToken it works as expected.
I checked in the OAuth Playground, it is working as expected.

Linking issue using generated services and cocoapods

All in the name of CI (through bitbuckets) I upgraded my cloud endpoints server to use the new supported gradle plugin, which sent me down quite the rabbit hole. I was using cloud endpoints 1.0 and had to upgrade to 2.0. This took away support for RPC via iOS, so I had to upgrade to using this, newer library in my iOS app and GTLR from GTL.

I am generating services and objects using the service generator against my endpoints project. Now when trying to compile and link Im getting lots of errors like the following:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_GTLRServUsApiQuery_PaymentsDeletePaymentMethod", referenced from:
      objc-class-ref in CreditCardFormV.o
  "_OBJC_CLASS_$_GTLRServUsApi_UploadResponseDTO", referenced from:
      objc-class-ref in ProfileVC.o
  "_OBJC_CLASS_$_GTLRServUsApiQuery_UsersUploadUrl", referenced from:
      objc-class-ref in ProfileVC.o

Lots of searching hasnt found anything that works to solve this for me. Any help would be highly appreciated.

Deleting another users file - authorized in domain

Hi,

I am using The library and the API in general with Google Apps for Work. I have two users and create tokens to impersonate them. They have both edit rights to folder X. When I log as user U1 into Google Drive on a webpage I can delete user U2 files. But when I use the API I get 403 response with insufficient privileges message. Shouldn't I be able to delete his files also?

generating API - problem on double type

when generating the API, I have this issue for the double type in Java
"found a type/format pair of 'number/(null)', and don't how to map that to Objective-C"

it occurs only for double type

any idea ?

thank you

Linking to Framework not working on Device

I followed the instructions for Linking to the Framework and it works fine on the simulator.

When trying to run on device I get the following error. I've followed all suggestion on the Internet I've found and not had success yet.

dyld: Library not loaded: @loader_path/../Frameworks/GTLR.framework/GTLR
Referenced from: /var/containers/Bundle/Application/B9FEEC03-BF14-4F15-8D58-E934CAAB0EE8/AppName.app/AppName
Reason: image not found

Could not determine client ID from request

Hi

I'm running the example YouTubeSample app in XCode but get the error "Could not determine client ID from request". I haven't modified the code. Here are the steps I follow.
Enter in a ClientID
Leave the Client Secret blank as it is not found in console.developers.google neither is it found in the .plist.
Sign into Google account
Press GetPlaylist

The NSError *callbackError in the completion handler of the following call
_channelListTicket = [service executeQuery:query
completionHandler:^(GTLRServiceTicket *callbackTicket,
GTLRYouTube_ChannelListResponse *channelList,
NSError *callbackError)
returns
2016-08-28 15:06:43.213 YouTubeSample[38574:278119] Error Error Domain=com.google.HTTPStatus Code=400 "(null)" UserInfo=...
Error data:
{
error = "invalid_request";
"error_description" = "Could not determine client ID from request.";
}

Any suggestions?

Getting client secret

In your Calendar example apps you ask for API Key and Secret, however Google's Api Console only lets us create a client id under creds.

The documentation for Googles' api also doesn't mention creating secret.
https://support.google.com/googleapi/answer/6158857?hl=en-GB

Can you add to the documentation how to generate a key and secret specifically so it can be done easily and get the Calendar project working as expected.

Fetching files from drive

Hi, I'm trying to print some JSON files from my drive and I keep getting this message:
An error occurred: The operation couldn’t be completed. (com.google.HTTPStatus error 403.)
Here is the code:

class func googleDriveFetchFiles(){
    print("Getting files...")
    let query = GTLQueryDrive.queryForFilesList()
    query.fields = "nextPageToken, files(id, name, webViewLink, webContentLink, mimeType)"
    query.mimeType = "application/vnd.google-apps.json"
    service.executeQuery(
        query,
        delegate: self,
        didFinishSelector: #selector(self.finishedDriveQuery(_: fileList: error:))
    )
}

class func finishedDriveQuery(ticket : GTLServiceTicket, fileList : GTLDriveFileList, error : NSError?) {
    if let error = error {
        print(error.localizedDescription)
        return
    }
    if let files = fileList.files  as? [GTLDriveFile] where !files.isEmpty{
        print("Found \(files.count):")
        for file in files {
            let fileURL = "https://www.googleapis.com/drive/v3/files/\(file.identifier)?alt=media"
            fetchFile(fileURL)
        }
    } else {
        print("No files found.")
    }
}

class func fetchFile(fileURL: String){
    let fetcher = service.fetcherService.fetcherWithURLString(fileURL)
    fetcher.beginFetchWithCompletionHandler({ (data, error) -> Void in
        if error == nil {
            print(data)
        } else {
            print("An error occurred: " + error!.localizedDescription)
        }
    })
}

this prints:
Getting files...
Found 10:
An error occurred: The operation couldn’t be completed. (com.google.HTTPStatus error 403.)
An error occurred: The operation couldn’t be completed. (com.google.HTTPStatus error 403.)
An error occurred: The operation couldn’t be completed. (com.google.HTTPStatus error 403.)
An error occurred: The operation couldn’t be completed. (com.google.HTTPStatus error 403.)
An error occurred: The operation couldn’t be completed. (com.google.HTTPStatus error 403.)
An error occurred: The operation couldn’t be completed. (com.google.HTTPStatus error 403.)
An error occurred: The operation couldn’t be completed. (com.google.HTTPStatus error 403.)
An error occurred: The operation couldn’t be completed. (com.google.HTTPStatus error 403.)
An error occurred: The operation couldn’t be completed. (com.google.HTTPStatus error 403.)
An error occurred: The operation couldn’t be completed. (com.google.HTTPStatus error 403.)

Why is it returning 403? I'm already authenticated because I'm can get the files id's right?

GTLRDriveQuery_FilesUpdate to update file content, got 403 error

I don't know how exactly use this API to update file content since I didn't get detail information from Document and DriveSample application. Thus, I tried to write it like:

GTLRUploadParameters *uploadParameters = [GTLRUploadParameters
                    uploadParametersWithData:data
                                    MIMEType:@"binary/octet-stream"];
GTLRDriveQuery_FilesUpdate *query = [GTLRDriveQuery_FilesUpdate
                                 queryWithObject:cloudPreference
                                          fileId:cloudPreference.identifier
                                uploadParameters:uploadParameters];

[self.driveService executeQuery:query
              completionHandler:^(GTLRServiceTicket *callbackTicket,
                                  GTLRDrive_File *uploadedFile,
                                  NSError *callbackError) {
                  if (callbackError == nil) {
                      NSLog(@"Updating file is finished!");
                  }
                  else {
                      NSLog(@"Failed to update file: %@", callbackError);
                  }
              }];

The error is: Failed to update file: Error Domain=com.google.HTTPStatus Code=403 "(null)" UserInfo={data=<7b226572 726f7222 3a7b2265 72726f72 73223a5b ...

Actually data is JSON format, I tried MIMEType with "applicaton/json" but still got 403 error. I can't google anything about this API with such error. The file is created by my application and I can download data from Google drive in my application. But I don't know what's wrong with my updating codes, Could anyone help me? Thanks a lot!

Sending mail with a attachment

Hi, I'm trying to send a mail with a attachment.
Mail was delivered properly, but attachment is not delivered.

Here is my code. Is there any problems?

Please help me.

mailMessage.raw = GTLREncodeWebSafeBase64([rawMessage dataUsingEncoding:NSUTF8StringEncoding]);

GTLRUploadParameters *imageParams = [GTLRUploadParameters uploadParametersWithData:UIImagePNGRepresentation(image)
                                                                          MIMEType:@"message/rfc822"];

GTLRGmailQuery_UsersMessagesSend *query = [GTLRGmailQuery_UsersMessagesSend queryWithObject:mailMessage
                                                                                     userId:email
                                                                           uploadParameters:imageParams];

GTLRGmailService *service = [[GTLRGmailService alloc] init];
service.authorizer = self.user.authentication.fetcherAuthorizer;

[service executeQuery:query completionHandler:^(GTLRServiceTicket *callbackTicket, GTLRGmail_Message *object, NSError *callbackError) {
    if (callbackError) {
        DDLogError(@"%@", callbackError);
        DDLogError(@"UserInfo[@\"data\"] - %@", callbackError.userInfo[@"data"]);
        return;
    }
    DDLogInfo(@"Sent - %@", object);
}];

GTLR_BUILT_AS_FRAMEWORK not being read early enough.

I've added GTLR_BUILT_AS_FRAMEWORK custom compiler flag to my target as I'm using the google-api project as a framework. I've added the GTLRDrive.h and associated files to my project but they won't compile due to the GTLR_BUILT_AS_FRAMEWORK not being recognized at compile time. I've checked that the flag is being set in my other files and it is.

Any ideas how to make this flag get set before the GTLRDrive.h's imports get compiled?

Get url from query

I just did some hacking into the code and figured out that sometimes I need the query URL + access_token in order to stream video content to my iOS device. It would be handy, if the service method URLFromQueryObject: usePartialPaths: includeServiceURLQueryParams: was made public and could also have an extra option to append the current access_token

Add instructions to build the Example project

I just tried to buidl the example project for Calendar and it generated an error:

(null): error:XXXXX for rest/Deps/gtm-session-fetcher/Source/GTMSessionFetcher.h: No such file or directory
(null): error:XXXXX for rest/Deps/gtm-session-fetcher/Source/GTMSessionFetcherService.h: No such file or directory
(null): error:XXXXX for rest/Deps/gtm-session-fetcher/Source/GTMSessionUploadFetcher.h: No such file or directory

In the wiki it mentions using Google Sign In as an approach but no method is shown

In the wiki, you mention that its possible to use Google Sign In to connect to one of the services, but this doesn't seem to be documented clearly in the various google projects, let alone in a single Github example. ( Please correct me if I am wrong)

If not, it would be really useful to have a simple example that shows the power of the new Google Sign in flow and this library to connect to something simple like the analytics reporting api.

If above is possible, would be great to get some guidance, on how it works once I have the token and creds via the Google Sign in library , and I will be happy to contribute the the project example back to this for others to use.

iOS Swift - Trying to use the Gmail API but it's crashing

For months, I've been trying to use the Gmail API. I've attempted multiple times to follow the guide on the Gmail API Website with Swift. It worked until Apple released Swift 3, which made some changes to the language. So, now when I copy and paste the code provided on the Gmail API site, Xcode shows a whole bunch errors, all of which were fixable but simply click on the fix the error shows. So once I fix everything that Xcode tells me needs to be, I run the app. I'm able to sign in to my Google account, but once I give my app the permission, rather than then the WebView closing and the UITextView showing a list of the folders in my email, the app shows something that says, "Copy and Paste this code into the app." Then, it crashes with a SIGABRT error.

So the issue I'm having is that Google hasn't updated the code for Swift 3, and I'm not fluent in Obj-C, and Xcode doesn't fix the errors, rather something it's doing is crashing the app. Also, trying to use "Legacy Swift Version", in Build Settings also causes problems, now with the AppDelegate. Google doesn't seem to offer more documentation. Is there anyway I could at least use the API with Alamofire?

Progress not working with MIME type "application/octet-stream"

Downloading files of MIME type application/octet-stream and showing its progress doesn't seem to work. totalBytesExpectedToWrite is always -1. I'm working on an app for file encryption/decryption, that's why I'm almost exclusively working with files of this MIME type.

Here is one example: https://drive.google.com/open?id=0B3zSI_PrS4g5MFZjazM4Xzk1aDQ

It's an encrypted file, so you wouldn't see any content, but at least you could try and download it!

I'm not sure if I'm jumping to any conclusions too fast, because I had an almost identical case with the OneDrive SDK. The problem was that the file is being gzipped when downloading it. At least there was a workaround. Could there be a workaround here as well?

GTLR executeQuery in background fetch mode is not working

Tried to fetch latest calendar events in iOS Background Fetch mode using below 2 methods,

  1. service.executeQuery(<#T##query: GTLRQueryProtocol##GTLRQueryProtocol#>, delegate: <#T##Any?#>, didFinish: <#T##Selector?#>)
  2. service.executeQuery(<#T##query: GTLRQueryProtocol##GTLRQueryProtocol#>, completionHandler: <#T##GTLRServiceCompletionHandler?##GTLRServiceCompletionHandler?##(GTLRServiceTicket, Any?, Error?) -> Void#>)

But once excute query is executed then neither delegate nor completion handler is getting called. same code is working fine in foreground mode. I have enabled iOS background fetch mode capability for my main project. After executeQuery i see below logs,

[] nw_socket_get_input_frames recvmsg(fd 7, 1024 bytes): [57] Socket is not connected
[] nw_socket_get_input_frames recvmsg(fd 27, 1024 bytes): [57] Socket is not connected
[] nw_endpoint_handler_add_write_request [8.1 216.58.199.138:443 failed socket-flow (satisfied)] cannot accept write requests
[] __tcp_connection_write_eof_block_invoke Write close callback received error: [22] Invalid argument

How can we make GTLR Query to work in "Background Fetch" mode?

Are iOS app extensions actually supported?

We were intensively trying to make the code, that already works in the app itself, work in our app extension (document provider) without any luck. With the dropbox SDK it was not a problem, do you actually support app extensions? I could not find any example/documentation specific for app extensions.

Add instalation steps for Cocoapods / Carthage

The readme misses some normal information regarding how to install the library with both CocoaPods and Carthage which are the major dependency managers used by iOS/Mac OS developers.

The operation couldn’t be completed. (com.google.HTTPStatus error 403.)

error: The operation couldn’t be completed. (com.google.HTTPStatus error 403.)

I am trying to download from google drive file in iOS and getting error in the following

GTLServiceDrive* googleDriveService = [[GTLServiceDrive alloc] init];

NSString *urlTest = [NSString stringWithFormat:@"https://www.googleapis.com/drive/v3/files/%@?alt=media",itemIdentifier[indexPath.row]];
GTMSessionFetcher *fetcherTest = [googleDriveService.fetcherService fetcherWithURLString:urlTest];
[fetcherTest beginFetchWithCompletionHandler:^(NSData *data, NSError *error) {
    if (error == nil) {
        NSLog(@"Retrieved file content");
        NSLog(@"File size is : %.2f MB",(float)data.length/1024.0f/1024.0f);
        // Do something with data
    } else {
        NSLog(@"error: %@", [error localizedDescription]);
    }
}];

Determining type of executeQuery() result object

I have the following code that queries metadata about a spreadsheet

func querySheets(workbookId:String, completed:@escaping ([QueriedSheet]?, Error?) -> Void) {
      let query = GTLRSheetsQuery_SpreadsheetsGet.query(withSpreadsheetId:workbookId)
      sheetsService.executeQuery(query) { ticket, result, error in
          if let sheet = result as? GTLRObject {
              print("GTLRObject")
          }
          else {
              print("Not GTLRObject")
          }
          if let sheet = result as? GTLRSheets_Sheet {
              print("GTLRSheets_Sheet")
          }
          else {
              print("Not GTLRSheets_Sheet")
          }
      }
  }

The output is

GTLRObject
Not GTLRSheets_Sheet

error is nil.

How can I determine the object type of "result" for a given query? I didn't see any reference or instruction in the documentation. I Just want to get the name of the document and names and IDs of any sheets it contains.

I was calling the Google Sheets v4 REST API directly. Although it takes a bit more code, the API is very well documented and I never got stuck. I'm attempting to use this wrapper because it would mean less code once I figure out how to use it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.