react-native-ble-plx disconnects from BLE device whenever I use navigation.navigate() - reactjs

I am using React Native context to pass data from a simple react-native-ble-plx script to different screens in my app. I'm using react-native-navigation for these screens. Whenever I call navigation.navigate(), I successfully navigate to another screen, but I no longer have bluetooth communication, even if I navigate back to the original screen. How do I keep sending data from my BLE context to the different screens in my app, without disconnecting?

I believe that this is happening because you are handling/monitoring the connection on the page instead of doing it via a service. Separating BLE functionality from the UI should fix this issue. Have a look at the links below for more information:-
How to maintain bluetooth connection on page navigation
I cannot maintain Bluetooth connection when navigating to another screen

Related

Sync of reactjs app screen for multiple browser windows

Hi if I have our same reactjs screen opened on two separate browser windows, how do make sure they are always in sync (i.e., changes on one will reflect on the other)? It seems that redux does not help here?

Working with a web extension native-messaging API in multiple tab scenario

I'm trying to understand how to properly handle a multiple-tab scenario for web extension that, through the native-messaging API, utilizes a locally stored application through a runtime communication port.
I have one set up and working; but I don't understand what is supposed to take place when more than one browser tab uses the native application. I was planning on opening the native application only once to handle requests from all tabs that can use it, but am uncertain now. I should probably state that the application remains open and listening for new requests rather than closing after each individual request. It's opened by the background script which handles the requests from each tab's content script.
What happens if a request to the native application from one tab is still processing and a user switches to another tab and sends an additional request to the same native application? Will both requests process, is the second blocked, or will the first cease mid way and the second begin?
I can alter the set up to open a separate instance of the native application for each tab. At least I can see multiple processes open in the task manager rather than one only, when I do this.
Even in the scenario of one instance of the native application per browser tab, what happens if the user clicks the button twice, so to speak, before the first request completes? Should there always be a native_app_busy check that ignores the second request if the first is still processing?
I have a lot of experimenting to do, of course, but thought it prudent to ask how it is supposed to work. Thank you.

React native: what is the difference between opening an external URL in-app and launching the native browser

I am using React native to develop a mobile application, and an external module's function I use to provide the user login flow via an identity provider, opens the link to the sign-in flow in-app, like shown in the header below.
The sign out functionality offered by this module is documented to be obsolete, so I am implementing my own routing to the identity provider using Linking from the react-native node module, except this actually opens my native web browser rather than showing the page in-app (and subsequently fails to redirect back to my app).
My question is, what is the technical difference between an app opening a link in-app like shown above, and the app simply launching the native browser, such as chrome? And would this affect functionality like redirecting back to the initial application once the user process has been fulfilled (my guess is that it should not affect it).
I believe that the difference is that the in-app browser on IOS is an instance of
sfsafariviewcontroller and on Android, is an instance of Chrome Custom Tabs.

How to keep iOS native call UI after answering the call with CallKit

I am trying to achieve same results that can be seen on 29:52 second of Enhancing VoIP Apps with CallKit - WWDC 2016.
In that video it shows that after answering call the buttons are moved and changed by animation, and the screen stays in native in-call UI.
I built the Speakerbox and tried the "Simulate Incoming Call" function, but as soon as the call is answered by answer call button (the same action that is shown on video), the native call screen disappears and the application screen is shown with active calls shown in the list (which is different from what is shown in WWDC video):
Though there is a native call UI screen for very short time during transition from Incoming Call native UI to the app, but I can't find how to force it to stay on that screen.
Debugging the Speakerbox app there is no any delegate method called until all native screens are disappeared and the app is already opened.
I have tested receiving incoming call when the screen is locked, in that case the native UI is shown:
I would like to achieve same result on non locked phone.
Simply you can't keep native UI after accept incoming call, at least in iOS 10, maybe in iOS 11 Apple give a way to keep native UI.
If you lock the phone and then receive an incoming call, you will have similar experience to what you saw on WWDC. There is no a way to change this behavior in iOS 10.

Populating data in Silverlight App before its sent to he browser

I have a Silverlight App which gets its data from a database. My Silverlight app (running in the browser) retrieves the data through a web service. Pretty standard setup.
But there is some data which has to be there all the time or the App is in an invalid state - think data to fill drop downs etc. So I need this data to be "pre-loaded" into the App before it's sent down to the client so that it's never in an invalid state. Today I load this data via a web service call when my first page is initialized which can some times take a few seconds - during that time my App is in an invalid state.
Is there a way to populate data (from a backend database) in my Silverlight App before it's sent to the browser?
It is valid for an app to start and not be ready to use for a while, so long as the user cannot interact with it (or see the broken bits:))
Better to ensure your app has a splash screen/login page etc that displays until such time as the required resources are loaded. Once loaded you can set an app state to then show the main screen.
I had the same problem with a website that loaded the menu items via a service (as the text was data driven). Wound up running a progress spinner over the top (with a full-screen background).
I don't think you can. The application runtime occurs on the client's machine. I would suggest putting up a loading dialog while you bring those items down from the database.
What HiTech Magic said. Best practice for this is to use a splash screen or login page. You can also have your buttons (and interaction) disabled by default, and after the data is loaded, enable the UI. I would go with the spash screen though..

Resources