1

I'm using AFNetworking inside my iOS App without any problem. But now, I need to perform some API calls to my backend from my TodayExtension.

When I have tried to add any kind of AFNetworking class to my TodayExtension target, the compiler crash.

Undefined symbols for architecture armv7:
  "_AFNetworkingErrorDomain", referenced from:
      -[AFHTTPRequestOperation error] in AFHTTPRequestOperation.o
  "_AFNetworkingOperationFailingURLResponseErrorKey", referenced from:
      -[AFHTTPRequestOperation error] in AFHTTPRequestOperation.o
  "_AFNetworkingOperationFailingURLRequestErrorKey", referenced from:
      -[AFHTTPRequestOperation error] in AFHTTPRequestOperation.o
  "_OBJC_METACLASS_$_AFURLConnectionOperation", referenced from:
      _OBJC_METACLASS_$_AFHTTPRequestOperation in AFHTTPRequestOperation.o
  "_OBJC_CLASS_$_AFURLConnectionOperation", referenced from:
      _OBJC_CLASS_$_AFHTTPRequestOperation in AFHTTPRequestOperation.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Is there any way to use it? What is the best way to call my API from TodayExtension? Maybe using NSURLSession?

EnriMR
  • 3,924
  • 5
  • 39
  • 59

0 Answers0