Skip to content

line/planet-kit-quickstart-macos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlanetKit quick start for macOS

This repository provides a quick start project implemented with PlanetKit for macOS.

This quick start project is based on PlanetKit 5.4.x.

About PlanetKit SDK

PlanetKit is a client SDK for LINE Planet, which is a cloud-based real-time communications platform as a service (CPaaS) that helps you build a voice and video call environment. With LINE Planet, you can integrate call features into your service at minimum cost.

PlanetKit system requirements

The system requirements of PlanetKit for macOS are as follows.

Operating system requirements

  • macOS 10.14.6 or higher

Required runtime permissions

Information Property List

App Sandbox entitlements
Network
Hardware

How to install the SDK

References

Release information

Using the quick start project

This quick start project provides basic functionality of a group audio call.

Prerequisites

1. Download source code

Clone this repository, or download this repository and unzip the files.

2. Open the project

Open Xcode project planet-kit-quickstart-macos.xcodeproj with Xcode.

3. Generate an access token

In this quick start project, we provide a script that generates an access token for your convenience. However, during the actual implementation of your app, the access token must be created in the AppServer. For more information, refer to Access token.

Generate an access token using generate_access_token.py.

  • The script requires a valid user ID as an argument. For the naming restrictions of a user ID, see User ID.
  • Python package requirement for generate_access_token.py can be found in requirements.txt.
    • You can use the command pip3 install -r requirements.txt to install required packages.

We recommend using a virtual environment for this step. For more information, see how to use venv.

user@test planet-kit-quickstart-ios % python3 generate_access_token.py <YOUR_USER_ID>
access token:  <GENERATED_ACCESS_TOKEN>

4. Apply the user ID and the access token

Copy and paste the user ID and access token into your code.

// ViewController.swift

// TODO: Set your own environment
let userId = "<YOUR_USER_ID>"
let serviceId = "planet-kit-quick-start"
let accessToken = "<GENERATED_ACCESS_TOKEN>"

....

5. Run the project

Run the quick start project on current macOS device.

6. Join a group audio call

Enter a room ID and click Join to join the group call.

To join the call successfully, you need to enter a valid room ID. For the naming restrictions of a room ID, see Room ID.

One you're connected to the call, you can communicate with other participants. Click Leave to leave the group call.

Troubleshooting

If the group call cannot be connected, please check PlanetKitStartFailReason and PlanetKitDisconnectReason.

// check PlanetKitStartFailReason
// ViewController.swift
....
class ViewController: NSViewController {
    ....

    @IBAction func joinConference(_ sender: Any) {
        let param = PlanetKitConferenceParam(myUserId: myUserId, roomId: roomId, roomServiceId: serviceId, displayName: nil, delegate: self, accessToken: accessToken)
        let result = PlanetKitManager.shared.joinConference(param: param, settings: nil)

        print("join conference result: \(result.reason)")
    }
}
// check PlanetKitDisconnectReason
// ViewController.swift
....
extension ViewController: PlanetKitConferenceDelegate {
    ....

    func didDisconnect(_ conference: PlanetKitConference, disconnected param: PlanetKitDisconnectedParam) {
        DispatchQueue.main.async {
            self.state = "disconnected"
            self.peerCount = 0

            print("disconnected: \(param.reason)")
        }
    }

    ....
}

Issues and inquiries

Please file any issues or inquiries you have to our representative or dl_planet_help@linecorp.com. Your opinions are always welcome.

FAQ

You can find answers to our frequently asked questions in the FAQ section.

About

Quick start for integrating PlanetKit on macOS applications.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published