Releases: leancloud/swift-sdk
17.4.3
17.4.2
17.4.1
🚀 New Features
- feat(IM): expose transient indicator of message (#310)
- feat(IM): expose raw data getter of conversation (#308)
🐛 Bug Fixes
- fix(IM): conversation decode binary last message is incorrect (#306)
🧰 Maintenance
- refactor(sms): make templateName and signatureName optional & update code comment (#311)
17.4.0
🚀 New Features
Foundation
-
feat: complete completion queue support (#300) (#297)
all async function support setting queue of result callback.
the parameter iscompletionQueue: DispatchQueue, default isDispatchQueue.main. -
feat(
LCObject): operation for key path (#296)code e.g.
// An exist object has a `Dictionary` field. let object = LCObject(objectId: "<valid-id>") object["dictionary"] = LCDictionary() // can use key-path to update key-value in dictionary. object["dictionary.foo"] = "bar" // result is `["foo": "bar"]` print(object["dictionary"]!.dictionaryValue!)
only an object has a valid ID can use key-path to update data.
Relation Operation is unavailable for key-path. -
feat(
LCFile): keep file name (#291)new save option
keepFileNameforLCFile.
it will generate a URL that last path component is thenameofLCFile. -
feat(
LCFile): progress queue of LCFile (#290)new parameter
progressQueue: DispatchQueuefor async save function.
can use it to set callback queue ofprogress, default isDispatchQueue.main. -
feat(
LCValue): all LCValue can init from same type (#288)code e.g.
let number1 = LCNumber(42) let number2 = LCNumber(number1) print(number1 == number2) // true print(number1 !== number2) // true let string1 = LCString("foo") let string2 = LCString(string1) print(string1 == string2) // true print(string1 !== string2) // true let array1 = LCArray([number1, string1]) let array2 = LCArray(array1) print(array1 == array2) // true print(array1 !== array2) // true let dictionary1 = LCDictionary([string1.value: number1]) let dictionary2 = LCDictionary(dictionary1) print(dictionary1 == dictionary2) // true print(dictionary1 !== dictionary2) // true
-
feat(
LCValue): expressible by array literal of LCArray support LCValueConvertible (#278)code e.g.
let _: LCArray = ["a"] let _: LCArray = ["a", 1] let _: LCArray = ["a", LCNumber(1)] let _: LCArray = [LCString("a"), 1] let _: LCArray = [LCString("a"), LCNumber(1)]
RTM
-
feat(
IMServiceConversation): add joined property for system conversation (#298)new property
public var isSubscribed: Bool? { get }ofIMServiceConversation.
can use it to check whether the client has subscribed the conversation. -
feat(
IMCategorizedMessage): changeIMCategorizedMessage.rawData.getto public (#280)
🐛 Bug Fixes
-
fix(IM): start unique conversation not invoke local storage saving (#299)
use creating unique conversation to get an exist conversation, it may not save data of conversation to local storage.
-
fix(storage): sequence of array operation is not right (#295)
it may cause local data and server data are inconsistent.
-
fix(storage): linking object with unsaved file not throw error (#286)
only a saved file can be link to an object.
-
fix(storage): batch save can do with empty requests (#284)
empty requests will not be posted, it return success directly.
🧰 Maintenance
-
refactor(IM): created and updated date of conversation (#300)
API diff: conversation property
updatedAtwill be nil after creating a new instance, should usecreatedAtin this condition. -
refactor(IM): make APIs of local storage unavailable when can not import GRDB (#279)
API diff: Code Completion will not show APIs about IM Local Storage when use
RTM-no-local-storagemode.
17.3.2
🐛 Bug Fixes
- fix: top object may post
__type&classNamekeys (#274)__typeandclassNameare reserved key by server
🧰 Maintenance
17.3.1
17.3.0
🚀 New Features
-
feat(IM): dependencies for local storage of IM be optional
SDK can be integrated without dependencies of IM-Local-Storage module by CocoaPods:
pod 'LeanCloud/RTM-no-local-storage'in this way, GRDB.swift will not be a dependency for SDK and the APIs of IM-Local-Storage will be unavailable.
-
feat(storage):
LCObjectandLCDictionary’s subscript support value-convertiblee.g.
let object = LCObject() object[“foo”] = “bar” object[“number”] = 42 object[“boolean”] = true let dictionary = LCDictionary() dictionary[“foo”] = “bar” dictionary[“number”] = 42 dictionary[“boolean”] = true
🐛 Bug Fixes
-
fix(storage): crash by value converting
below APIs will cause crash in old version:
LCValue.arrayValueLCValue.dictionaryValueLCArray.rawValueLCDictionary.rawValue
to fix it, change type of
LCValue.rawValuefromLCValueConvertibletoAny -
fix(storage):
LCObjectretain self- it cause memory leak
-
fix(storage):
LCObjectnot implementvalue(forUndefinedKey:)- it may cause an exception throws by system
17.2.0
🚀 New Features
-
feat(IM): failed message caching
New API for
IMConversationpublic func insertFailedMessageToCache(_ message: IMMessage, completion: @escaping (LCBooleanResult) -> Void) throws public func removeFailedMessageFromCache(_ message: IMMessage, completion: @escaping (LCBooleanResult) -> Void) throws
-
feat(storage): thumbnail url for qiniu url
New API for
LCFilepublic enum Thumbnail { case scale(Double) case size(width: Double, height: Double) } public func thumbnailURL(_ thumbnail: Thumbnail) -> URL?
🐛 Bug Fixes
- fix(storage): bool value converting not right
- this bug cause
LCBool(true).boolValue == nil
- this bug cause
17.1.0
🚀 New Features
-
feat(storage): auto cache(local-disk) of current user
let defaultApplication = LCApplication.default /* Caching User */ // Any User-Login-API will cache user(memory and local-disk) automatically when result is success /* Get Cached User */ if let cachedUser = defaultApplication.currentUser { // Current User Cache(memory or local-disk) exist } /* Clear Cached User(memory and local-disk) */ // Two Ways defaultApplication.currentUser = nil // method 1 LCUser.logOut(application: defaultApplication) // method 2
-
feat(storage): cache policy of query functions
- new parameter
cachePolicy: CachePolicyfor the related APIs, the default isonlyNetwork
// Cache Policy Enumeration public enum CachePolicy { case onlyNetwork case onlyCache case networkElseCache }
This feature is not enable in default, so before usage, should set up
HTTPURLCacheofLCApplication.Configurationto open it. - new parameter
-
feat(storage): completion queue of async query functions
- new parameter
completionQueue: DispatchQueuefor the related APIs, the default ismain
- new parameter
🧰 Maintenance
- chore: update dependency
17.0.0
⚠️ Breaking Changes
-
feat!(platforms): not support iOS 8 and 9 any more
-
feat!(dependencies): upgrade Alamofire from 4 to 5
-
feat!(foundation): app-router not support
ChinaNorthandChinaEastapplicationif application belong to
ChinaNorthorChinaEast, should use below method to initialize:try LCApplication.default.set( id: {{appid}}, key: {{appkey}}, serverURL: "https://xxx.example.com")
-
feat!(integration): rename subspec of pod
from:
pod 'LeanCloud/Storage' pod 'LeanCloud/IM'change to:
pod 'LeanCloud/Foundation' pod 'LeanCloud/RTM' -
feat!(foundation): use struct wrap version of SDK
from:
let version: String = LeanCloud.version
to:
let version: String = LeanCloud.Version.versionString
🚀 New Features
-
feat(integration): support Swift Package Manager
-
feat(IM): change access level of default media message from
publictoopenclasses of default media message:
IMCategorizedMessageIMTextMessageIMImageMessageIMAudioMessageIMVideoMessageIMFileMessageIMLocationMessageIMRecalledMessage
-
feat(storage): parameter
completionQueue: DispatchQueueforLCFilesaving functions
🐛 Bug Fixes
- fix(storage): POST request may carry some dirty data
- fix(IM): make member managing of chat room available
- fix(IM): signature for member changing and blacklist not support transient and system conversation
- fix(IM): priority of token and signature when opening
- fix(storage): deadlock of
LCFile.save()
🧰 Maintenance
- chore(dependencies): upgrade SwiftProtobuf to 1.7.0