sorry but according to our support policy we do not debug customer’s code, could you please minimize your sample to show problem with the Backendless API
returns an empty currentUserObjectId if isValidLogin() is true. That is my problem. And it does not go into the error section. Just returns an empty value. I have used this exact function many times before using the normal Flutter SDK that uses the true value to stay logged in. Twilio SDK is not keeping the user logged in or something. But, still seems it picks up there is a valid login. Just cannot get the one logged in?
for now, as a workaround, I can propose you use your solution after login keep the token in the storage on your device and on app start set the value to the SDK
Will try that thanks. Also, to be clear, the Flutter SDK works 100% as it is. The Twilio Flutter SDK needs tweaking. So I was using the Twilio Flutter SDK to login a user but the normal Flutter SDK to check the login. Without Twilio, normal login and keeping a user logged in works 100%. Would be nice to just set a stayLoggedIn field as part of one of the login functions of the Twilio Flutter SDK. Also, the Twilio deployed service under Cloud Code does not have that option either. So it could be wider than Flutter? Otherwise I could just invoke the cloud code?
Twilio Plugin is just an API Service, so it doesn’t have access to your local device, and the Twilio Plugin SDK is just a client for running the API Service
I did the following: At successful login, I save the user token to the phone. When the app restarts, I get the user token and call Backendless.userService.setUserToken(userToken). Just before this statement I print out the user token and it shows perfectly. After this statement I call Backendless.userService.loggedInUser(). This function returns an empty objectId again. So for now maybe I will save the objectId to get the logged in user instead of the token?
Another question. Twilio works on the Cloud 99 trial plan (except for keeping the user logged in). I also have the free Springboard plan. There the plugin registers a user 100%, but when I try to login, it says a user with that number does not exist, even though the user is there. Is this a limitation of the Springboard plan as everything else is exactly the same?
Thank you for your answer. I have a mobile app developed in Flutter. I also have 2 Backendless Apps. One on Cloud 99 (trial) and one on Springboard. I move between apps by just changing the api keys and appID in my client. The app can login a user on Cloud 99 but not on Springboard. In Springboard it says the telephone number does not exist. I do have the field “'phoneNumber”’ in the Users table for both. Works in Cloud 99 and not in Springboard. Any idea why? On both it registers a User in the Users table with the correct phone number and Twilio codes being sent and authenticated.
On this one it works fine: 075F9883-1E98-6218-FFAC-FCEFBC95B000 (Cloud 99 on a different account)
On this one it does not work: 725521A2-5598-4241-FFA2-897A0E52B700 (Springboard plan before Backendless subdomains has been introduced) - Could this be the problem?
Also I was not able to reproduce the issue in your Fibre app I have created test user with phoneNumber, try to login and get {"transactionId":"SM58064226d697479397940077c32ea725"}
Thank you for confirming. I am using the loginWithPhoneNumberAndPassword() function of the Flutter Twilio SDK. On the Cloud 99 plan I get the transactionId returned. On Springboard I don’t. It fails with “BackendlessException: There is no user with provided phone number, code = 0” I will create a video to show you. Exact same code. Not sure what is going on.