All Products
Search
Document Center

Simple Log Service:Install Simple Log Service SDK for iOS

Last Updated:Oct 26, 2023

Before you can use Simple Log Service SDK for iOS to call the operations of Simple Log Service, you must install Simple Log Service SDK for iOS. This topic describes how to install Simple Log Service SDK for iOS.

Prerequisites

  • Simple Log Service is activated. For more information, see Activate Simple Log Service.

  • An AccessKey pair is created and obtained. For more information, see AccessKey pair.

    An Alibaba Cloud account has permissions to call all API operations. If you use the AccessKey pair of an Alibaba Cloud account, security risks may occur. We recommend that you create and use a RAM user to call API operations or perform routine O&M. Make sure that the RAM user is granted the permissions to perform operations on Simple Log Service resources. For more information, see Grant permissions to a RAM user.

  • An iOS development environment is set up. For more information, see Apple Developer.

Procedure

  1. Create an iOS project.

  2. In the project folder, create a Podfile and enter the command that is used to import the dependencies of Simple Log Service SDK for iOS in the file.

    # You must import the Master repository. 
    source 'https://github.com/CocoaPods/Specs.git'
    source 'https://github.com/aliyun-sls/Specs.git'
    
    pod 'AliyunLogProducer', '~> 3.2.0'

    For more information about versions, see Release notes of Alibaba Cloud Simple Log Service SDK for iOS on GitHub.

  3. In the project folder, run the following command to import the dependencies:

    pod install --repo-update

    After Simple Log Service SDK for iOS is installed, you can call the operations that are encapsulated in the SDK in the project.

References

  • If the response that is returned by Log Service contains error information after you call an API operation, the call fails. You can handle errors based on the error codes that are returned when API calls fail. For more information, see Error codes.
  • Alibaba Cloud OpenAPI Explorer provides debugging capabilities, SDKs, examples, and related documents. You can use OpenAPI Explorer to debug Log Service API operations without the need to manually encapsulate or sign requests. For more information, visit OpenAPI Portal.
  • Log Service provides the command-line interface (CLI) to meet the requirements for automated configurations in Log Service. For more information, see Log Service CLI.
  • For more information about sample code, see Alibaba Cloud Simple Log Service SDK for iOS on GitHub.

What to do next

Get started with Simple Log Service SDK for iOS