Repository navigation
This release makes connection problems visible and recoverable, moves file storage to temporary media that belong to a conversation thread, and removes the retired push-device APIs.
Breaking changes. Several completion blocks now receive an
NSError,agent:andorchestrator:becameagent:error:andorchestrator:error:, and storage needs a thread ID. Swift Package Manager and CocoaPods pick this version up on their next update for apps pinned to 1.0.x, so read Upgrading before you update.
Highlights
- Connection failures you can handle. The new
connectionFailedevent delivers anARTConnectionError(anNSErrorsubclass) with a readablemessage, aconnectionCodeand the HTTPstatuswhen there is one. The ADK then stops reconnecting until you callconnect:completion:again. connect:completion:tells you when it fails. It completes once ART has accepted the connection, and reports anARTConnectionErrorsuch asAUTHENTICATION_FAILEDorCONNECTION_TIMEOUTwhen it can't connect.AdkConfig.connectionTimeoutMs(default 30 seconds) sets how long it waits.- Agent runs end when the connection fails.
done:reports anAgentErrorwhose details havesource: connection, so your app doesn't wait forever. A run whose thread was disposed, or whose request couldn't be sent, ends with the codeRUN_CLOSED. - Rejected credentials stop reconnecting. The new
authenticationFailedevent fires, and sign-in rejections complete with anARTAuthHttpErrorwith the HTTP status. - No hidden resends. Messages are never queued for later: without a connection,
pushandruncomplete with an error and nothing is sent. Encrypted channels now wait for ART to confirm delivery, like targeted channels. - Files belong to a conversation thread. Uploads, lists and
getFile:threadId:timeoutMs:completion:take a thread ID, which thread uploads and lists fill in for you. Attach files to a message withARTMediaRef. - Also new:
-[AgentThread dispose], execution origin for runs started from the ART playground,multipart/form-datarequests withARTFormDataPayload, andARTNotificationChannelconstants for notification delivery. The README's documentation links now open the Objective-C guides.
Upgrading
- Change the completion blocks of
connect:completion:andresume:to^(NSError *error) { … }, and handle the error. - Replace
[adk agent:…]and[adk orchestrator:…]withagent:error:andorchestrator:error:. Agent and orchestrator IDs must be lowercase slugs, optionally with a build name (my-agent@release2). If you create them directly, useinitWithAgentId:socket:error:andinitWithOrchestratorId:socket:error:. - Change the completion block of
-[BaseSubscription subscribe:]to^(NSError *error) { … }. - Pass a thread ID when you use storage directly:
ARTUploadOptions.threadId,ARTListOptions.threadIdandgetFile:threadId:timeoutMs:completion:. - Replace
[ARTFileMeta fileMetaWithFileRef:file]with[ARTMediaRef mediaRefWithFileRef:file].initWithFileId:scope:andscopeare gone: useinitWithFileId:name:contentType:. HandleARTUploadStepUploadwhere you checkedARTUploadStepSignedURL,ARTUploadStepPutorARTUploadStepConfirm. - Check for
ARTConnectionErrorCodeAckTimeoutwhere you checkedErrorCodeAckTimeout. - If you implement
WebsocketHandleror callwait:orsendMessage:on the socket yourself, use the new signatures. - Remove calls to
registerDevice:completion:,unregisterDeviceToken:completion:andlistDevices:, because ART no longer offers these APIs. Use a notifier configured on a connector instead. - Replace notification channel strings with the
ARTNotificationChannelconstants, for exampleinput.channels = @[ ARTNotificationChannelInApp, ARTNotificationChannelEmail ].
Installation
CocoaPods:
pod 'ArtAdk', '~> 1.0.4'
pod 'ArtAdk/Notifications', '~> 1.0.4' # optionalSwift Package Manager:
.package(url: "https://github.com/aiotrixdev/art-objectivec-adk.git", from: "1.0.4")Full changelog: CHANGELOG.md · 1.0.3...1.0.4