I am working with the Quickblox iOS SDK for instant messaging. My app can send and receive pictures and other files as attachments. The documentation on the link below says to use the following method: - [QBContent TDownloadFileWithBlobID:[attachment.ID integerValue] delegate:self]
That method is currently deprecated. I'm using the recommended method +[QBRequest*)downloadFileWithUID:(NSString *)UID ...]
I pass in the Attachment ID as the UID here. That downloads some data, but is not the image data I am expecting. The documentation from that method says to use the blob ID of a QBCBlob object, not the attachment ID. I'm assuming that's why I'm getting invalid data. The docs don't state which ID to use here or how to get it. How do I get that from the attachment, and what is the easiest/best way to download the attachment data?
Documentation: http://quickblox.com/developers/Sample-chat-2.0#Receive_attachment
The right link is http://quickblox.com/developers/SimpleSample-chat_users-ios
This is how download attachments using iOS SDK 2.0
http://quickblox.com/developers/SimpleSample-chat_users-ios#Receive_attachment
Setup a redirect to the previous one
Related
I am trying to upload a picture to a channel using the code in this link:
const formData = new FormData();
formData.append('file', $('#formInputFile')[0].files[0]);
// get desired channel (for example, with getChannelBySid promise)
chatClient.getChannelBySid(channelSid).then(function(channel) {
// send media with all FormData parsed atrtibutes
channel.sendMessage(formData);
});
File is uploaded and image is shared successfully, but i would like to show upload progress to the user. How can i do it?
Also, while displaying images, is there a way to get thumbnail of the image first so as to not download the entire image unless user wants to see it?
No examples of the upload progress code is provided in Github sample project.
Twilio developer evangelist here.
I'm afraid that it is currently not possible to get progress events with the JavaScript API. Also, there is no thumbnails of images available either, you can get the image URL using message.media.getContentUrl() and that only resolves the promise with a single URL and doesn't take options.
I found many online tutorial about how to post image to Facebook using Facebook iOS SDK, but i'm looking for a way to get posted image id. Is it returned with callback methods(if yes, then with which key) or is it even possible to get posted image id?
When successfully uploading the image, you are given the url of the image (key:uri), you could work out the image id from that i guess.
Having the image url should be enough to work with.
How to get metadata with include_media_info=true via dropbox core api sdk for iOS?
The official Dropbox iOS Core SDK doesn't currently support include_media_info yet, but it is open source so you can modify it to support it. For example, the SDK uses this method to call the HTTP API:
- (void)loadMetadata:(NSString*)path withParams:(NSDictionary *)params
The documentation for the HTTP endpoint itself can be found here.
I haven't implemented and tested this, but at a glance it seems you'd have to implemented a new metadata method that sets include_media_info in the params that it passes to the above method, or just always sets include_media_info if you know your app always needs it. You'd probably also have to update DBMetadata to returned the media info.
I want to send image from my dropbox account to another dropbox account through ios app.I can send image my account by using following code.
[[self restClient] uploadFile:#"image.png" toPath:dir withParentRev:nil fromPath:filePath];
Please tell me how i post to another account dropbox via ios app?
Uploading to another Dropbox account in the iOS Core SDK would use the same code you posted, with the only difference being the restClient would have been initialized with a different session/user, via one of the following:
- (id)initWithSession:(DBSession*)session;
- (id)initWithSession:(DBSession *)session userId:(NSString *)userId;
To connect to both to use uploadFile in a client-side app like this would mean exposing credentials (an access token) in the app for your account though, which is inadvisable.
Instead, to copy a file from your account to the end user's account in a client-side app like this, you should use the copy reference feature:
Use this once to create the copy reference from the originating (that is, your) account:
- (void)createCopyRef:(NSString *)path; // Used to copy between Dropboxes
Use this in the end-user app to copy the file specified by the copy reference into the end-user's account:
- (void)copyFromRef:(NSString*)copyRef toPath:(NSString *)toPath; // Takes copy ref created by above call
I can launch my app if I embed a url in an SMS and then the user clicks on the url from within the message app. I have this all working.
What I would like to be able to do however is send an MMS to the device which contains a number of image(s) and text filling the screen and when the user clicks on the url within the MMS my app is launched same as it is if clicked from within an SMS.
Is it possible to mock this up so I can see it working? i.e. how could I create an MMS containing a working active link to demo a proof of concept (I'm not talking about creating an MMS programatically on iOS, just how to create one containing my app's url to send to the device)?
Edit: This answer was written under the assumption that implementation details were required for the URL handling part. I'll leave the technical details here for future Googlers.
Here is a link to a forum thread which seems to indicate you can't send MMSes from the iPhone programmatically (I know you said you didn't want to know this anyway, but it's here for completeness). The suggestion is to use a message provider's MMS gateway directly (e.g http://www.smsglobal.com).
Instructions on how to get a hyperlink into an MMS are here. You can just write it in plain text, or use an anchor: <a href="myapp://"> Not 100% sure the iPhone will properly parse those anchor tags in an MMS though.
Read this article. The gist is that you add a "URL types" row to your Info.plist and set it to any valid protocol, say myapp, and then a user opens a link in an MMS to a myapp URL. Article excerpt:
myapp://
myapp://some/path/here
myapp://?foo=1&bar=2
myapp://some/path/here?foo=1&bar=2
The iPhone SDK, when launching the application in response to any of the URLs above, will send a message to the UIApplicationDelegate.
If you want to provide a custom handler, simply provide an implementation for the message in your delegate. For example:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
// Do something with the url here
}