I am using the javascript sdk in a react-native app. In debug mode, everything is fine but in release mode, I can see in the panel that the user is successfully logged in but no user object is returned to me so the view never get updated.
Any help or advice is appreciated, thanks.
Here is my code:
Please be more specific, what do you mean by “no user object is returned”? Have you inspected what the “user” variable contains in ‘then’ after .login() call?
Yes, I have. In debug mode, the user object is returned in ‘then’. But in release mode ‘then’ part never runs. I can see in the panel that the user is successfully logged in but here in my app no data, no ‘then’ part, nothing! It only happens in release mode and I’m pretty sure the code is fine. I think something happens when I run ‘gradlew assembleRelease’.
Apart from the user.toString() ,which I added to my code to see if i see anything even [object Object] in my released app, the code works fine just as is in debug mode. If it was wrong, It wouldn’t be working in debug mode. I only have this problem in release mode. No data actually returns from Backendless to be dispatched in my app. I have been struggling with this issue for more than 2 weeks now and believe me I have tried every possible solution I could think of.
Thank you Vladimir. I downloaded the project template and realized that it’s using react native 0.42 . My project dependencies are as follows:“dependencies”: {
“backendless”: “^4.3.0”,
“react”: “^16.0.0”,
“react-native”: “^0.51.0”,
“react-navigation”: “^1.0.0-beta.15”,
“react-redux”: “^5.0.6”,
“redux”: “^3.7.2”,
“redux-thunk”: “^2.2.0”
},
“devDependencies”: {},
“jest”: {
“preset”: “react-native”
}
Let me try again with Backendless template and see if I bump into problem again.
For anyone that might come up with the same issue, I also tried the Backendless template but more problems came up due to old version of react native. At the end I used the Rest API (and not the JS SDK) and used fetch API to get data and the problem is solved now.