This topic has 7 replies, 3 voices, and was last updated 6 years by Radu.

  • Author
  • #205445
     mirajas
    Participant

    Hi,

    I recently changed a framework file corrected for my need.

    The issue was with facebook login integration. As facebook only allow fixed or predefined url for login call back, I was facing issue with Android devices when trying to login using facebook login from any urls other than home page.

    It was producing error while trying to login and shows some error like “URL Blocked. This redirect failed because the redirect URI is not whitelisted in the app’s client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs.”

    When I checked theme file: kleo->kleo-framework->lib->function-facebook-login.php. I found that it was because of the below piece of code:

    “if (navigator.userAgent.match(‘CriOS’) || navigator.userAgent.match(/Android/i)) {

    window.open(‘https://www.facebook.com/dialog/oauth?client_id=<?php echo sq_option(‘fb_app_id’); ?>&redirect_uri=’ + document.location.href + ‘&scope=email&response_type=token’, ”, null);”

    I removed the if else statement which was detecting for CriOS or Android. and change from

    if (navigator.userAgent.match(‘CriOS’) || navigator.userAgent.match(/Android/i)) {

    window.open(‘https://www.facebook.com/dialog/oauth?client_id=<?php echo sq_option(‘fb_app_id’); ?>&redirect_uri=’ + document.location.href + ‘&scope=email&response_type=token’, ”, null);

    } else {

    FB.login(function (FB_response) {

    if (FB_response.authResponse) {

    fb_intialize(FB_response, ”);

    }

    },

    {

    scope: ’email’,

    auth_type: ‘rerequest’,

    return_scopes: true

    });

    }

    To

    FB.login(function (FB_response) {

    if (FB_response.authResponse) {

    fb_intialize(FB_response, ”);

    }

    },

    {

    scope: ’email’,

    auth_type: ‘rerequest’,

    return_scopes: true

    });

    And now the facebook login is working great on Android devices, I haven’t yet checked this with IOS devices.

    Now the problem is, when create the same kleo-framework->lib path inside kleo child theme and placed modified function-facebook-login.php there. Its not working.

    Please advice.

    #205448
     Kieran_SQ
    Moderator

    Hi,

    Thanks for reaching out to us about this issue you’re facing. I am going to refer this ticket directly to one of our developers for review. They’ll be in touch with you as soon as they can, Monday to Friday, East European Time.

    Thank you for your patience,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #205563
     Radu
    Moderator

    Hi,

    That snippet can be easily overwritten by copying the function kleo_fb_footer with this additional check if ( ! function_exists( ‘kleo_fb_footer’ ) )
    So paste the next code in functions.php from child theme and perform inside the changes that you need.
    code : https://pastebin.com/raw/ntTtNi9w

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #205839
     mirajas
    Participant

    Hi,

    Sorry for being late in reply.

    Thanks for your suggestion and that is the only option I think right now could solve the issue.

    Apart from this, I am doing something which will break the theme’s intended work. As I am removing checks for android & ios and using facebook js sdk instead of login dialog url for android and ios devices.

    Just want to make sure that this will not create any future problem.

    Thank you,
    Miraj

    #205840
     mirajas
    Participant

    Sorry again, it was a typo and I wrote “I am doing something which will break the theme’s intended work” instead of “Am I doing something which will break the theme’s intended work?”

    #205897
     Radu
    Moderator

    Hi,

    I’m not sure how that will behaves on all devices but if you had done that change you should test on mobile tables to see how dialog it’s displayed.

    Without running and testing on cross devices i cannot pronounce.

    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #205961
     mirajas
    Participant

    Thanks for your reply.

    I tested with latest OS of both Android and IOS and seems working with both.

    It may cause some trouble with old OS but I can’t test all of them now. If in future I got some error due to this from users will post here.

    Thanks again.

    Miraj

    #206225
     Radu
    Moderator

    Yes
    No problem
    Cheers
    R

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Log in with your credentials

Forgot your details?