addOnCurrentUserChangedListener static method
Add listener to be notified when the user was changed. The listener action is executed on the main thread, so be careful with operations, that you put inside on {@link OnCurrentUserChangedListener#onUserChanged(CurrentUser)} method. Listener will be invoked when: SDK initialization is finished;
- GetSocial.switchUser method was called and user was successfully changed.
listener
Listener to be notified.
Implementation
static void addOnCurrentUserChangedListener(Function(CurrentUser) listener) {
NativeBridge.registerListener('GetSocial.addOnCurrentUserChangedListener',
(user) => {listener(CurrentUser.fromJSON(jsonDecode(user)))});
}