onfido-sdk-react-native-sample-app
onfido-sdk-react-native-sample-app copied to clipboard
Attempt to invoke interface method 'void com.facebook.react.bridge.Callback.invoke(java.lang.Object[])' on a null object reference
When I add Onfido Sdk for my react native project app crashes when I send the app on back state. I found that error gives because of ActivityEventListener on error callback function, it send nullpointer exception error.
App not crashing if comment
mErrorCallback.invoke(exception.getMessage());
exception.getMessage():
Unexpected result Intent. It might be a result of incorrect integration, make sure you only pass Onfido intent to handleActivityResult. It might be due to unpredictable crash or error. Please report the problem to [email protected]. Intent: Intent { dat=content://com.android.contacts/contacts/lookup/0r1-343A4C4E50402A4E50/1 flg=0x1 }
resultCode: -1
It can be fixed
if (mErrorCallback != null) {
mErrorCallback.invoke(exception.getMessage());
}
But why BaseActivityEventListener creating even if I not started Onfido?
Can BaseActivityEventListener be created only on Onfido start and released on Onfido close?
Steps to reproduce:
yarn add react-native-select-contact
import { selectContact } from 'react-native-select-contact';
selectContact();
- Close contacts picker