0

I've got Shortcuts up and running but now I want to actually link in my network code which uses the GCDAsyncSocket CocoaPod. Once I include my network manager class into my IntentsHandler I get a "Lexical or Preprocessor issue" and that GCDAsyncSocket.h is not found.

I believe this is because the CocoaPods are not installed in my Intent Target. However if I configure my Podfile to add my pods to my Intent Target (I tried adding it to my Intent and IntentUI targets) I get all kinds of other errors. Took me awhile to get things back to normal as I had to clean and delete the derived data to clean it all up.

I know this is just one error in a long line of issues that will crop up including all the other objects I have linked in with that network manager class I have. I assume I will have to add all of them to my Intents targets which will lead to more errors like this that all brings in more CocoaPods and other classes I have. Before I go down this path again I want to ask if this is what the actual issue is likely to be? Or if anyone else has any suggestions on how to deal with this?

Edit : The error that occurs when I add the cocoapods to my Intent Target is...

'sharedApplication' is unavailable: not available on iOS (App Exentsion)... AFRKNetworkActivityIndicatorManager.m

In this case my RestKit pod is causing the issue. Which is imported into my network manager class I need to use as I need to push something to a server whenever this shortcut is called. I'm using RestKit to talk to my RESTful server.

Etep
  • 533
  • 7
  • 20

1 Answers1

0

This SO post helped resolved the issue for me...

UIApplication.sharedApplication not available

I tried setting the Require Only AppExtension-Safe to NO. But I still had the issue. But it led me to understand that this wasn't a simple fix.

I then removed the one cocoapod that was causing the issue (RestKit in this case) and then was able to get everything else hooked up. I've had to rework my network code a bit for this special case so that it doesn't use RestKit. For this one instance I use CocoaAsyncSocket and POST my request manually that way. Not the best as it's a bit messier in code but will have to do. Unless RestKit removes that requirement.

Etep
  • 533
  • 7
  • 20