CB Connect 5.1 redirect problem with iOS

10 years 9 months ago #231424 by activha
Replied by activha on topic CB Connect 5.1 redirect problem with iOS

krileon wrote: iPads are mobile devices. They use a mobile version of Safari. It's not the same browser as a desktop. JS functions behave differently on a Mobile device compared to a desktop. For example window.location and window.open behave differently or flat out don't work on Mobile and both of them are used by CB Connect. I do not have an iPad, tablet, or any other such device which is why they are not supported, because I can't test on them

They do use these functions as it works very well on Safari for iOS on all devices !

krileon wrote: When you click the button it opens a popup, which is to the social sites authentication page. The social site then sends the user to the redirect URL sent to them, which is the actual CB Connect registration page and process. Now it registers and logs in as needed. At this point it'll do your login or registration redirect, which is just PHP so this shouldn't matter what device you're on. What part of this process is not working for you?

The social site does not send the user to the redirect URL sent to them, this works ok on all desktop browsers including Safari on iOS but not when the website is added to the device home screen.

This is why the only solution to understand and check it is to test it with an iOS device by adding it to home screen.

Dont you have an iOS simulator to test with ?

Please Log in to join the conversation.

10 years 9 months ago - 10 years 9 months ago #231426 by krileon
Replied by krileon on topic CB Connect 5.1 redirect problem with iOS
So it works as long as it's not added to the Home Screen? What's the Home Screen? Like your homepage when you first open the browser? As said in my previous replies I do not have an iPad so I of course can not test it on one and thus is not supported (in other words if it works it works and if it doesn't then it doesn't). Simulator won't help with this. It has nothing to do with the browser or the OS, but entirely an issue with the device it self.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

10 years 9 months ago #231453 by activha
Replied by activha on topic CB Connect 5.1 redirect problem with iOS

krileon wrote: So it works as long as it's not added to the Home Screen? What's the Home Screen? Like your homepage when you first open the browser? As said in my previous replies I do not have an iPad so I of course can not test it on one and thus is not supported (in other words if it works it works and if it doesn't then it doesn't). Simulator won't help with this. It has nothing to do with the browser or the OS, but entirely an issue with the device it self.


Nope it's not an issue with the device itself, and you cannot avoid hundreds of million of users like this when windows is simply disappearing for most of our visitors.

I can help you on this maybe/

When we try to connect, the social network window is loaded, then authentication is correctly performed (twitter for instance), then the social network window is closed, and then a blank window appear with only the html code as attached :



Does it help tracking the problem ?
Attachments:

Please Log in to join the conversation.

10 years 9 months ago - 10 years 9 months ago #231462 by krileon
Replied by krileon on topic CB Connect 5.1 redirect problem with iOS

Nope it's not an issue with the device itself, and you cannot avoid hundreds of million of users like this when windows is simply disappearing for most of our visitors.

It has nothing to do with Windows. It works fine on OSX, etc... It's a Mobile device issue. I've already told you I do not support Mobile as I do not have a Mobile device except an Android phone to test any of this on properly. Apple does not provide an official simulator for Windows so that is not an option either. If you know of any Windows based simulator (and is free; preferable open source as well) and can confirm it can reproduce your issue then I can investigate further.

When we try to connect, the social network window is loaded, then authentication is correctly performed (twitter for instance), then the social network window is closed, and then a blank window appear with only the html code as attached :

There should be two windows for the entire process. One is the website it self where you clicked the button and another is the authentication window. The first window should redirect or refresh after the authentication window closes. If the first window is gone then there's nothing I can do as it's not keeping the parent window.

Does it help tracking the problem ?

Unfortunately no as there's nothing to indicate a problem. The window is just an empty window. What is the URL of the empty window?

Did some quick searching and it looks like by adding it to your Home Screen it's adding it as a WebApp. When you navigate with the browser it's just using Safari. It's not a WebApp so it's not going to work as a WebApp; you need specific coding for a WebApp to work properly, which I have no way of testing. Plus the WebApp instances can't cross communicate through JS so it wouldn't work anyway. The only solution would be for it to be an inline popup that used iframes to load in the social sites, which they won't allow me to do and would just create cross domain issues.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

10 years 9 months ago - 10 years 9 months ago #231478 by activha
Replied by activha on topic CB Connect 5.1 redirect problem with iOS
Well we may have a catch here which may be simple.
Your code to redirect is :
$js										=	"window.opener.oAuthSuccess = $success;"
												.	( $error ? "window.opener.oAuthError = '" . addslashes( $error ). "';" : null )
												.	"window.close();";

This stops here when the website is seen as a webapp as there is no redirection from this point.

You may just append it to check whether the website is seen within a webapp using window.navigator.standalone and in this case redirect the user directly without closing the page on top, maybe something like :
$js		=	"window.opener.oAuthSuccess = $success;"
		.	( $error ? "window.opener.oAuthError = '" . addslashes( $error ). "';" : null )
		.	"window.close();"
		. 	"if ( ('standalone' in window.navigator) && window.navigator.standalone ) {
 
				// .... code here with a button to push to redirect or automatic redirection, but what is the url to redirect to ? ....
				
				}";

Of course I don't know what to put inside to redirect or to show a big button push me to log in but this may be a first step

If you want I can test it ? Just tell me what code to put inside

Please Log in to join the conversation.

10 years 9 months ago - 10 years 9 months ago #231481 by krileon
Replied by krileon on topic CB Connect 5.1 redirect problem with iOS
That just handles the closing of the pop up. The parent window holds the code to redirect if it was successful or not. An entirely new usage would need to be implemented without the popup as its needs to do a 3 stage redirect instead of a popup. For WebApps it needs to redirect to authentication, redirect after authentication back to the site for token exchange, then after token exchange redirect to register/login. Again, I don't have an iPad or iPhone to test this on so I will not be implementing it. You're welcome to try messing with that code, but you need to have agent checks to test for mobile device or not so it behaves normally in regular browsers.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.242 seconds

Facebook Twitter LinkedIn