Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.27 release do not work with iOS Share Extensions #2440

Open
rafaelks opened this issue Jul 11, 2016 · 8 comments
Open

0.27 release do not work with iOS Share Extensions #2440

rafaelks opened this issue Jul 11, 2016 · 8 comments

Comments

@rafaelks
Copy link

Since 0.27 version, we're not able to use RestKit because the AFNetwork version dependency isn't compatible with iOS Share Extensions (refer to this issue).

The version that RestKit is supporting of AFNetworking isn't updated to support iOS Share Extension, because it doesn't care about the definition of AF_APP_EXTENSIONS. I'm not very familiar with the dependency of AFNetworking here, but is there a possibility to move to 3.x version of AFNetworking?

The errors:

AFURLConnectionOperation.m:302:25

/Users/rafaelks/Projects/WHI/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m:302:25: 'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.

AFURLConnectionOperation.m:365:53

/Users/rafaelks/Projects/WHI/Pods/AFNetworking/AFNetworking/AFURLConnectionOperation.m:365:53: 'sharedApplication' is unavailable: not available on iOS (App Extension) - Use view controller based solutions where appropriate instead.
@valeriomazzeo
Copy link
Member

Since 0.27 version ...

The AFNetworking version hasn't changed, it's still 1.3.4. It has only been wrapped.

Are you trying to use RestKit or AFNetworking in your extension?

I am not sure this was working before either, if it was for you, could you please describe your project setup?

Also, the error you are getting are from AFNetworking files with AF prefix. Everything has been renamed AFRK.

You can now install AFNetworking 3.0 and do whatever you like with it, meanwhile RestKit will continue use 1.3.4 internally.

So if you just want to use AFNetworking I don't see the issue here.

@rafaelks
Copy link
Author

@valeriomazzeo You're complete right. AFNetworking 1.3.4 was from another dependency in the project. I got confused, lol. It's all fine now, thank you!

@valeriomazzeo
Copy link
Member

Although, if you want to use RestKit directly in an extension and for some reason it doesn't work, please add an example project to the repository and we can have a look :)

@rafaelks
Copy link
Author

Sure! I'll make the changes here and see if works. If not, I'll send the report. Thank you!

@rafaelks
Copy link
Author

@valeriomazzeo RestKit is really not working with Share Extension. I've created an example project so you can take a look on the problem: RestKit Share Extension.zip

@rafaelks rafaelks reopened this Aug 30, 2016
@valeriomazzeo
Copy link
Member

Hi @rafaelks, thanks for reporting this.

I am afraid I won't be able to look into this anytime soon.
In the meantime a pull request that adds share extensions support is definitely welcome.

@rafaelks
Copy link
Author

@valeriomazzeo That's fine. The problem is inside the AFNetworking dependency, maybe we can wait until RestKit migrates to AFNetworking 2.0 or 3.0?

@charlymr
Copy link

charlymr commented Nov 24, 2016

The problem is that AFNetwoking is using sharedApplication to update the network indicator and background download. A simple fix (if you can live without it) is to branch RestKit, use this as your Pod and comment out the offenders.

  [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:[self isNetworkActivityIndicatorVisible]];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants