-
Author
-
August 5, 2018 at 10:56 #205445mirajasParticipant
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.
August 5, 2018 at 15:42 #205448Kieran_SQModeratorHi,
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 solutionIf 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.
August 6, 2018 at 17:00 #205563RaduModeratorHi,
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/ntTtNi9wCheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionAugust 9, 2018 at 11:41 #205839mirajasParticipantHi,
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,
MirajAugust 9, 2018 at 11:44 #205840mirajasParticipantSorry 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?”
August 10, 2018 at 15:14 #205897RaduModeratorHi,
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
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionAugust 11, 2018 at 09:05 #205961mirajasParticipantThanks 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
August 13, 2018 at 15:43 #206225RaduModeratorYes
No problem
Cheers
RHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
You must be logged in to reply to this topic.