Ejecta
Ejecta copied to clipboard
social share and share a png ?
@finscn hi i see that in social.m and social.h the image call is implemented but how can we call the social share with image ? i use
var social = new ejecta.social(); var message = "hello";
and the call is openshare.social(message);
how to add the image to the call ?
@finscn any suggestion ? because it's already implemented on your code see social.m thanks for feedback
In china , I can't visit twitter and facebook , I can't test the feature...
very sad news i'm searching about this since 3 months ok can you just give me a suggestion and i will test it ?
try:social.showPostDialog("twitter", "message", "url" ,"imgSrc", callback)
try: social.showPostDialog("twitter", "message", "url" ,"imgSrc", callback)
ok i wil try it now and the image ? i put it in app folder and name it to "image.png" right ? [request addMultipartData:imageData withName:dataName type:@"image/png" filename:@"image.png"];
your file's name could be anything. but must in app folder (or it's sub folder)
I update my fork . Now you could use "${Documnets} ${tmp} ....
ok but not work when i use social.showPostDialog("twitter", "message", "url" ,"imgSrc", callback); got black screen when i use social.showPostDialog("twitter", "message", "url" ,"imgSrc", callback); got js error line 1 colum 30
but i will downloadthe latest fork and try again
same error
main file (index.js) should have this declaration right ? var social = new ejecta.social(); var message = "hello"; ?
please post your code .
I found that you don't like post your code when you ask some questions.
Your code is always a secret ?
no it's not secret this is what i use in the main file (index.js) i put var social = new ejecta.social(); var message = "hello"; and when i call the facebook or twitter message and image share i use exactly social.showPostDialog("twitter", "message", "url" ,"imgSrc", callback); and got black screen and the app don't lunch when i use social.showPostDialog(twitter, message, url ,imgSrc, callback); there is no black screen , the app lunch but the twitter share action not work and got the error js error js error line 1 colum 30 , 37 that's all :dango:
@finscn any news please ? i think we are not far from the goal !!! :dancers:
would you test on device?
i'm testing on real device
@finscn hi, here is what i have done and what i get
-
i'm using lastest version of your fork
-
i'm already logged in facebook and twitter app in my iphone (user and pass ok)
i'm using in the main js file (index.js) the following code
var social = new ejecta.social(); var message = "hello";
later in my app i'm using the call like : social.showPostDialog('twitter',message,'imgSrc');
this is the only one that work ... when i use social.showPostDialog("twitter",message,"imgSrc"); (with " and not ' i got error javascript , also when i use the word callback i got error javascript too ...
- with social.showPostDialog('twitter',message,'imgSrc'); i get the post dialog but with no image like screenshoot 1
(i already put an image.png that i would like to post in the app folder and in the project folder)
- when i click on share (publier in french) i got the message on displayed + done like screenshoot 2

but after 2 or 3 seconds it seem that fail to post it on facebook (it say impossible to publish because fail to connect to facebook) and i got the screenshoot 3
that is it ... i hope that will help and i think we are not far than the goal :dancer:
use:
social.showPostDialog('twitter', 'message', "http://you-want-to-share-URL", 'image/file.png');
there are 5 arguments : snsName ,message, shareUrl, imgSrc, callback if no message , shareUrl or imgSrc use null.
social.showPostDialog('twitter', 'message', null , 'image/file.png');
I can't visit twitter facebook, I'm so sorry for late replied
@finscn that's work thanks a lot
the last thing i want to ask you is how to take a screenshoot / snapshoot and save it to file.png (that can be used to be share with this method) ?
I think it's a little complex . I don't know how to do that
because i see your post here https://github.com/phoboslab/Ejecta/issues/210
@matrixreal https://github.com/phoboslab/Ejecta/issues/428
@finscn i use toDataURL(); and toDataURLHD(); call but it say "not supported for this context"
@matrixreal , please update . I add a function for save image/canvas
var appUtils = new Ejecta.AppUtils();
appUtils.saveImage(canvas, "${Documents}/test.png", function(filePath){
console.log(filePath);
});
the canvas could be screen-canvas , offscreen-canvas , or Image object.
@finscn i sorry for my bad english but i don't understand so this call is to take screenshoot and save it right ?
got this
Sep 6 17:37:48 iPhone-4 Ejecta[7875] <Error>: CGImageCreate: invalid image size: 0 x 0. 2015-09-06 17:37:48.726 Swing Copters[7875:60b] JS LOG: /var/mobile/Applications/040170E3-CE92-47D7-A2A8-668F69868459/Documents/test.png
show me your code