cloudinary / cloudinary_ios

Cloudinary iOS SDK
MIT License
165 stars 106 forks source link

Callback request isn't invoked #395

Closed dimaportenko closed 1 year ago

dimaportenko commented 1 year ago

We have a callback URL config in our preset CleanShot 2023-01-11 at 13 11 44@2x

It works just fine on Android SDK, with react native fetch, but with iOS SDK it's not invoked. my implementation is here https://github.com/gosourcellc/react-native-cloudinary-sdk/blob/main/ios/CloudinarySdk.swift check upload method.

What is the right place to debug response headers?

https://support.cloudinary.com/hc/requests/202692

dannyv-cloudinary commented 1 year ago

Hi @dimaportenko. Thanks for getting in touch.

Looking at https://github.com/gosourcellc/react-native-cloudinary-sdk/search?q=callback, I see you're using the callback URL in the your Android implementation, but seemingly not in your iOS verrsion.

I'm not familiar with iOS app development myself so I'm unable to advise further as to how to remedy this, but hopefully this gives your a place to start investigating further.

Thanks, -Danny

dimaportenko commented 1 year ago

@dannyv-cloudinary looks like you don't understand what I'm asking and you don't know how this SDK works. Please reopen the ticket. Maybe somebody from the maintainers can take a look.

dannyv-cloudinary commented 1 year ago

Apologies, Dima. Reopening as requested.

rnamba-cloudinary commented 1 year ago

Hey Dima, I sent a response in the support ticket you have open with us, however, wanted to send a response here to close the loop in this issue.

According to our dev team, callbacks in our SDKs are actually deprecated and were only added to support older browsers that don't support XHR ( we just haven't gotten around to finalize sunsetting it ). It has been replaced by the notification system that we recommend utilizing for your applications.

It shouldn't be too large of a change since the callback is already being pointed to your internal server. Allowing the server to accept POST requests and picking up the parameters from the request body should be all that is needed.

Taken from our documentation https://cloudinary.com/documentation/image_upload_api_reference#upload_optional_parameters: callback String A URL to redirect to after the upload is completed instead of returning the upload response. Signed upload result parameters are added to the callback URL. This parameter is ignored for XHR (Ajax XMLHttpRequest) upload requests. Note: This parameter is relevant for direct uploads from a form in the browser. It is automatically set if you perform direct upload from the browser using Cloudinary's SDKs and the jQuery plugin.

We can continue the discussion about this within the support ticket, so we can close this issue out for now.

dimaportenko commented 1 year ago

Yeah, that make sense, thanks.