There are few things you can check :
Have you declared initNueraConnection() and fetchPermissions() as described in the Neura dev site ?
If so, I suspect you're sending authenticate(...) a nullable mAuthenticateRequest instance.
Since fetchPermissions() is asynchronous(its a network call), you're calling authenticate(...) before the results are fetched from fetchPermissions(), so, mAuthenticateRequest is null, since it's not initiated yet.
You should call authenticate(...) only after you recieve the data on fetchPermissions().
For example, you can do this :
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
getMainActivity().initNeuraConnection();
fetchPermissions();
}
private void fetchPermissions() {
loadProgress(true);
getMainActivity().getClient().getAppPermissions(new GetPermissionsRequestCallbacks() {
@Override
public void onSuccess(final List<Permission> permissions) throws RemoteException {
if (getActivity() == null)
return;
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
loadProgress(false);
mPermissions = new ArrayList<>(permissions);
mAuthenticateRequest = new AuthenticationRequest();
mAuthenticateRequest.setAppId(getMainActivity().getClient().getAppUid());
mAuthenticateRequest.setAppSecret(getMainActivity().getClient().getAppSecret());
mAuthenticateRequest.setPermissions(mPermissions);
getMainActivity().getClient().authenticate(NEURA_AUTHENTICATION_REQUEST_CODE, mAuthenticateRequest);
}
});
}
@Override
public void onFailure(Bundle resultData, int errorCode) throws RemoteException {
loadProgress(false);
mRequestPermissions.setEnabled(true);
}
@Override
public IBinder asBinder() {
return null;
}
});
}
Fyi, you can check your logcat for this error : authenticationRequest is nullable, couldn't create authenticate request.