Closed ahmadrushdie closed 2 years ago
Is this a bug?
for me Yes because the poor documentation of the SDK BChatSDK.fileMessage()?.sendMessage ask for Dectionary and i didnt fine any documentation about which data should i pass inside dectionary
@bensmiley i update the description the issue that i am unable to figure which data should be pass to sendMessage for file
This method isn't documented because it's a semi-private API. But if you want to send your own file, you can do it like this:
NSURL * localURL = file[bFilePath];
NSData * data = file[bFileData];
NSString * fileName = file[bFileName];
NSString * mimeType = file[bFileMimeType];
Here are the keys you need to set.
#define bFilePath @"file-path"
#define bFileData @"file-data"
#define bFileName @"file-name"
#define bFileMimeType @"file-mime-type"
You will also need the FileMessageModule to be enabled.
https://chat-sdk.gitbook.io/chat-sdk/commercial/module-licensing
I've also added this information to the PFileMessageHandler.h
protocol for future reference.
i already buy the file message module but where i can find the pod for the module?
Can you email me your license confirmation or tell me the email address you used to buy it? to: team@sdk.chat
i am trying to upload file after seclect from UIDocumentPickerViewController the picker return list of URL so i take the url and i am trying to convert it to [AnyHashable : Any] in order to accept by sendMessage any recommendation about which data should i pass in dectionary
BChatSDK.fileMessage()?.sendMessage(withFile:[AnyHashable : Any] , andThreadEntityID: threadEnitty).then({ result in