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

Question: Any help regarding usage of the NSSharingService (composeEmail) #110

Open
de-robat opened this issue Aug 4, 2018 · 0 comments

Comments

@de-robat
Copy link

de-robat commented Aug 4, 2018

Hello, first of all - thanks for this library! I'm rather new within the Objective-C realm and therefore may have a fairly "dump" question. I managed to get the following code running within X-Code:

NSSharingService* mailShare = [NSSharingService sharingServiceNamed:NSSharingServiceNameComposeEmail];
NSLog(@"canPerform %@", [mailShare canPerformWithItems:nil] ? @"YES" : @"NO");
[mailShare performWithItems:nil];

This prints out canPerform YES, and opens the Users default Mail-Application.

But i cant make the same code work form node.js. Is my adaption to the syntax of NodObjC correct after all?

var mailShare = $.NSSharingService('sharingServiceNamed',$.NSSharingServiceNameComposeEmail);
console.log("canPerform", mailShare('canPerformWithItems',$.nil));
mailShare('performWithItems', $.nil);

This prints out canPerform true, and then nothing else happens. What am i doing wrong?
Any help is greatly appreciated!

(source code simplified for the sake of clarity, im attaching files and adding in a mail body in the concrete implementation)

Edit: Additional Information I tried adding my code into a self compiled Framework, just as showcased in this repo (Test-Framework). That yielded exactly the same result. I get the Print-Out canPerform YES but the Mail-Client is not launched. So that at least eliminates the possibility of me screwing up the translation for Objective-C to the NodObjC syntax or does it? Is this somehow a rights issue?

@de-robat de-robat changed the title Question about SharingService Question: Any help regarding usage of the NSSharingService (composeEmail) Aug 4, 2018
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

1 participant