redirect_uri facebook api

4 posts, 1 answers
  1. Leonard
    Leonard avatar
    17 posts
    Member since:
    Feb 2013

    Posted 05 Apr 2014 Link to this post

    I just clone 'sample-facebook-api'.
    After login, how to go to another page in my app?
    Thanks.
  2. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 09 Apr 2014 Link to this post

    Hello Leonard,

    Thanks for contacting us.
    In order to open another page you can use a simple link or a button as shown below or use JQuery mobile or Kendo controls to navigate to another view.
    You can take a look at our JQuery Mobile and Kendo UI Mobile project templates.

    <a href="my.html" >My View</a>

    Please, do not hesitate to contact us if you have any further questions or need of assistance. 

    Regards,
    Zdravko
    Telerik
     

    Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!

     
  3. Leonard
    Leonard avatar
    17 posts
    Member since:
    Feb 2013

    Posted 09 Apr 2014 in reply to Zdravko Link to this post

    Hi Zdravko,

    on the demo, after successfully login, it back to previous page. I need to go to another page soon after login.
    Where should i put that function.
    Thanks.
  4. Answer
    Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 14 Apr 2014 Link to this post

    Hello Leonard,

    You can navigate to your page right after login if you change the code below:

    function LocationChange(url){
           outputlog("in location change");
           url = decodeURIComponent(url);
           outputlog("Checking location: " + url);
     
           jso_checkfortoken('facebook', url, function() {
               outputlog("Closing InAppBrowser, because a valid response was detected.");
               inAppBrowserRef.close();
                
           });
             
       };

    to

    function LocationChange(url){
           outputlog("in location change");
           url = decodeURIComponent(url);
           outputlog("Checking location: " + url);
     
           jso_checkfortoken('facebook', url, function() {
               outputlog("Closing InAppBrowser, because a valid response was detected.");
               inAppBrowserRef.close();
                
               window.location.href = window.location.href.replace('index.html', 'my.html');
                
           });
             
       };

    Where my.html would be the page you want to open from your app. Note that it has to be where your index.html file is in order to match the path.
    You can debug the code using the Simulator or on device in order to find what the code is doing and spot the best place to edit.
    You may also find interesting our AppBuilder Friends template where multiple login forms are implemented.
    Thanks.

    Regards,
    Zdravko
    Telerik
     

    Share what you think about AppBuilder and Telerik Platform with us in our feedback portal, so we can become even better!

     
Back to Top