com.facebook.react.views.webview.events.TopLoadingErrorEvent Java Examples

The following examples show how to use com.facebook.react.views.webview.events.TopLoadingErrorEvent. 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: Web3WebviewManager.java    From react-native-web3-webview with MIT License 6 votes vote down vote up
@Override
public void onReceivedError(
        WebView webView,
        int errorCode,
        String description,
        String failingUrl) {
    super.onReceivedError(webView, errorCode, description, failingUrl);
    mLastLoadFailed = true;

    emitFinishEvent(webView, failingUrl);

    WritableMap eventData = createWebViewEvent(webView, failingUrl);
    eventData.putDouble("code", errorCode);
    eventData.putString("description", description);

    dispatchEvent(
            webView,
            new TopLoadingErrorEvent(webView.getId(), eventData));
}
 
Example #2
Source File: ReactWebViewManager.java    From react-native-GPay with MIT License 6 votes vote down vote up
@Override
public void onReceivedError(
  WebView webView,
  int errorCode,
  String description,
  String failingUrl) {
  super.onReceivedError(webView, errorCode, description, failingUrl);
  mLastLoadFailed = true;

  // In case of an error JS side expect to get a finish event first, and then get an error event
  // Android WebView does it in the opposite way, so we need to simulate that behavior
  emitFinishEvent(webView, failingUrl);

  WritableMap eventData = createWebViewEvent(webView, failingUrl);
  eventData.putDouble("code", errorCode);
  eventData.putString("description", description);

  dispatchEvent(
    webView,
    new TopLoadingErrorEvent(webView.getId(), eventData));
}
 
Example #3
Source File: RNX5WebViewManager.java    From react-native-x5 with MIT License 6 votes vote down vote up
@Override
public void onReceivedError(
        WebView webView,
        int errorCode,
        String description,
        String failingUrl) {
    super.onReceivedError(webView, errorCode, description, failingUrl);
    mLastLoadFailed = true;

    // In case of an error JS side expect to get a finish event first, and then get an error event
    // Android WebView does it in the opposite way, so we need to simulate that behavior
    emitFinishEvent(webView, failingUrl);

    WritableMap eventData = createWebViewEvent(webView, failingUrl);
    eventData.putDouble("code", errorCode);
    eventData.putString("description", description);

    dispatchEvent(
            webView,
            new TopLoadingErrorEvent(webView.getId(), eventData));
}