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

Evernote SDK in an extension framework #155

Open
agiletortoise opened this issue Dec 29, 2017 · 6 comments
Open

Evernote SDK in an extension framework #155

agiletortoise opened this issue Dec 29, 2017 · 6 comments

Comments

@agiletortoise
Copy link

The SDK is currently not well behaved when residing in framework which is set to only "allow app extension API only".

Are their build flags to make this build in an extension friendly manner or any plans to better support this use? It seems the main problem are authentication-specific calls using UIApplication.sharedApplication.

@imougy
Copy link
Contributor

imougy commented Dec 29, 2017

So you are saying that if you build an extension app, you can’t use the SDK? Can you make a sample project?
Happy holidays.

@agiletortoise
Copy link
Author

agiletortoise commented Jan 9, 2018

I'm referring to the fact that for a framework to be able to be included in an extension target, it must comply with the limited APIs available in extensions (per the checkbox shown in Xcode).

The main problem call is the [[UIApplication sharedApplication] openURL], which is not allowed in an extension.

It would be nice if there was a way to segment the SDK and include it in a framework safe version, with the authentication pieces that need that method separated do they could be included separately in the parent app.

You can test this by including the Cocoapod in a framework target with this checkbox checked.

drafts xcodeproj 2018-01-09 15-18-37

@imougy
Copy link
Contributor

imougy commented Jan 9, 2018

I see. I will take care of it.

@imougy
Copy link
Contributor

imougy commented Feb 23, 2018

@agiletortoise, I looked further into it. We can make the extension compile but as you know, openURL only works for Today's extension, no other extension can use openURL. If this is the case, I am wondering if it is best to create your own app, link Evernote SDK to it and then make your extension. What kind of extension are you working on? We can talk about it on the side if you wish.
Thanks,

@agiletortoise
Copy link
Author

agiletortoise commented Feb 24, 2018

Thanks for taking a look. I'm the developer of Drafts (http://agiletortoise.com/drafts), a popular automation app on iOS. I've been updating the app with a lot more flexibility. Ultimately, I would prefer just to do my own integration directly with a REST API because I have my own OAuth layer, etc., but Evernote doesn't seem to offer a straight-forward direct REST/JSON type API. Maybe I'm missing it, but all the thrift overhead seem to make it prohibitive to integrate without using one of the SDKs and doing so does not seem to be supported or documented.

The new Drafts is architected in cross-platform frameworks, and if I continue to support Evernote, there's no clear path to do it for me. My OAuth tier works fine with the Evernote OAuth endpoints. Short of a direct API without all the overhead, I'm not sure what I can integrate that will work in frameworks across iOS and Mac.

It looks like this SDK could be abstracted into two parts - (1) a cross-platform integration piece which handled the Evernote note integration calls, and (2) a helper to make authentication on iOS easier. The later could optionally be used only if needed in the main app bundle. (1) could be init'd with an OAuth token from (2) or obtained directly. I haven't had the time/resources to try to fork it and see if that assessment makes sense – it does, I think (1) could be a Mac/iOS SDK, since the other Mac SDK offering is abandoned, best I can tell.

Any thoughts? Am I crazy or is this doable?

@imougy
Copy link
Contributor

imougy commented Feb 28, 2018

@agiletortoise, sorry for the delay.
So it seems you don't want - (void)authenticateWithViewController:(UIViewController *)viewController in ENOAuthAuthenticator but instead, you want something like -(void) authenticateWithData:(NSData*):dataFromOAuth). Where the dataFromOAuth is the return from your own authentication endpoints. Correct?

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

2 participants