Open matrixreal opened 9 years ago
@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
1) i'm using lastest version of your fork
2) 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 ...
1) 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)
2) 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]
show me your code
when i'm using
var appUtils = new Ejecta.AppUtils(); appUtils.saveImage(canvas, "${Documents}/test.png", function(filePath){ console.log(filePath); }); just like that with "
i got 2015-09-06 18:23:26.370 Swing Copters[8011:60b] SyntaxError: JSON Parse error: Expected ']' at line 3695 in index.js
when i replace " by ' like that
var appUtils = new Ejecta.AppUtils(); appUtils.saveImage(canvas, '${Documents}/test.png', function(filePath){ console.log(filePath); });
i got
Sep 6 17:37:48 iPhone-4 Ejecta[7875] : 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
please init canvas , then draw something on it first.
how can i do it please ? thank you a lot
I think this is a basic question. if you don't know how to “initialize canvas and draw something” ,how do you use ejecta ?
Are you a javascript programer? Do you know how to use ejecta?
@finscn i'm so sorry ... i have bad english if you mean this
var canvas = document.getElementById('canvas'); canvas.width = w; canvas.height = h;
so it is already implemented on the main file (index.js)
what's value of w and h ?
@finscn hi thanks for reply w=window.innerWidth; h=window.innerHeight
do you draw something on The canvas?
yes of cource i have completely game from construct 2 and impact js they are drawn on the canvas like the screen shoot posted before you can see that the game is lunching so it's drawn on canvas no ?
I've no idea. I test it and everything is ok.
are you using webview ?
no。but i think it doesn't matter.
@finscn i will give it a test again thanks anyway
@finscn same again are you using '${Documents}/test.png' or "${Documents}/test.png" ?
@matrixreal , ' or " is not key point , I think.
all code in my testing index.js :
var width = window.innerWidth;
var height = window.innerHeight;
var canvas = document.getElementById('canvas');
canvas.width = width;
canvas.height = height;
canvas.retinaResolutionEnabled = true;
var context = canvas.getContext("2d");
context.fillStyle="#666666";
context.fillRect(0,0,width,height);
var appUtils = new Ejecta.AppUtils();
appUtils.saveImage(canvas, "${Documents}/test.png", function(filePath){
console.log(filePath);
});
by adding this var context = canvas.getContext("2d"); the error goes and it say like it saved to image/test.png but if i use this image to share it show nothing
got this 2015-09-07 09:06:12.985 Swing Copters[709:60b] JS LOG: /var/mobile/Applications/F5FAAE3C-9FAC-4791-989B-259B3B1CA471/Swing Copters.app/App/image/test.png but when i want to share this image .... there is no image with the twitter with this dialogsocial.showPostDialog('twitter', 'message', "http://you-want-to-share-URL", 'image/test.png');
if you save image use "${Documents}/test.png" , when share, must also use it :
dialogsocial.showPostDialog('twitter', 'message', "http://you-want-to-share-URL", '${Documents}/test.png');
you mean social.dialog ? or dialogsocial ?
It's just a var name. you can use any name.
@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 ?