Before using Simple Log Service (SLS) SDK for iOS to call the operations of SLS, install SLS SDK for iOS.
Prerequisites
Simple Log Service is activated.
An iOS development environment is set up. For more information, see Apple Developer.
Procedure
Create an iOS project.
In the project folder, create a Podfile and enter the command that is used to import the dependencies of SLS SDK for iOS in the file.
# You must import the following master repositories: source 'https://github.com/CocoaPods/Specs.git' source 'https://github.com/aliyun-sls/Specs.git' # If you want to use a repository available in the Chinese mainland, you must import the following repository: source 'https://gitee.com/aliyun-sls/Specs.git' pod 'AliyunLogProducer', '~> 4.3.17'For more information about versions, see Release notes of Alibaba Cloud Simple Log Service SDK for iOS on GitHub.
In the project folder, run the following command to import the dependencies:
pod install --repo-updateAfter SLS SDK for iOS is installed, you can call the operations that are encapsulated in the SDK in the project.
References
If an API call fails, the response from Simple Log Service includes an error code. For more information, see Error codes.
In addition to its native SDK, Simple Log Service also supports the common Alibaba Cloud SDKs. For more information, see Simple Log Service_SDK Center_Alibaba Cloud OpenAPI Explorer.
Simple Log Service provides a command-line interface (CLI) for automated configuration. For more information, see Overview of Simple Log Service CLI.
For more information about sample code, see Alibaba Cloud Simple Log Service SDK for iOS on GitHub.