How to implement facebook send, twitter share, send sms, send email in my phonegap android application?

会有一股神秘感。 提交于 2019-12-01 11:26:23

问题


As i am using HTML based phonegap framework, i need a plugin to implement this. when i searched over google, i got two revelent searches.

  1. http://tech.sarathdr.com/featured/android-phonegap-plugin-for-social-share-email-facebook-twitter-and-sms

    a. In the above twitter functionality is not implemented.

    b. There is a typo in the above facebook share code window.plugins.SendSms.social ----> (should be)window.plugins.ShareSocial.social

    c. As it is developed for phonegap 1.9, it has some deprecated methods to be used in the version phonegap 2.1.0,

    ctx.startActivity() ----> cordova.getActivity().startActivity() this.ctx.startActivityForResult ----> this.cordova.startActivityForResult com.phonegap ----> org.apache.cordova

    I have done all the above updates, now all my errors are gone but still nothing is happening when i click on the buttons email, sms, facebook( i correctly implemented the javascript click events for these buttons)

    Can anyone who knows java,phonegap plugin dev and javascript, Please implement the same plugin for 2.1.0 post sample code to show how it is working.I need it badly ASAP.

  2. https://github.com/phonegap/phonegap-plugins/tree/master/Android/Share

    There is no single example on how to use this plugin for my purpose. Even the official documentation is not helpfull.


回答1:


I have updated the same plugin for Cordova 2 Could you please try that and let me know if you still have the issue. http://tech.sarathdr.com/featured/social-share-plugin-for-android-cordova-2-2-0-email-sms-facebook-twitter-share




回答2:


Really a cool and usefull plugin! I had to make just two edit to make it work... First: change window.plugins.ShareSocial.sms in window.SocialShare.sms (for all the sharer)

Second: change SocialShare.prototype.sms in SocialShare.sms in social.js file

Now i have a question: can you give me any suggestion to add a share to twitter method?



来源:https://stackoverflow.com/questions/13218709/how-to-implement-facebook-send-twitter-share-send-sms-send-email-in-my-phoneg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!