Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Journey Recording using GPS Tracking

Would it be possible to use this code to share the "plot" page graph?

https://developers.facebook.com/docs/...

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Journey Recording using GPS Tracking

Hi Joe,

You can try it. Let me know if there are any problems.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Journey Recording using GPS Tracking

Seems to be so, but you can try.

Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Journey Recording using GPS Tracking

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!

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Journey Recording using GPS Tracking

Hello! Any errors in console?

Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Journey Recording using GPS Tracking

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"? Image

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Journey Recording using GPS Tracking

Hello Joe! Sorry for delay with your question, working on it.

Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Journey Recording using GPS Tracking

Could it be there there's some type of conflict in my html code on the panel component?

code <div id="plot1"><&#47;div>

<a href="https:&#47;&#47;twitter&#46;com&#47;share" class="twitter-share-button" data-text="Just finished a Ride" data-via="pedalcollective" data-count="none">Tweet<&#47;a>
<script>!function(d,s,id){var js,fjs=d&#46;getElementsByTagName(s)[0],p=&#47;http:&#47;&#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&#47;widgets&#46;js';fjs&#46;parentNode&#46;insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');<&#47;script>

<html xmlns="http:&#47;&#47;www&#46;w3&#46;org&#47;1999&#47;xhtml"
xmlns:fb="https:&#47;&#47;www&#46;facebook&#46;com&#47;2008&#47;fbml">
<head>
<title>My Feed Dialog Page<&#47;title>
<&#47;head>
<body>
<div id='fb-root'><&#47;div>
<script src='http:&#47;&#47;connect&#46;facebook&#46;net&#47;en_US&#47;all&#46;js'><&#47;script>
<p><a onclick='postToFeed(); return false;'>Post to Feed<&#47;a><&#47;p>
<p id='msg'><&#47;p>

Code: Select all

 <script>  
   FB&#46;init({appId: "595575900470215", status: true, cookie: true}); 

   function postToFeed() { 

     &#47;&#47; calling the API &#46;&#46;&#46; 
     var obj = { 
       method: 'feed', 
         redirect_uri: 'http:&#47;&#47;www&#46;thepedalcollective&#46;com', 
       link: 'https:&#47;&#47;developers&#46;facebook&#46;com&#47;docs&#47;reference&#47;dialogs&#47;', 
       picture: 'http:&#47;&#47;api&#46;ning&#46;com&#47;files&#47;rRUWEC*XQHyJ7cZiPRMjfeafBCS7z2xlOMSz34mPnQsVcivPG66W8NkhSwjKZmkmKCNuDyBGXOiFmgRnplWJ2IRQMm7SRCOs&#47;Homebutton&#46;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&#46;getElementById('msg')&#46;innerHTML = "Post ID: " + response['post_id']; 
     } 

     FB&#46;ui(obj, callback); 
   } 

 <&#47;script> 

<&#47;body>
<&#47;html>/code

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Journey Recording using GPS Tracking

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"><&#47;div>

<a href="https:&#47;&#47;twitter&#46;com&#47;share" class="twitter-share-button" data-text="Just finished a Ride" data-via="pedalcollective" data-count="none">Tweet<&#47;a>
<script>!function(d,s,id){var js,fjs=d&#46;getElementsByTagName(s)[0],p=&#47;http:&#47;&#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&#47;widgets&#46;js';fjs&#46;parentNode&#46;insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');<&#47;script>

<div id='fb-root'><&#47;div>
<p><a onclick='postToFeed(); return false;'>Post to Feed<&#47;a><&#47;p>
<p id='msg'><&#47;p>

<script>
FB&#46;init({appId: "595575900470215", status: true, cookie: true});

function postToFeed() {

&#47;&#47; calling the API &#46;&#46;&#46;
var obj = {
method: 'feed',
redirect_uri: 'http:&#47;&#47;www&#46;thepedalcollective&#46;com',
link: 'https:&#47;&#47;developers&#46;facebook&#46;com&#47;docs&#47;reference&#47;dialogs&#47;',
picture: 'http:&#47;&#47;api&#46;ning&#46;com&#47;files&#47;rRUWEC*XQHyJ7cZiPRMjfeafBCS7z2xlOMSz34mPnQsVcivPG66W8NkhSwjKZmkmKCNuDyBGXOiFmgRnplWJ2IRQMm7SRCOs&#47;Homebutton&#46;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&#46;getElementById('msg')&#46;innerHTML = "Post ID: " + response['post_id'];
}

FB&#46;ui(obj, callback);
}
<&#47;script>/code

Joe Paisley
Posts: 0
Joined: Thu Mar 14, 2013 8:41 pm

Journey Recording using GPS Tracking

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!

Image Image Image Image

Return to “Issues”