Trying to learn React Native / Expo.
Have an existing Parse server, need to connect to it.
Seem to be able to initialize but not access objects.
Example code:
export const initializeParseClient = () => {
// Initialize client; this works
Parse.initialize("...", "...");
Parse.serverURL = "...";
// try accessing an object and examining a field; doesn't work
const query = new Parse.Query("DoctorInfo");
try {
//set query to get the object with the given ID
query.equalTo("objectId", docId);
//execute the query and return the result
const doctorInfo = await query.first();
const practice = doctorInfo.get("Practice");
console.log(`Practice: ${practice}`);
return practice;
} catch (error) {
console.error('Error fetching DoctorInfo:', error);
throw error;
}
};
When I run this from the MacOS Terminal in Expo Go, I get this error:
Error fetching DoctorInfo: [Error: unauthorized]
…any help?