Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 2    Views: 29

Kyle Boyett
Lost but trying
Profile
Posts: 32
Reg: Jan 03, 2015
Waynesville, GA
6,570
02/02/15 03:55 PM (9 years ago)

Socialize share issue

Hello, I'm gaining ground on my app development, but still have a lingering issue with my Socialize implementation. It works, to a point, but I'm not able to actually share the link that I want. What it does share is a page stating they have to download my app to view the content. While this is fine, since I will want more downloads, but I'd like for my users to be able to share the screen information with their friends without them having to download the app. I'm wanting to get it to actually send the link from my app to Facebook, email, etc. The link shared would be the same link the app uses to access the files for display. I'm planning on hosting these files on my website, and I figure it would save me a lot of hassle when it comes time to update information. If I have everything on my site, I could just update the files there, and have the app grab the new content. Eventually, I'll be working on an iOS version as well, and don't want to keep up with updating the same information on website, Android and iOS. I do have an open thread on their forum, and I've had a reply that it was possible to share a URL. Just didn't go into details, lol. I'm hoping with my reply that more details will be posted. http://support.getsocialize.com/socialize/topics/attempting-to-implement-socialize-with-buzztouch-v3-code-for-android-using-eclipse I'm thinking if the entity can share a link that includes the name/id of the entity, I can name my files to match, and solve my problem. Here's hoping that I get this figured out, because I do like all the information I can see on my getsocialize dashboard.... I guess there wasn't really a reason to make this post, but if there are any other buzztouch users out there using socialize, maybe this will help us all. Thanks for all the help I've received here. As soon as I'm happy with my app, I'll gladly share what I've accomplished. Kyle
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
02/02/15 07:17 PM (9 years ago)
Third party sdks usually always have documentation to help out.sometimes its clear and sometimes not. Have never used socialize but looks pretty easy.. http://socialize.github.io/socialize-sdk-android/sdk_user_guide.html?v=v3.1.3#sharing
 
Kyle Boyett
Lost but trying
Profile
Posts: 32
Reg: Jan 03, 2015
Waynesville, GA
6,570
like
02/03/15 03:57 AM (9 years ago)
Easy, lol. The link you posted does point to what I'm wanting to do, but just don't know which file this code needs to go in...or where to add the url to be shared. Customizing the Content of Facebook & Twiter Posts In some situations you may want to override the default behavior of posting to Facebook or Twitter. In these cases you can implement the onBeforePost method of the listener you pass to the ShareUtils call Entity entity = Entity.newInstance("http://myentity.com", "My Name"); // Setup the options for display int options = ShareUtils.SOCIAL; // This is just a shortcut for Twitter, Facebook and Google+. // The "this" argument refers to the current Activity ShareUtils.showShareDialog(this, entity, new SocialNetworkDialogListener() { @Override public void onCancel(Dialog dialog) { // User cancelled } @Override public void onError(SocializeException error) { // Handle error } @Override public void onNetworkError(Activity context, SocialNetwork network, Exception error) { // Failed to post to given network } @Override public boolean onBeforePost(Activity parent, SocialNetwork socialNetwork, PostData postData) { // Change data for facebook post if(socialNetwork != null && socialNetwork.equals(SocialNetwork.FACEBOOK)) { postData.getPostValues().put("foo", "bar"); } return false; } }, options); and this code.... Customizing the Content of Email & SMS Posts You can also override the default text for email and sms shares Activity context = this; Entity entity = Entity.newInstance("http://myentity.com", "My Name"); // Setup the options for display. This can be anything but for this example we will limit to email/sms int options = ShareUtils.EMAIL | ShareUtils.SMS; // Display the share dialog with these options ShareUtils.showShareDialog(context, entity, new SocialNetworkDialogListener() { @Override public boolean onBeforePost(Activity parent, SocialNetwork socialNetwork, PostData postData) { // For email/SMS the socialNetwork will be null but we can change postData // Possible values are EXTRA_TEXT, EXTRA_SUBJECT and EXTRA_TITLE postData.getPostValues().put(ShareUtils.EXTRA_TEXT, "This is custom text set in the listener! " + postData.getPropagationInfo().getEntityUrl()); // Return false to indicate we want to continue with the share (i.e. NOT cancel) return false; } }, options); I'm wanting to pass along the URL of the file the app is showing....www.mysite.com/files/entityid I'm not giving up, I will figure this out....just may take a while, lol Thanks, Kyle
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.