Sending Email From A Cocos2dx Game

As the title suggests , i wish to be able to send an email from within the game that i am developing using cocos2dx.
Can anyone help me on this …

I tried implementing using the MessageUI Framework but failed. If anyone has successfully done it then please share some advise on implementing it.
Thanks

i just tested it on device (iPhone 4s) and it works perfectly there!
so is it the case that the email functionality does not work on the simulator…somehow i doubt that

can you give me some advise about using MessageUI framework on cocos2dx games to send messages or e-mails ?
then i test this framework on my iphone4 but it works worse,the position of message view is wrong then in the cocos2d-x game.how you use this framework?
thanks a lot.
Rakshak Kalwani wrote:

i just tested it on device (iPhone 4s) and it works perfectly there!
so is it the case that the email functionality does not work on the simulator…somehow i doubt that

HERE:

https://github.com/Piperoman/CCSocialNetwork

You can download an example that send e-mails, tweets, and facebook messages on iOS and Android using independent interfaces. If you need help after check it, ask here.

Hi,

I tried to implement your solution “CCSocialNetwork”, but I met some problems.
For tweets and email, it’s ok but for facebook, I have an error :

12-11 14:51:46.195: E/AndroidRuntime(7778): java.lang.ExceptionInInitializerError
12-11 14:51:46.195: E/AndroidRuntime(7778): at com.facebook.android.Facebook.autoPublishAsync(Facebook.java:1047)

Also, I think there are some errors in the code, for example the mGLView is not declare and the function “setPackageName” doesn’t exist?

Thank you for your help.

Wilfrid

Have you added the Java library?
Have you added the java files?

If you describe step by step what are you doing I could help you better.

Here you have a post about it!

http://www.cocos2d-x.org/boards/6/topics/12492

Did you run first the project CCSocialNetwork?

Hi,

Thank you for your answer.
I follow the link that you give and I think that my problem is solved.

“The problem was
you were trying to run it on different thread but it should on the main thread.”

I’m a beginner in cocos2dx and you “CCSocialNetwork” helps me a lot, in fact I can’t find other way to intgrate facebook in the game.
Thank you

Wilfrid

Thank you Pipero.
My problem is almost solved by the link you give.
The only problem is the position of the view in MessageUI.framework is incorrect and it can’t be adjusted.

Thank you Pipero.
My problem is almost solved by the link you give.
The only problem is the position of the view in MessageUI.framework is incorrect and it can’t be adjusted.

Hi PIpero,

Have you verified whether the mail sending solution work on iOS 6? because I encountered error when running it on iOS6, but it works fine on iOS 5.1.

Thanks
Son

Hi Pipero,

I think these few lines caused the error on iOS6, I could run it fine after commenting out them.

// If these three lines are commented, the mail dialogue window will be shown incorrectly (rotated 90º)
// CGAffineTransform rotate = CGAffineTransformMakeRotation(3.14/2);
// rotate = CGAffineTransformScale(rotate, 0.1, 0.8);
// [view setTransform:rotate];

Son

You can also try email services provided by many cloud service providers like App42 from Shephertz. They provide separate SDK written for cocos2dx in c++. So you don’t have to go native to send emails.