GTMSessionFetcher.h file not found, updating the application to the latest google-api-objectivec-client

I am using Google Drive access in an iOS app. This has been an active feature in the application since mid-2014 and functions correctly under iOS 6, 7 and 8. Currently, I am testing my project for compatibility with iOS 9.

I downloaded the latest version google-api-objectivec-clientto make sure my project is updated.

I canceled the standard implementation of Google ... as described in detail in this page and is included for completeness at the end of this post.

Problem: when I try to create any of my releases, I get the error message " GTMSessionFetcher.hfile not found".

I am sure that I have correctly implemented the API in accordance with the instructions below / on the Google web page.

I looked at older versions of my code, but unfortunately I did not back up the Google SDK, so I can’t easily say what has changed.

It seems to follow from this ... inside GTMOAuth2Authentication.h...

#if GTM_USE_SESSION_FETCHER
  #import "GTMSessionFetcher.h"
#else
  #import "GTMHTTPFetcher.h"
#endif  // GTM_USE_SESSION_FETCHER

I do not understand how it is installed GTM_USE_SESSION_FETCHERand why this would be true in this case.

Any advice was greatly appreciated.


Implementing Google APIs for iOS

Note. Steps 1 and 2 completed without problems.

Step 3: Prepare the project

  • In Xcode, create a new project containing a test application:
    • Choose File> New> Project, select the One View application template, and click Next.
    • , . Objective-C , "".
    • "".
  • , GTL.xcodeproj Source XCode.
  • XCode , , .
  • " " Link Binary with Libraries, :
    • libGTLTouchStaticLib.a GTL.
    • Security.framework SystemConfiguration.framework.
  • " " :
    • -ObjC -all_load > . - , , "Enter", .
    • , " " > " " . ** , . Unix, , 2, cd, pwd.
  • GTMOAuth2ViewTouch.xib Source/OAuth2/Touch Supporting Files.
  • Drive API, GTLDrive.h GTLDrive_Sources.m Source/Services/Drive/Generated .
+4
6

Rivero , ...

Peter .

iOS 6, 7, 8 9...

...


1

GTMOAuth2Authentication.h ( OAuth) GTLService.h ( )

...

#if (!TARGET_OS_IPHONE && defined(MAC_OS_X_VERSION_10_11) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_11) \
  || (TARGET_OS_IPHONE && defined(__IPHONE_9_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_9_0)
  #ifndef GTM_USE_SESSION_FETCHER
    #define GTM_USE_SESSION_FETCHER 1
  #endif
#endif

...

#define GTM_USE_SESSION_FETCHER 1

... to

#define GTM_USE_SESSION_FETCHER 0

2

GTMGatherInputStream.m ( HTTPFetcher)

...

return [[[self alloc] initWithArray:dataArray] autorelease];

... to

return [[(GTMGatherInputStream*)[self alloc] initWithArray:dataArray] autorelease];

3

GTMHTTPFetcherLogging.m ( HTTPFetcher)

...

NSString *escapedResponseFile = [responseDataFileName stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

... to

NSString *escapedResponseFile = [responseDataFileName stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];

4

GTL , Apple LLVM 7.0 Warnings - All Languages ​​

...

= YES

... to

= NO


+8

@andrewbuilder .

- IOS 8,

#define GTM_USE_SESSION_FETCHER 1

#define GTM_USE_SESSION_FETCHER 0

GTMOAuth2Authentication.h GTLService.h.

- IOS 9, GTMHTTPFetcher GTMSessionFetcher (https://code.google.com/p/gtm-session-fetcher/).

: https://github.com/google/google-api-objectivec-client/issues/88

+5

API Google API Objective-C JSON-RFC REST ( ).

enter image description here

, , - .

https://github.com/google/google-api-objectivec-client

git clone --recursive https://github.com/google/google-api-objectivec-client-for-rest.git
+1

. , .

, . , , Xcode.My Directory

/Users/maclover/Xcode Test Projects/Manager/gtm-session-fetcher/Source/

, ,

/Users/maclover/Desktop/Manager/gtm-session-fetcher/Source/

GTLTouchStaticLib . C.

, #define GTM_USE_SESSION_FETCHER 1 #define GTM_USE_SESSION_FETCHER 0, . , Google 10 .

0

, , Google API.

:

pod 'GoogleAPIClient'

: GoogleApiClient

0

1

GTMOAuth2Authentication.h

#define GTM_USE_SESSION_FETCHER 1  to #define GTM_USE_SESSION_FETCHER 0

2

GTMGatherInputStream.m

 return [[[self alloc] initWithArray:dataArray] autorelease];
  ... to 
 return [[(GTMGatherInputStream*)[self alloc] initWithArray:dataArray] autorelease];

STEP 3 as picture: ios version chooses less than ios 9

STEP 4 enable bit code

-1
source

Source: https://habr.com/ru/post/1609301/


All Articles