Comments (5)
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.
@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.
from react-native-tus-client.
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.
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)
- error Error: Error while resuming the upload HOT 4
- No such file or directory Error HOT 6
- io.tus.java.client.ProtocolException: unexpected status code (403) while creating upload HOT 1
- App will cashed on start of uploading in IOS HOT 3
- Uploading not resume when i kill and restart app in android HOT 1
- 'TUSKit.h' file not found HOT 9
- 'TUSKit.h' file not found HOT 1
- Exception '*** -[__NSDictionaryM setObject:forKey:]: key cannot be nil' was thrown while invoking createUpload on target RNTusClient with params ( HOT 4
- Change "endpoint" to "uploadUrl" on IOS HOT 1
- Anyone have issues uploading through an iOS Simulator? Works fine in production
- How To Re-upload previous File ?
- Can't build with iOs...! NOT WORKING HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-tus-client.