evernote / evernote-sdk-ios Goto Github PK
View Code? Open in Web Editor NEWEvernote SDK for iOS
License: Other
Evernote SDK for iOS
License: Other
I'm trying to create a ,
, etc. but how can I do this with ENML writer? Doesn't seem to be any documentation on this subject
You need to change the value of the constants in 3rdParty/AFNetworking/ENAFURLConnectionOperation.h
and not just the name of the constants.
The values are globals in the entire App and if the App is also using AFNetworking by itself then bad things are happening
you cant use a domain name of a different company ( alamofire in this case)
are you Evernote or not???? it should be com.evernote....
It looks like you have a similar problem in SSKeychain.m
Line 195
width = [NSNumber numberWithInt:[resource width]];
height = [NSNumber numberWithInt:[resource height]];
As title says, whenever an image is used as attachment to be displayed in a webview, it won't show unless width & height are hardcoded
when archive project using sdk, header files are also added to the archive.
http://discussion.evernote.com/topic/38584-evernote-framework-mac-os-x-headers-and-generic-xcode-archive-solved/
this forum suggests;
Build Phases: Copy Headers: all headers to the Project section
which fix the issue
This works great in the simulator. But when I authenticate on my device with authenticateWithViewController I get Error saving to keychain: Error Domain=com.samsoffes.sskeychain Code=-25308 "The operation couldn’t be completed. (com.samsoffes.sskeychain error -25308.)" -25308
Error getting password from keychain: Error Domain=com.samsoffes.sskeychain Code=-25308 "The operation couldn’t be completed. (com.samsoffes.sskeychain error -25308.)". Any ideas?
0 libobjc.A.dylib 0x3962e66a objc_release + 10
1 AppName 0x000ad4d5 -[EvernoteSession userStore] (EvernoteSession.m:249)
2 AppName 0x0010fea3 -[ENAPI userStore] (ENAPI.m:82)
3 AppName 0x00116b05 __64-[EvernoteUserStore getBootstrapInfoWithLocale:success:failure:]_block_invoke (EvernoteUserStore.m:67)
4 AppName 0x00110af3 __44-[ENAPI invokeAsyncIdBlock:success:failure:]_block_invoke (ENAPI.m:191)
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString hasSuffix:]: nil argument'
0 CoreFoundation 0x2deb0fd3 __exceptionPreprocess + 131
1 libobjc.A.dylib 0x38727ccf objc_exception_throw + 36
2 CoreFoundation 0x2deb0f15 +[NSException raise:format:] + 102
3 CoreFoundation 0x2de2dfa9 -[__NSCFString hasSuffix:] + 90
4 AppName 0x000be0fb -[EvernoteSession emptyCookieJar] (EvernoteSession.m:343)
5 AppName 0x000be205 -[EvernoteSession authenticateWithViewController:completionHandler:] (EvernoteSession.m:375)
Authentication trip to Safari can be a source of problems, similar like SSO for Facebook (authentication trip to Safari or Facebook app). Moreover, user has to quit the app he is using. What is the roadmap? Would you consider to do authentication within the sdk in UIWebView, so that user does not need to quit the app, or this is a preparation for Single Sign On in a Facebook way?
currently I will always get EvernoteSDKErrorCode_TRANSPORT_ERROR=-3000
even if there was no error and the user just pressed the Cancel (top left) or the de-authorize buttons
If a token has expired, and I have messages waiting to be sent, I need to call the login
if there is a networking error I need to wait and try again latter
but if the user decides at this point to de-authorize the App, I need to delete all the pending messages
I want to upload HTML note.
note.content = [ENNoteContent noteContentWithSanitizedHTML:string];
According to the Evernote Documentation, developers can request a Developer Token for accessing their personal Evernote account.
There does not appear to be a way in the iOS SDK to utilize this ability.
The convertENMLToHTML API is not working correctly when the Note has attributes as color and fonts. They are lost in the resulting HTML.
Terminating app due to uncaught exception 'Invalid EvernoteSession setup', reason: 'Please add valid CFBundleURLTypes and CFBundleURLSchemes to your app's Info.plist.''
I've read the instruction and here is my info.plist:
CFBundleURLTypes
CFBundleURLSchemes
evernote key
fbkey
evernote key and fbkey masked out.
The new authentication system (using a view controller instead of opening the external browser) in EvernoteSession
doesn't currently allow to show a loading indicator when authentication is started. To be explicit, we need some way to get informed when the temp-token is fetched to hide a previously displayed activity indicator. Here are a couple of techniques to do things like that in Objective-C:
EvernoteSession
NSNotification
using the NSNotificationCenter
authenticateWithViewController:completionHandler:
(Callback-Blocks are usually not used for things like that (because they retain everything used in it for a potentially long time), they are a bit misused in the evernote-sdk)How to use both US and CN service?
Is as title.
This code of EvernoteSession is bad. You are making assumption about user's preferred service just using his locale. In fact, you are subverting his's choice by forcing YinXiangBiJi on him only because he is using Chinese even thought he explicitly states that he wants to use Evernote by specifying BootstrapServerBaseURLStringUS as host. Please don't do that and let users choose their own service.
+ (void)setSharedSessionHost:(NSString *)host
consumerKey:(NSString *)consumerKey
consumerSecret:(NSString *)consumerSecret {
EvernoteSession *session = [self sharedSession];
// First see if we already have a profile
if([ENCredentialStore getCurrentProfile] == EVERNOTE_SERVICE_YINXIANG) {
session.host = BootstrapServerBaseURLStringCN;
}
else if([ENCredentialStore getCurrentProfile] == EVERNOTE_SERVICE_INTERNATIONAL) {
session.host = BootstrapServerBaseURLStringUS;
}
// If not, check what boostrap server you want to use based on the locale
else if([host isEqualToString:BootstrapServerBaseURLStringUS] || [host isEqualToString:BootstrapServerBaseURLStringCN]) {
NSString* locale = [[NSLocale currentLocale] localeIdentifier];
if ([[locale lowercaseString] hasPrefix:kBootstrapServerBaseURLStringCN]) {
session.host = BootstrapServerBaseURLStringCN;
}
else {
session.host = BootstrapServerBaseURLStringUS;
}
}
else {
session.host = host;
}
session.consumerKey = consumerKey;
session.consumerSecret = consumerSecret;
}
I am trying to use via cocoapods but I am getting issues because the evernote ios sdk is dependent on and outdated version of SSKeychain.
Error Message:
[!] Evernote-SDK-iOS (1.3.1) tries to activate SSKeychain (= 0.2.1)', but already activated version
1.2.1' by Podfile.
There is a build error with v0.1.4 with the 3rdParty thrift classes.
File TSocketServer.m references TNSFileHandleTransport.h which has been subsequently removed in this version.
See line #22:
Hello,
I downloaded the latest evernote sdk and was trying to run the sample app. But its not running. It builds successfully, but doesnt show on either simulator or device.
In OAuth authorization page, UIWebView does not a catch URL which begin with en-(id?)://response?oauth_token=(token)&oauth_verifier=(verifier) after user's authentication.
I peeked request URL in webView:shouldStartLoadWithRequest:navigationType:., but I counld n't find such as URL.
It's my account's or codes' bug? or server's specification has been changed.....?
My workaround is that to make UIWebViewDelegate catch othe URL such as https://sandbox.evernote.com/Home.action?en-(id?)://response?oauth_token=(token)&oauth_verifier=(verifier) by the following code.
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
NSLog(@"%@", [request.URL absoluteString]);
if ([[request.URL absoluteString] hasPrefix:self.oauthCallbackPrefix]) {
// this is our OAuth callback prefix, so let the delegate handle it
if (self.delegate) {
[self.delegate oauthViewController:self receivedOAuthCallbackURL:request.URL];
}
return NO;
}
else if ([[request.URL query] hasPrefix:self.oauthCallbackPrefix]) {
// this is our OAuth callback prefix, so let the delegate handle it
if (self.delegate) {
NSURL *newURL = [NSURL URLWithString:request.URL.query];
[self.delegate oauthViewController:self receivedOAuthCallbackURL:newURL];
}
return NO;
}
return YES;
}
It is not urgent, but it would enhance user experience, if there was some indicator of network communication during loading authorisation web view. Something like this (after clicking on "prihlasit sa" (login) authorisation starts, and UIActivityIndicatorView in upper right corner starts to spin)
Uploaded with ImageShack.us
Using iOS 5.1. when using the new API, my app always crashed at (https://github.com/evernote/evernote-sdk-ios/blob/master/evernote-sdk-ios/EvernoteSession.m#L320.
The console show following message:
-[__NSArrayM objectAtIndexedSubscript:]: unrecognized selector sent to instance 0xd197fe0
I noticed NSArray objectAtIndexedSubscript only available in iOS 6.0 or later (https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html).
Replace the line:
EDAMBootstrapProfile *profile = info.profiles[0];
with
EDAMBootstrapProfile *profile = [info.profiles objectAtIndex:0];
Fixes the issue.
Third party libraries like SSKeychain should not be included as part of the podspec, they should be included as pod dependencies pointing to the relevan pods. Right now if your project requires SSKeychain and Evernote SDK the SSKeychain files will conflict and you will get duplicate symbol errors.
+load
is a method defined by NSObject
that is run when a class or category is loaded by the Objective-C runtime.
However, ENCredentialStore
has overridden this method to unarchive the credentials stored in NSUserDefaults
.
Hello,
I applied for production key, I got the mail from developer team , that it has been activated, so I tried changing the host from sandbox to production, but I get error
Error authenticating with Evernote service: Error Domain=com.evernote.sdk Code=-3000 "The operation couldn’t be completed.
But it works with sandBox though, not understanding whats going wrong, please help
Regards
Ranjit
Hi there,
I get a name conflict at GCOAuth.h and NSData_Base64.h when using the sdk, maybe you can prefix it with EN to avoid name collision?
I have merged the two platforms into one codebase and provided a Mac code sample.
https://github.com/cbess/EvernoteCloudSDK
Please provide a similar codebase.
Getting this error.
Undefined symbols for architecture i386:
"OBJC_CLASS$_EvernoteSession"
The set up I have is that I created a submodule in under my project folder, so evernote lives in Project_dir/Submodules/evernote
In my header search path, I set it to be "${SOURCE_ROOT}/Submodules/evernote/evernote-sdk-ios"
Am I doing something wrong?
dismissModalViewControllerAnimated: and presentModalViewController:animated: had been deprecated in iOS6 or later.
For support iOS6 earlier and later, I used the following code.
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000
[self presentViewController:vc animated:YES completion:^(void){}];
#else
[self presentModalViewController:vc animated:YES];
#endif
The SDK code triggers too many warnings. Please turn on -Wsign-compare, -Wstrict-selector-match and -Wunknown-pragmas so you can see the issues and hopefully clean up the code.
I got this zombie object when i trying to authenticate without internet connection.
-[__NSDictionaryM objectForKey:]: message sent to deallocated
this is my Authentication Code
-(void)EverNoteIntegrate:(UISwitch *)everNote{
[[GAI sharedInstance].defaultTracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Setting" action:@"Evernote" label:everNote.on?@"YES":@"Close" value:nil]build]];
if (everNote.on) {
[[EverNoteSync sharedClient] initlize:self WithStatus:^(BOOL status) {
if (status) {
if (![AppLocalData isBefoEvernoteNoteBook]) {
if ([SDCloudUserDefaults stringForKey:@"BefoNotebookGUID"]) {
[AppLocalData setEvernoteBefoNotebookGUID:[SDCloudUserDefaults stringForKey:@"BefoNotebookGUID"]];
[AppLocalData setBefoNoteBookForEverNote:YES];
}else{
[EverNoteSync createBefoNoteBook:^(BOOL noteBookstatus,NSError *error) {
if (!error) {
if (noteBookstatus) {
[AppLocalData setBefoNoteBookForEverNote:noteBookstatus];
}else{
[AppLocalData setBefoNoteBookForEverNote:NO];
}
}else{
if (error.code == 10 && [[error.userInfo valueForKey:@"parameter"]isEqualToString:@"Notebook.name"]) {
[AppLocalData setEvernoteBefoNotebookGUID:[SDCloudUserDefaults stringForKey:@"BefoNotebookGUID"]];
[AppLocalData setBefoNoteBookForEverNote:YES];
}
}
}];
}
}
}else{
everNote.on = NO;
}
}];
}else{
[[EvernoteSession sharedSession] logout];
}
}
We want to develop a app base on evernote-sdk, I want to know how to edit the existing note that's content is a html string. Need a API implement that html string to ENML?
Hi
It would be great to be able to update our work via cocoa pods. I tried pointing to this github but only got:
Updating spec repo `master'
Evernote-SDK-iOS' No podspec exists at path
/Users/Iain/Xcode projects/EvernoteDone/Pods/Evernote-SDK-iOS/Evernote-SDK-iOS.podspec'.Instead of do this
- (void)applicationDidBecomeActive:(UIApplication *)application {
[[EvernoteSession sharedSession] handleDidBecomeActive];
}
Evernote SDK can subscribe for UIApplicationDidBecomeActiveNotification. And do this thing internally.
Couldn't find any such functionality in the SDK. Is this planned for, or did I miss it?
When user cancels authentication, according to this error code should be -2998, but it's -3000.
This is no longer a valid way to initialize the session...
// set up Evernote session singleton
EvernoteSession *session = [[[EvernoteSession alloc] initWithHost:EVERNOTE_HOST
consumerKey:CONSUMER_KEY
consumerSecret:CONSUMER_SECRET]
autorelease];
[EvernoteSession setSharedSession:session];
Should be:
// set up Evernote session singleton
[EvernoteSession setSharedSessionHHost:EVERNOTE_HOST
consumerKey:CONSUMER_KEY
consumerSecret:CONSUMER_SECRET] ;
I tried the following code to delete note
[[EvernoteNoteStore noteStore]deleteNoteWithGuid:noteGuid success:
^(int32_t usn){
success(usn);
}
failure:^(NSError* error){
failure(error);
NSLog(@"error=%@",error.description);
}];
but it alway enter failure block and the error was
Error Domain=com.evernote.sdk Code=1 "No information available about the error" UserInfo=0xb924d30 {NSLocalizedDescription=No information available about the error}
I sure about auth because I was able to add not.
Sorry should be closed. I was on the wrong branch
i am using the sample app for ios device
after putting my CONSUMER_KEY and CONSUMER_SECRET
NSString *EVERNOTE_HOST = @"sandbox.evernote.com";
NSString *CONSUMER_KEY = @"moathothmanaliwat";
NSString *CONSUMER_SECRET = @"efd4e31c335c9f8f";
then tap o authentication button ...
interring username and password ..correct one of my account on evernote
i get that message ...incorrect username and/or password
what do i need to do ?!
first time i use evernote sdk ...
thank you
is the SDK just support IOS 6 and above? how to use the SDK in IOS 5?
Not sure the problem, but after a fresh auth i can fetch notebooks, etc just fine. After a little time passes and i run the app it will authenticate but notebook/note/etc lookups all fail (error 9).
Looking at the token it is there and not nil, so im not really sure why my lookups start to fail and dont see any exposed methods other than completely logging out and back in to fix.
When trying to run a 64-bit simulator I got error message:
No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).
I fixed this problem by doing:
Project Target > Build Settings > Architectures
and make
Build Active Architecture Only = NO
but then I got "Undefined symbols for architecture i386" for libevernote-sdk-ios.a
I fixed this problem by repeating the above procedure for the evernote-sdk-ios project
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.