Would it be possible to use this code to share the "plot" page graph?
Would it be possible to use this code to share the "plot" page graph?
Hi Joe,
You can try it. Let me know if there are any problems.
Seems to be so, but you can try.
Hi Katya,
I added some code in the html panel for both a tweet button and a Facebook dialog. Now my app won't proceed to the "plot" page for me. I'm not sure what's going on. There was no real output in the "logcat" of Eclipse for me to screenshot and post here.
Thanks!
Hello! Any errors in console?
Here's what I could come up with. This kept appearing in the logcat. I'm not sure if it's related to the "button" click on the "record ride" page, but it's a continuous error that continues to repeat over and over again. What could this be?
And also, did you have any luck with the prompting to activate GPS prompt for the user after button click "initialize"?
Hello Joe! Sorry for delay with your question, working on it.
Could it be there there's some type of conflict in my html code on the panel component?
code <div id="plot1"></div>
<a href="https://twitter.com/share" class="twitter-share-button" data-text="Just finished a Ride" data-via="pedalcollective" data-count="none">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<title>My Feed Dialog Page</title>
</head>
<body>
<div id='fb-root'></div>
<script src='http://connect.facebook.net/en_US/all.js'></script>
<p><a onclick='postToFeed(); return false;'>Post to Feed</a></p>
<p id='msg'></p>
Code: Select all
<script>
FB.init({appId: "595575900470215", status: true, cookie: true});
function postToFeed() {
// calling the API ...
var obj = {
method: 'feed',
redirect_uri: 'http://www.thepedalcollective.com',
link: 'https://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://api.ning.com/files/rRUWEC*XQHyJ7cZiPRMjfeafBCS7z2xlOMSz34mPnQsVcivPG66W8NkhSwjKZmkmKCNuDyBGXOiFmgRnplWJ2IRQMm7SRCOs/Homebutton.png',
name: 'Pedal Collective Ride Recorded',
caption: 'Average Speed of Ride',
description: 'Post your Average Speed over Time for Cycling Excursions'
};
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
}
</script> </body>
</html>/code
Hello!
1) External scripts (for example http://connect.facebook.net/en_US/all.js) can't be connected in panel. It's better to do it through App settings - External resources.
2) do not paste entire html page in Panel. You can add it only inside the iframe.
So your code should look like this:
code<div id="plot1"></div>
<a href="https://twitter.com/share" class="twitter-share-button" data-text="Just finished a Ride" data-via="pedalcollective" data-count="none">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<div id='fb-root'></div>
<p><a onclick='postToFeed(); return false;'>Post to Feed</a></p>
<p id='msg'></p>
<script>
FB.init({appId: "595575900470215", status: true, cookie: true});
function postToFeed() {
// calling the API ...
var obj = {
method: 'feed',
redirect_uri: 'http://www.thepedalcollective.com',
link: 'https://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://api.ning.com/files/rRUWEC*XQHyJ7cZiPRMjfeafBCS7z2xlOMSz34mPnQsVcivPG66W8NkhSwjKZmkmKCNuDyBGXOiFmgRnplWJ2IRQMm7SRCOs/Homebutton.png',
name: 'Pedal Collective Ride Recorded',
caption: 'Average Speed of Ride',
description: 'Post your Average Speed over Time for Cycling Excursions'
};
function callback(response) {
document.getElementById('msg').innerHTML = "Post ID: " + response['post_id'];
}
FB.ui(obj, callback);
}
</script>/code
Thanks Marina!
Great news, the Twitter Button prompts the user to sign on and post a tweet.
The Facebook dialog link doesn't work however. When I click it, it does nothing. I've attached several images of the logcat errors that are occurring throughout the operation of the app.
Would this be more complex if I had radio buttons for both links, and a final "post" button that would post to both networks simultaneously?
Let's worry about that when we get the Facebook link working I suppose.
Any luck with prompting the user to enable GPS location tracking?
Thanks a million times!