react-native-navigation: release screens after use - react-native-navigation

Issue Description
It is not clear how screens can be unregistered.
When using redux, it seems that when using startSingleScreenApp and startTabBasedApp, the initial screen from which the app is triggered remains in memory, which causes it to continue receiving props when (I assume) the screen is supposed to be released.
Steps to Reproduce / Code Snippets / Screenshots
startSingleScreenApp - login screen
startTabBasedApp - home screen when logged in (expect login screen to be removed from stack)
startSingleScreenApp - login screen (expect home screen to be removed (expect home screen to be removed, and not to duplicate instantiation of the login screen))
How do I fix this?

I fixed the problem by implementing shouldComponentUpdate in the login screen. It doesn't feel like a solid solution but it works. I'm not really in favour of keeping unused screen lingering in memory though.
For logging out, I guess that the way to go is to pop the 'home' screen from the stack.

Related

Azure Active Directory B2C navigation failures using Xamarin Forms

using the built in sign-up and sign-in policy with azure AD, the user can signup and the account gets created, but the UI never returns back to the app. It stays here
The same issue happens when testing the user flow in the azure portal.
I'm not sure what to do or where to go from here on testing this?
There are other little funny quirks that I notice also. When the cancel button is clicked the UI never redirects back to the sign in page. the loading progress bar moves across as if something should be happening but it never goes back to the previous page.
Same thing when trying to go forgot password page.
EDIT
here is a repo https://github.com/champcbg/AzureAdB2CTest with azure ad credentials stripped out that follows these instructions https://learn.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/authentication/azure-ad-b2c the sign in and sign up work successfully i can see the results in azure, but the hand off never is given back to the android app.
the code in the green block is executed and that is how the sign-in and sign-up pages are shown. after either action the code never comes back to line 79 (red arrow).
but if the back button (on the phone) is pressed control is given back to the app, the code falls into the exception block as a "authentication_canceled" event.
Finally got it working. I was never able to solve the issue of the app coming back from the await. I am leaning toward the error being that the active page was never not found again. that is only an assumption that can not be confirmed.
https://github.com/Azure-Samples/active-directory-b2c-xamarin-native
Following the code example for the project link above solved the problem. The key differences from the original example are
Authentication was extracted to a service not bound to button clicks, which was actually my desired path anyway or in view models.
Parent Window locator service which is used in the android project
The complete solution was built by following these instructions https://learn.microsoft.com/en-us/xamarin/xamarin-forms/data-cloud/authentication/azure-ad-b2c for creating the Azure AD resources and this for actually implementing the xamarin app https://github.com/Azure-Samples/active-directory-b2c-xamarin-native

SSO SignIn page rendering with Email input element at top of page

When attempting to the load the default SSO SignIn page in Azure, the Email Address element is selected by default and in focus as follows;
When the page is zoomed the Email Address input is rendered at the top of the page on load, this causes tablets and smaller devices to be presented with a page that is already scrolled.
I have attempted to add a new input on a custom page and given it a tabindex of 0 (as a hack) as the default for all element contained inside the "api" div is 1.
I have also given the input element the autofocus attribute but it seems to strip both on render.
https://www.realmadrid.com/en/login is using a similar SignIn page and appear to have this function turned off, having gone through all the source that I could find it isn't directly apparent how they are achieving this.
Obviously this would be easy if it were possible to use JavaScript on custom pages in Azure B2C SSO but as this is not yet possible, does anyone know of a possible workaround or fix for this issue?
Update:
It's a little hard to illustrate using a screenshot, but if you select 'run now' on a new default 'SIGN-UP OR SIGN-IN POLICY' policy, set responsive as per screenshot, scroll to the top of the page and press F5, you'll be able to see the stated behavior.
We are using heavily custom policies, I'm aware of how to do this, I'm using a default example for ease of replication.
This is no longer an issue due to MS allowing front end JS https://learn.microsoft.com/en-us/azure/active-directory-b2c/javascript-samples

Facebook 'Continue' button misplaced in Chrome Extension oauth popup

I'm using chrome.identity.launchWebAuthFlow to start the login flow and when the user oauths with Facebook, the bottom 'Continue' button is partially out of the view. When the user has to enter an email and password for the first time, it's fine, but when Facebook asks only for the password the next time, the issue occurs. Also on the 'Forgotten you password?' page.
Since chrome.identity.launchWebAuthFlow doesn't allow to set size, and resizing the window manually moves the button, but at the same misplaced position, I see it as a clear sign that it's Facebook's code or the chrome.identity.launchWebAuthFlow's window's quirk.
When opening up the same auth url in a real browser window, the button is placed at the right place.
Anyone else came across this issue? Is there any good workaround?

facebook login view does not have any option to close it

I'm facing a strange problem here, i have used a sample code of graph api's (reallylongaddress-iPhone-Facebook-Graph-API-59e6399, Created by , https://github.com/reallylongaddress/iPhone-Facebook-Graph-API) which was available on github. And i faced these problems:-
1) I'm having a share button of my own , when i click on it to login to fb a white view (or popup ) apears for almost 5 seconds and it appears evry time when i click on share button to share something on my facebook wall, even if i'm logged in . I reduced this problem to only one time.
2) The second and main problem now i'm facing is that on login it doesn't have any close button on it , and user must have to login ,other wise the application will not continue. Can i place a close button on this fb login web view?
NOTE:I have also used the fbconnect earlier but i dont wanna use publish dialog box ,, which shows user a dialog box and then user can press on "pulish" or "skip" button. instead i want that what ever the user wants to share on wall can be shared on just one tap on a button. That is why i have used this sample code, but it also has these two problems i have specified above.
Please help me with these 2 problems above or suggest me any other alternative option which does not have the "publish.stream" dialog box.
Thanks
In this condition Facebook controller are called by UINavigationController.
Finally i solved the problem and placed a close button on the login view. and on tab of this button i closed the login web view

Browser navigation, back button issue

I want to know how you guys deal with back button issues in your web applications.
I can not forbid users to click back button on their browser, but when they hit it, the page code doesn't run. So writing in page_load() makes no sense.
I have searched online and found this link: Disabling Back button on the browser. It does not work for me. Any idea?
There is no way to disable the back button. You can try to open your page/form in a new window so there would be nothing to navigate back to
Normally, If I have a critical or lengthy form, I tend to maintain a dirty-flag and if the user starts entering something, the dirty-flag gets set and on save or submit it gets reset. You can use unload/beforeunload javascript event to see if the dirty-flag is set and ask for confirmation.

Resources