What is friendUserId in Snapkit?

Asked by At

I'm connecting my app with bitmoji here, now i wanted to add Friendmoji also but In official documentation "friendUserId: the external ID of the friend user provided by the app" is mentioned but from where we get this external id is not properly specified! so what do i set for the friendUserId?

1 Answers

0
Sultan Mahmud On

You need to load external id when userIsLoggedIn. Like this way:

if (SnapLogin.isUserLoggedIn(this)) {
            loadExternalId();
        }

private void loadExternalId() {
        SnapLogin.fetchUserData(this, EXTERNAL_ID_QUERY, null, new FetchUserDataCallback() {
            @Override
            public void onSuccess(@Nullable UserDataResponse userDataResponse) {
                if (userDataResponse == null || userDataResponse.hasError()) {
                    return;
                }
                mMyExternalId = userDataResponse.getData().getMe().getExternalId();
                mFriendmojiToggle.setVisibility(View.VISIBLE);
            }

            @Override
            public void onFailure(boolean isNetworkError, int statusCode) {
                // handle error
            }
        });
    }