com.facebook.react.bridge.AssertionException Java Examples

The following examples show how to use com.facebook.react.bridge.AssertionException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TwilioVoiceModule.java    From react-native-twilio-programmable-voice with MIT License 6 votes vote down vote up
@ReactMethod
public void initWithAccessToken(final String accessToken, Promise promise) {
    if (accessToken.equals("")) {
        promise.reject(new JSApplicationIllegalArgumentException("Invalid access token"));
        return;
    }        
    
    if(!checkPermissionForMicrophone()) {
        promise.reject(new AssertionException("Can't init without microphone permission"));
    }        

    TwilioVoiceModule.this.accessToken = accessToken;
    if (BuildConfig.DEBUG) {
        Log.d(TAG, "initWithAccessToken ACTION_FCM_TOKEN");
    }
    registerForCallInvites();
    WritableMap params = Arguments.createMap();
    params.putBoolean("initialized", true);
    promise.resolve(params);
}
 
Example #2
Source File: KeychainModule.java    From react-native-keychain with MIT License 6 votes vote down vote up
/** Block current NON-main thread and wait for user authentication results. */
@Override
public void waitResult() {
  if (Thread.currentThread() == Looper.getMainLooper().getThread())
    throw new AssertionException("method should not be executed from MAIN thread");

  Log.i(KEYCHAIN_MODULE, "blocking thread. waiting for done UI operation.");

  try {
    synchronized (this) {
      wait();
    }
  } catch (InterruptedException ignored) {
    /* shutdown sequence */
  }

  Log.i(KEYCHAIN_MODULE, "unblocking thread.");
}
 
Example #3
Source File: CipherStorageFacebookConceal.java    From react-native-keychain with MIT License 4 votes vote down vote up
@NonNull
@Override
protected String getEncryptionAlgorithm() {
  throw new AssertionException("Not designed for a call");
}
 
Example #4
Source File: CipherStorageFacebookConceal.java    From react-native-keychain with MIT License 4 votes vote down vote up
@NonNull
@Override
protected String getEncryptionTransformation() {
  throw new AssertionException("Not designed for a call");
}