Giter Club home page Giter Club logo

Comments (5)

vinzscam avatar vinzscam commented on May 30, 2024

Hi @michaelost,
you're actually using the start() method in a wrong way.
The start method doesn't return any Promise. To get the feedback or to know if an error has been occurred you have to use onSuccess or onError callbacks as showed in the examples.

from react-native-tus-client.

michaelost avatar michaelost commented on May 30, 2024

@vinzscam onSuccess and onError callback don't trigger.
Just nothing happens, and after a while I recieve [Warning] SocketProtocolError: Client pong timed out
at Emitter.SCSocket._onSCClose

when I ommit endPoint onError callback is triggered. But when everything is ok, just nothing happens

from react-native-tus-client.

vinzscam avatar vinzscam commented on May 30, 2024

from react-native-tus-client.

michaelost avatar michaelost commented on May 30, 2024

I use Android.
android.build.gradle

ext {
    appName = "XXXXXXX"
    versionCode = 1
    versionName ="1.0"
    compileSdkVersion = 27
    minSdkVersion = 16
    targetSdkVersion = 27
    buildToolsVersion = "27.0.3"
    supportLibVersion = "27.1.0"
    googlePlayServicesVersion = "12.0.0"
    androidMapsUtilsVersion = "0.5+"
    applicationId = "com.reactnativetemplateapp"
    SERVER = "PRODUCTION"
}

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.google.gms:google-services:3.2.0'
    }
}

allprojects {
    repositories {
        google()
        //mavenLocal()
        jcenter()
        maven {
            url "$rootDir/../node_modules/react-native/android"
        }
    }
}

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
            }

        }
    }
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                details.useVersion "27.1.1"
            }
        }
    }
}

app/build.gradle dependeny


dependencies {
    compile project(':react-native-fs')
    compile project(':react-native-tus-client')
    compile project(':react-native-orientation')
    compile project(':react-native-camera')
    implementation project(':react-native-splash-screen')
    implementation(project(':react-native-firebase')) {
        transitive = false
    }
    implementation project(':react-native-vector-icons')
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:27.1.1"
    implementation "com.google.android.gms:play-services-base:15.0.0"
    implementation "com.google.firebase:firebase-core:15.0.0"
    implementation "com.google.firebase:firebase-auth:15.0.0"
    implementation "com.facebook.react:react-native:+"  // From node_modules
}

android/settings.gradle


rootProject.name = 'ReactNativeTemplateApp'
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')
include ':react-native-orientation'
project(':react-native-orientation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-orientation/android')
include ':react-native-camera'
project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android')
include ':react-native-splash-screen'
project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')
//include ':react-native-camera'
//project(':react-native-camera').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-camera/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')

include ':react-native-tus-client'
project(':react-native-tus-client').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-tus-client/android')

include ':app'

from react-native-tus-client.

vinzscam avatar vinzscam commented on May 30, 2024

Hi @michaelost,
I have pushed a new version. Now the error is triggered as expected.
I have also seen a small error in your code that you need to fix. Since you're using react-native-image-picker for picking up the image, you need to construct the Upload object like this:

const upload = new Upload(response.path || response.uri, { ...

You need to do this because on Android the uri refers to the Content Provider uri, but react-native-tus-client wants the file absolute path.
Let me know!

from react-native-tus-client.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.