addOnCurrentUserChangedListener static method

void addOnCurrentUserChangedListener(
  1. dynamic listener(
    1. CurrentUser
    )
)

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;

listener Listener to be notified.

Implementation

static void addOnCurrentUserChangedListener(Function(CurrentUser) listener) {
  NativeBridge.registerListener('GetSocial.addOnCurrentUserChangedListener',
      (user) => {listener(CurrentUser.fromJSON(jsonDecode(user)))});
}