Skip to content

Releases: leancloud/swift-sdk

17.4.3

14 Jan 09:32
13c7f13

Choose a tag to compare

🚀 New Features

  • feat(IM): new session open option 'reconnect' (#319)
  • feat(IM): async counting members function of conversation (#318)

17.4.2

06 Jan 10:09
82b0c5b

Choose a tag to compare

🚀 New Features

  • feat(IM): conversation query can set where condition string directly (#313)

🧰 Maintenance

  • refactor(error): formatted description (#314)

17.4.1

02 Jan 10:32
e03b260

Choose a tag to compare

🚀 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

19 Dec 12:06
8cc1600

Choose a tag to compare

🚀 New Features

Foundation

  • feat: complete completion queue support (#300) (#297)

    all async function support setting queue of result callback.
    the parameter is completionQueue: DispatchQueue, default is DispatchQueue.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 keepFileName for LCFile.
    it will generate a URL that last path component is the name of LCFile.

  • feat(LCFile): progress queue of LCFile (#290)

    new parameter progressQueue: DispatchQueue for async save function.
    can use it to set callback queue of progress, default is DispatchQueue.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 } of IMServiceConversation.
    can use it to check whether the client has subscribed the conversation.

  • feat(IMCategorizedMessage): change IMCategorizedMessage.rawData.get to 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 updatedAt will be nil after creating a new instance, should use createdAt in 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-storage mode.

17.3.2

02 Dec 10:58
499b271

Choose a tag to compare

🐛 Bug Fixes

  • fix: top object may post __type & className keys (#274)
    • __type and className are reserved key by server

🧰 Maintenance

  • refactor(user): part of auth data (#276)
  • refactor(engine): docs update and completion queue for async-function (#275)
  • refactor(user): make result of async-function discardable (#273)
  • docs(IM): update IMConversation.send() docs (#272)

17.3.1

25 Nov 06:37
20a1165

Choose a tag to compare

🐛 Bug Fixes

  • fix(RTM): WebSocket Request should not include "Origin" Header (#269)
    • it casue RTM unavailable when application set Web-Secure-Domain

17.3.0

23 Nov 09:41
da881c9

Choose a tag to compare

🚀 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): LCObject and LCDictionary’s subscript support value-convertible

    e.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.arrayValue
    • LCValue.dictionaryValue
    • LCArray.rawValue
    • LCDictionary.rawValue

    to fix it, change type of LCValue.rawValue from LCValueConvertible to Any

  • fix(storage): LCObject retain self

    • it cause memory leak
  • fix(storage): LCObject not implement value(forUndefinedKey:)

    • it may cause an exception throws by system

17.2.0

12 Nov 10:57
10b5518

Choose a tag to compare

🚀 New Features

  • feat(IM): failed message caching

    New API for IMConversation

     public 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 LCFile

     public 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

17.1.0

24 Oct 11:35
30f9846

Choose a tag to compare

🚀 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: CachePolicy for the related APIs, the default is onlyNetwork
     // 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 HTTPURLCache of LCApplication.Configuration to open it.

  • feat(storage): completion queue of async query functions

    • new parameter completionQueue: DispatchQueue for the related APIs, the default is main

🧰 Maintenance

  • chore: update dependency

17.0.0

08 Oct 13:21
d616fea

Choose a tag to compare

⚠️ Breaking Changes

  • feat!(platforms): not support iOS 8 and 9 any more

  • feat!(dependencies): upgrade Alamofire from 4 to 5

  • feat!(dependencies): replace FMDB with GRDB

  • feat!(foundation): app-router not support ChinaNorth and ChinaEast application

    if application belong to ChinaNorth or ChinaEast, 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 public to open

    classes of default media message:

    • IMCategorizedMessage
    • IMTextMessage
    • IMImageMessage
    • IMAudioMessage
    • IMVideoMessage
    • IMFileMessage
    • IMLocationMessage
    • IMRecalledMessage
  • feat(storage): parameter completionQueue: DispatchQueue for LCFile saving 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