Page 1 of 1

SNS Sharing Passing paramter and loading native App

Posted: Thu May 08, 2014 5:15 am
by Aldrich Barcenas

Like to share a link through Facebook/Twitter and I am confused on how to do that. In Android, some apps have this share button where you can pass a parameter and loads that app.

I wonder if there is something similar to Appery. When I create a button for twitter and I will pass a parameter and load the twitter app? (this also goes the same for facebook)


SNS Sharing Passing paramter and loading native App

Posted: Thu May 08, 2014 6:16 am
by Evgene Karachevtsev

Hello Aldrich,

Please take a look at this link: https://dev.twitter.com/docs/tweet-bu...


SNS Sharing Passing paramter and loading native App

Posted: Thu May 08, 2014 6:31 am
by Aldrich Barcenas

So there is no way in Appery that it will tell the device to load the twitter app to share?


SNS Sharing Passing paramter and loading native App

Posted: Thu May 08, 2014 6:50 am
by Evgene Karachevtsev

Here is how to generate source for "twitt" button: https://about.twitter.com/resources/b...
You can use this generated code in appery.io


SNS Sharing Passing paramter and loading native App

Posted: Fri May 09, 2014 7:01 am
by Aldrich Barcenas

I got this code based on that given link:

Tweet

I placed the data attributes dynamically via page_show event on the page.

Image

On the button i used the navigate to link and add the link. Put the class in as well.

Image

Here is how I placed the javascript.

Image

When I test it, on the web browser, it doesn't include the target url I am placing. On the mobile (using Appery testing app) there same result.

Kindly provide instructions on how to integrate it on the page.


SNS Sharing Passing paramter and loading native App

Posted: Mon May 12, 2014 12:19 am
by Yurii Orishchuk

Hi Aldrich.

Your solution has some async problem. You fill data attributes after tweeter code used it.

So please try to use this easy solution:

1 Add HTML component on the page http://prntscr.com/3ieo26/direct

2 Click "edit js", navigate to "HTML Source" tab and paste your code in editor like this: http://prntscr.com/3ieots/direct

pre
code

<a href="https:&#47;&#47;twitter&#46;com/share" class="twitter-share-button" data-text="World" data-via="111" data-size="large" data-related="222" data-hashtags="3333" data-dnt="true">Tweet</a>
<script>!function(d,s,id){var js,fjs=d&#46;getElementsByTagName(s)[0],p=/http:/&#46;test(d&#46;location)?'http':'https';if(!d&#46;getElementById(id)){js=d&#46;createElement(s);js&#46;id=id;js&#46;src=p+':&#47;&#47;platform&#46;twitter&#46;com/widgets&#46;js';fjs&#46;parentNode&#46;insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

/code
/pre

That's all.

Regards.