Iâve already engaged with them and havenât been able to help.
Sorry I didnât describe the issue very well first time - the problem I have is that when a user logs in to the Backendless app, I need to run JS code to pass the user ID to Intercom so the user can be identified and logged in to Intercom using the Intercom SDK.
Usually with Flutter everything would be set up on the app side, but with the Backendless/Flutter shell all the code is in JS and we are just showing the webview, so weâve not been able to work out how we can get and post data in flutter from any JS code implemented in Backendless.
It seems that this is a limitation of using a webview in a Flutter shell, but I wondered if you had any ideas about how we could overcome this, maybe the Backendless SDK can help us to get data from Flutter and pass it back?
Appreciate the help. Being able to use a native app shell is a big positive, but itâs been difficult working out how to add 3rd party services and start using native mobile functions.
the problem I have is that when a user logs in to the Backendless app, I need to run JS code to pass the user ID to Intercom so the user can be identified and logged in to Intercom using the Intercom SDK.
If I understood you correctly, you can use the afterLogin event handler in the Cloud Code section for this purpose. This hook (event handler) will be called automatically by the Backendless after each successful login into Backendless, and there youâll be able to run a request for login into a third-party service.
This doesnât help as it doesnât get the data passing between the Backendless code and the native SDKs in Flutter. With Intercom there is a requirement for the two to be able to pass data back and forth.
So for this case, the Intercom login wouldnât be associated with the mobile phone user.
There is a way to do this. Iâll give an example below of how it works:
For example I need login user in JS code, then I need to pass it into Flutter code. Perform some actions with it and return some answer back into JS. This is code in Codeless:
When you click on this button, flutter receives a request to execute the âyour_custom_funcâ method, in order to process this request, I will add this code to the bridge_manager class(58-65 into switch block):
case 'your_custom_func':
{
//something code
//For example intercom api
return buildResponse(
data: requestContainer,
response: 'Completed'); //maybe result of intercom api
}
The buildRequest() method then returns the response to the JS code.
If you have any questions, please ask, I will gladly try to help you.
Unfortunately, this is a new feature and is currently under development, so it has not yet been documented. So you can find out about the functionality of this feature only here
Please provide the custom code or codeless blocks you are calling to build and send this request.
I missed this nuance. The bridge is only available from the native app shell FOR MOBILE DEVICES. As far as I can tell, are you trying to run in a regular browser from a PC? It wonât work.
I was able to reproduce your error and find a solution.
If you pass a whole user object, then everything works without problems. It looks like a bug, we will look into this problem.
Can you try?