I can’t understand one thing:
For example, custom api function:
public String getExampleUserId(){
if (Backendless.UserService.isValidLogin()) {
return Backendless.UserService.loggedInUser();
} else {
return null;
}
}
In this example I always obtain null. Before this query user logged in with google with stayLoggedIn=true. How correctly get user/userId during any query (something like ownerId for new objects).
Business logic has own context when invoke you code (InvocationContext class).
I’ve tried to reproduce your problem and have got the same behavior.
As workaround, try this in you code on the business logic side (at the begining of the method):
InvocationContext is the partial copy of request context from server side.
In HostedServices you should use InvocationContext, in EventHandlers - RunnerContext.