Groceries isn't loading the items on Android Device


#1

Hey?
I am new to NativeScript with JavaScript and i need help.
I can run Groceries on AVD and it loads all of the items, but when I run on my android device doesn´t connect to the API. Even when i try to login it doesn´t allow me to.
Could any one help me?


#2

Did you make sure your APIs are reachable form your android device, may be by hitting it on browser? What is the error message you get when it fails?


#3

This is a .js file:

exports.signIn = function() {
user.login()
.catch(function(error) {
console.log(error);
dialogsModule.alert({
message: “Unfortunately we could not find your account.”,
okButtonText: “OK”
});
return Promise.reject();
})
.then(function() {
frameModule.topmost().navigate(“views/list/list”);
});
};


#4

What does the console log statement says?


#5

It says: “Error: Unauthorized”;
This the config.js code:

module.exports = {
apiUrl: “https://baas.kinvey.com/”,
appKey: “kid_HyHoT_REf”,
appUserHeader: “Basic a2lkX0h5SG9UX1JFZjo1MTkxMDJlZWFhMzQ0MzMyODFjN2MyODM3MGQ5OTIzMQ”
};