Ziggeo / ReactNativeSDK

React Native SDK
Apache License 2.0
7 stars 6 forks source link

UploadFromPath with args doesn't work on iOS #33

Closed pmandiola closed 5 years ago

pmandiola commented 5 years ago

Related to issue 26.

We are using uploadFromPath method and it is working fine on Android but videos uploaded with iOS don't take the parameters into account (video is received by Ziggeo but it doesn't have any of the parameters we set).

This is our code:

var argsMap = {
      tags: nicename,
      expiration_days: 1,
      video_profile: "_video_profile_lightweight",
      auto_pad: true,
      data: '{"source":"app"}'
    };

var token = await Ziggeo.uploadFromPath(fileURI.substring(7), argsMap);

We inspected RCTZiggeoRecorder.m and in the method uploadFromPath, the map parameter is only passed to applyAdditionalParams but this method only sets max_duration and enforce_duration. So, any other additional parameters are not taken into account as we experienced.

We tried using setExtraArgsForRecorder as a workaround but the app crashes when trying to upload.

We'd really appreciate if you could help us with this issue. Thanks!

alexyats commented 5 years ago

Hi, please update Ziggeo.framework with the latest version from here: https://github.com/Ziggeo/iOS-Client-SDK/tree/master/Ziggeo/Output/ and use setExtraArgsForRecorder method

pmandiola commented 5 years ago

Thanks @alexyats. Is there a new version?

We downloaded it from there last week and tried using setExtraArgsForRecorder but the app crashed when uploading

alexyats commented 5 years ago

Could you please share the crashlog?

pmandiola commented 5 years ago

Unfortunately, I don't have a compatible iOS device to connect to my Mac so someone else does the tests through TestFlight and for that I need to use the Release Ziggeo Framework. Problem is I don't get the crash report symbolicated on the Ziggeo part where it crashes.

I'm sending you the crashlog from TestFlight received in Xcode, not sure if that helps though: https://drive.google.com/open?id=1CqY2FpT2hnTOGGjs703xboUY0X_PLQLa

pmandiola commented 5 years ago

Hi @alexyats, I'm doing it now with an iPhone and I'm not sure if the crashlog is useful:

2019-07-17 11:33:23.754411-0400 MentorPro[308:10430] -[__NSCFNumber stringByAddingPercentEncodingWithAllowedCharacters:]: unrecognized selector sent to instance 0xb375b8eba7c72f68
2019-07-17 11:33:23.755927-0400 MentorPro[308:10430] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber stringByAddingPercentEncodingWithAllowedCharacters:]: unrecognized selector sent to instance 0xb375b8eba7c72f68'
*** First throw call stack:
(0x1c0be23a8 0x1bfde7d00 0x1c0afa9f8 0x1c0be7d54 0x1c0be9b50 0x102dff5bc 0x102e00920 0x102e00b78 0x102e00050 0x1c11bdb9c 0x1c11d2480 0x1c165e488 0x1c1563bc8 0x1c1563058 0x1c1660244 0x102c3b1f8 0x102c3c778 0x102c3fc90 0x102c3f110 0x102c4da34 0x102c4e43c 0x1c07ecb38 0x1c07f2dc4)
libc++abi.dylib: terminating with uncaught exception of type NSException

Let me know what else could be helpful.

alexyats commented 5 years ago

Hi, thanks for report! Please update Ziggeo.framework to the latest version and check the updated demo app at ReactNativeDemo repository

pmandiola commented 5 years ago

Thanks @alexyats! The issue is now fixed and videos are uploaded correctly with iOS.