Aldrich Barcenas
Posts: 0
Joined: Wed Apr 30, 2014 8:50 am

SNS Sharing Passing paramter and loading native App

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)

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

SNS Sharing Passing paramter and loading native App

Hello Aldrich,

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

Aldrich Barcenas
Posts: 0
Joined: Wed Apr 30, 2014 8:50 am

SNS Sharing Passing paramter and loading native App

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

SNS Sharing Passing paramter and loading native App

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

Aldrich Barcenas
Posts: 0
Joined: Wed Apr 30, 2014 8:50 am

SNS Sharing Passing paramter and loading native App

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.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

SNS Sharing Passing paramter and loading native App

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.

Return to “Issues”