Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add faq after team review #2

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions integration-issues/adjust_music_volume.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: 'Why can't I adjust the volume of the background music through the system volume?'
sidebar_position: 658
platforms: []
products: []
---

## Problem

When users play background music in mobile devices and join an RTC channel, they cannot adjust the volume of the background music by adjusting the system volume.

## Reason

Mobile devices have two volume types: in-call volume and media volume. Generally speaking, users use the in-call volume control to adjust audio or video calls, and the media volume control to adjust background music. See [What is the difference between the in-call volume and the media volume](./faq/system_volume) for details.

After users join an RTC channel, the Agora RTC SDK determines which volume type the system volume controls. When the SDK controls the in-call volume and the background music uses the media volume, users cannot adjust the volume of the background music through the system volume.

## Solution

#### Solution one

Call `startAudioMixingPlay` to play the background music, and the SDK can control both the background music and the user's voice. Regardless of whether the SDK uses in-call volume or media volume, users can adjust the volume of both the background music and the user's voice through the system volume.

#### Solution two

Set the `scenario` parameter of `setAudioProfile` as `GAME_STREAMING`/`AgoraAudioScenarioGameStreaming` to make the SDK use the media volume. Users can then adjust the volume of both the background music and the user's voice through the system volume.

#### Solution three

If the above solutions cannot meet your requirements, you can use platform-specific APIs to intercept volume key events and adjust the volume as follows:

- Android: Use [AudioManager](https://developer.android.com/reference/android/media/AudioManager.html).
- iOS: Use [MPVolumeView](https://developer.apple.com/documentation/mediaplayer/mpvolumeview).
87 changes: 87 additions & 0 deletions integration-issues/agora_class_ios_error.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
Most of the Agora Classroom SDK for iOS is written in Swift and supports Swift 5.0 and later. Swift supports ABI stability since version 5.0 and Module Stability since version 5.1. Because the Agora Classroom SDK for iOS enables Module Stability, errors can occur when you modify its source code.

This page lists some common errors and corresponding solutions.

## Module compiled with Swift 5.3.2 cannot be imported by the Swift 5.4 compiler

### Error

The following error might occur when you run Flexible Classroom for iOS v1.1.0:

![](https://web-cdn.agora.io/docs-files/1620822526000)

### Reason

The Agora Classroom SDK v1.1.0 supports Swift 5.3.2. Therefore, this error occurs if you use Swift 5.4.

### Solution

If you directly integrate the complete Agora Classroom SDK into your project, Agora recommends upgrading the Agora Classroom SDK to v1.1.2 or later. As of v1.1.2, Agora Classroom SDK supports Swift 5.0 and later.

## '@objc' instance method in extension of subclass of 'XXX' requires iOS 13.0.0

### Error

When you modify the source code of the Agora Classroom SDK, if you enable BUILD_LIBRARY_FOR_DISTRIBUTION for A.framework, and B.framework inherits the class of A, the following error might occur when you use `@objc` in the `extension` of B:

![](https://web-cdn.agora.io/docs-files/1624525158077)

### Solution

Add `@objc` to the main class.

## Explicit '@objc' on subclass of 'XXX' requires iOS 13.0.0

### Error

When you modify the source code of the Agora Classroom SDK, if you enable BUILD_LIBRARY_FOR_DISTRIBUTION for A.framework, and B.framework inherits the class of A, the following error might occur when you use `@objc` in the class of B:

![](https://web-cdn.agora.io/docs-files/1624525178299)

### Solution

Delete `@objc`, or modify it with `@objcMembers`.

## Non-'@objc' method 'tableView(_:numberOfRowsInSection:)' does not satisfy requirement of '@objc' protocol 'UITableViewDataSource'

### Error

When you modify the source code of the Agora Classroom SDK, if you enable BUILD_LIBRARY_FOR_DISTRIBUTION for A.framework, and B.framework inherits the class of A, the following error might occur when you implement `UITableViewDataSource` or `UITableViewDelegate` in the `extension` of B:

![](https://web-cdn.agora.io/docs-files/1624525202089)

The same error might occur when you implement `AgoraApaasReportorEventTube`, which is the custom `@objc` protocol:

![](https://web-cdn.agora.io/docs-files/1624525211463,)

### Solution

Add the Delegate code to the main class.

## Undefined symbol: _OBJC_CLASS_$__TtC5OC_XXXXXXX

### Error

In an OC file of B.framework, if you call the Swift class `AgoraHandsUpVM`, which contains member variables of the `AgoraAcceptedInfo` structure in the A.framework, the following error might occur:

![](https://web-cdn.agora.io/docs-files/1624525235312)

### Reason

Because B.framework is a static library, it is unlikely to export non-OC libraries from a Swift file.

### Solution

Inherit `AgoraAcceptedInfo` from NSObject, and modify it with `@objc` or `@objcMembers`.

## Unknown type name 'XXX'; did you mean 'ZZZ'?

### Error

In an OC file of B.framework, if you refer to the Swift class `AgoraApaasReportor`, which inherits from the Swift `AgoraReportor` class in the A.framework, the following error might occur:

![](https://web-cdn.agora.io/docs-files/1624525251577)

### Solution

Create a Wrapper class to encapsulate `AgoraApaasReportor`, and refer to it in the OC file.
31 changes: 31 additions & 0 deletions integration-issues/app_id_to_token.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
To meet the requirements for higher security, Agora is phasing out authenticating with an App ID. For projects that currently use App ID to authenticate users, Agora recommends the following steps to upgrade all your projects to token-based authentication

## 1. Enable the App Certificate

If you choose the **APP ID** authentication mechanism when creating a project, you need to enable the primary certificate manually.

On the **Edit Project** page, find **Primary certificate** and click **Enable**. Once the primary certificate is enabled, you can click ![](https://web-cdn.agora.io/docs-files/1592469070485) to view and copy the primary certificate, and use either an App ID or the token generated by the primary certificate for authentication.

![](https://web-cdn.agora.io/docs-files/1594949302908)

Once the App Certificate is enabled, the project supports authenticating users with either an App ID or a token. This enables the app to ungrade to token-based authentication without any impact on current users.

## 2. Generate tokens on your app server

Refer to [Generate a Token](https://docs.agora.io/en/Interactive%20Broadcast/token_server?platform=Android) to deploy a token generator on your app server.

## 3. Modify the app client logic

Now modify the authentication logic on your app client. Ensure that you fill the `token` parameter in `joinChannel` or `login` with the token generated from your app server.

## 4. Grey release

Your app client is now ready for a grey release. In this state, app users can join a channel either with or without a token.

## 5. Delete No Certificate

When all app clients have upgraded to token-based authentication, delete **No Certificate** in Agora Console. This prevents users from joining a channel with only an App ID.

<div class="alert warning">Once <b>No Certificate</b> is deleted, app clients that does not use token-based authentication can no longer join a channel.</div>

![](https://web-cdn.agora.io/docs-files/1614588546605)
12 changes: 12 additions & 0 deletions integration-issues/bucket_region.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Agora Cloud Recording supports the following cloud storage vendors:

- Qiniu Cloud
- Amazon S3
- Alibaba Cloud
- Tencent Cloud

Before you start, ensure that you have enabled cloud storage service with at least one of the above-mentioned vendors and have created a bucket. When calling `start`, you need to enter your cloud storage information: When setting `storageConfig`, choose a region close to the server from which you send your recording request. See [Agora Cloud Recording RESTful API](/en/cloud-recording/cloud_recording_api_rest#storageConfig) for more information.

## Issues with cross-region upload

The files to upload to the cloud storage are stored on the servers close to where you make the recording request. Therefore, a cross-region upload, e.g., making the request in the U.S. while setting the region to Beijing, can be slow or even fail.
167 changes: 167 additions & 0 deletions integration-issues/camera_exposure_focus.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
---
title: 'How can I enable camera exposure and focus?'
sidebar_position: 658
platforms: []
products: []
---


Camera exposure and focus are commonly used in video calls to enable high-quality video capture. The Agora RTC SDK provides a set of camera management methods on the Android and iOS platforms, with which you can switch between the front and rear camera, set the camera zoom factor, set the exposure region and set the focus position.

- Camera exposure: Auto exposure is supported where users can manually set the exposure region.
- Camera focus: Auto face-focus and manual focus are supported.

## Implementation

> Before proceeding, ensure that you have implemented basic real-time functions in your project.

Refer to the following steps to set the camera exposure and focus:

- **Exposure**
Call the `isCameraExposurePositionSupported` method to check whether exposure function is supported. If it is supported, call the `setCameraExposurePosition` method to set the camera exposure.
You can monitor the exposure position with the `onCameraExposureAreaChanged` callback.
- **Auto face-focus**
Call the `isCameraAutoFocusFaceModeSupported` method to check whether auto face-focus function is supported. If it is supported, call the `setCameraAutoFocusModeEnabled` method to set the focus.
- **Manual focus**
Call the `isCameraFocusSupported` method to check whether manual focus function is supported. If it is supported, call the `setCameraFocusPositionInPreview` method to set the focus.
You can monitor the focus position with the `onCameraFocusAreaChanged` callback.

### Sample code

```java
// Java
// Check whether exposure function is supported and enable exposure.
boolean shouldSetExposure = rtcEngine.isCameraExposurePositionSupported();
if (shouldSetExposure) {
// Set the camera exposure at (50, 100).
float positionX = 50.0f;
float positionY = 100.0f;
rtcEngine.setCameraExposurePosition(positionX, positionY);
}

// Check whether auto face-focus function is supported and enable auto-face focus.
boolean shouldSetFaceMode = rtcEngine.isCameraAutoFocusFaceModeSupported();
rtcEngine.setCameraAutoFocusFaceModeEnabled(shouldSetFaceMode);

// Check whether manual focus function is supported and set the focus.
boolean shouldManualFocus = rtcEngine.isCameraFocusSupported();
if (shouldManualFocus) {
// Set the camera focus at (50, 100).
float positionX = 50.0f;
float positionY = 100.0f;
rtcEngine.setCameraFocusPositionInPreview(positionX, positionY);
}

// The camera focus area is updated. You can monitor the update event and implement corresponding logic.
public void onCameraExposureAreaChanged(rect) {
}

// The camera exposure area is updated. You can monitor the update event the implement corresponding logic.
public void onCameraFocusAreaChanged(rect) {
}
```

```swift
// Swift
// Check whether exposure function is supported and enable exposure.
let isSupported = agoraKit.isCameraExposurePositionSupported()

if isSupported {
// Set the camera exposure at (50, 100).
let point = CGPoint(x: 50, y: 100)
agoraKit.setCameraExposurePosition(point)
}

// Check whether auto face-focus function is supported and enable auto-face focus.
let isSupported = agoraKit.isCameraAutoFocusFaceModeSupported()
agoraKit.setCameraAutoFocusFaceModeEnabled(isSupported)

// Check whether manual focus function is supported and set the focus.
let isSupported = agoraKit.isCameraFocusPositionInPreviewSupported()

if isSupported {
// Set the camera focus at (50, 100).
let point = CGPoint(x: 50, y: 100)
agoraKit.setCameraFocusPositionInPreview(point)
}


// The camera focus area is updated. You can monitor the update event and implement corresponding logic.
func rtcEngine(_ engine: AgoraRtcEngineKit, cameraExposureDidChangedToRect: CGRect) {
}

// The camera exposure area is updated. You can monitor the update event the implement corresponding logic.
func rtcEngine(_ engine: AgoraRtcEngineKit, cameraFocusDidChangedToRect: CGRect) {
}
```

```objective-c
// Objective-C
// Check whether exposure function is supported and enable exposure.
let isSuppported = [agoraKit isCameraExposurePositionSupported];

if (isSupported) {
// Set the camera exposure at (50, 100).
CGPoint *point = CGPointMake(50, 100);
[agoraKit setCameraExposurePosition: point];
}

// Check whether auto face-focus function is supported and enable auto-face focus.
Bool isSupported = [agoraKit isCameraAutoFocusFaceModeSupported];
[agoraKit setCameraAutoFocusFaceModeEnabled: isSupported];

// Check whether manual focus function is supported and set the focus.
let isSupported = [agoraKit isCameraFocusPositionInPreviewSupported];

if (isSupported) {
// Set the camera focus at (50, 100).
CGPoint *point = CGPointMake(50, 100);
[agoraKit setCameraFocusPositionInPreview: point];
}


// The camera focus area is updated. You can monitor the update event and implement corresponding logic.
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine cameraExposureDidChangedToRect:(CGRect)rect {
}

// The camera exposure area is updated. You can monitor the update event the implement corresponding logic.
- (void)rtcEngine:(AgoraRtcEngineKit * _Nonnull)engine cameraFocusDidChangedToRect:(CGRect)rect {
}
```

### API comparison table

The following table shows the API comparison table of Java and Objective-C languages.

| Java | Objective-C|
|------|-----------|
|`isCameraExposurePositionSupported`|`isCameraExposurePositionSupported`|
|`setCameraExposurePosition`|`setCameraExposurePosition`|
|`isCameraAutoFocusFaceModeSupported`|`isCameraAutoFocusFaceModeSupported`|
|`setCameraAutoFocusModeEnabled`|`setCameraAutoFocusModeEnabled`|
|`isCameraFocusSupported`|`isCameraFocusPositionInPreviewSupported`|
|`setCameraFocusPositionInPreview`|`setCameraFocusPositionInPreview`|
|`onCameraExposureAreaChanged`|`cameraExposureDidChangedToRect`|
|`onCameraFocusAreaChanged`|`cameraFocusDidChangedToRect`|


### API reference
- Java
- [`isCameraExposurePositionSupported`](./API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#a6818c2a98bebeb72e4802b1c585da99b)
- [`setCameraExposurePosition`](./API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#a0ac20919f60df42635850c53c9cbdefd)
- [`isCameraAutoFocusFaceModeSupported`](./API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#a09f61f738cf7d8a1902761e03a7fa600)
- [`setCameraAutoFocusModeEnabled`](./API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#a7e67afe7ad0045448fe0bd97203afcee)
- [`isCameraFocusSupported`](./API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#a0e20f04ccecfc41aa23bf63116c9a8cd)
- [`setCameraFocusPositionInPreview`](./API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#aba273e4337a760d883b6c7c1344183c0)
- [`onCameraExposureAreaChanged`](./API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#ab6bc82a55191e596d5bf5a7c56bdf95e)
- [`onCameraFocusAreaChanged`](./API%20Reference/java/classio_1_1agora_1_1rtc_1_1_i_rtc_engine_event_handler.html#a7af6c96c4c35587a13d1e367255e3ec0)

- Objective-C
- [`isCameraExposurePositionSupported`](./API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/isCameraExposurePositionSupported)
- [`setCameraExposurePosition`](./API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/setCameraExposurePosition:)
- [`isCameraAutoFocusFaceModeSupported`](./API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/isCameraAutoFocusFaceModeSupported)
- [`setCameraAutoFocusModeEnabled`](./API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/setCameraAutoFocusFaceModeEnabled:)
- [`isCameraFocusPositionInPreviewSupported`](./API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/isCameraFocusPositionInPreviewSupported)
- [`setCameraFocusPositionInPreview`](./API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/setCameraFocusPositionInPreview:)
- [`cameraExposureDidChangedToRect`](./API%20Reference/oc/Protocols/AgoraRtcEngineDelegate.html#//api/name/rtcEngine:cameraExposureDidChangedToRect:)
- [`cameraFocusDidChangedToRect`](./API%20Reference/oc/Protocols/AgoraRtcEngineDelegate.html#//api/name/rtcEngine:cameraFocusDidChangedToRect:)
53 changes: 53 additions & 0 deletions integration-issues/cocoapods_problem.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: 'How can I solve common CocoaPods problems?'
sidebar_position: 658
platforms: []
products: []
---

## pod: command not found

**Issue description**

In Terminal, after running `pod init` under the root directory of your project, the Terminal prompts `pod: command not found`.

**Reason**

CocoaPods is not installed.

**Solution**

See the following steps to solve the issue:

1. Run `sudo gem install cocoapods` and input the admin password to install CocoaPods.
2. After CocoaPods is successfully installed, go to the root directory of your project and run `pod init` again to generate a `Podfile` under your project folder.

<div class="alert note">If you run <code>sudo gem install cocoapods</code> and encounter authority issues such as <code>You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory</code> , Agora recommends that you run <code>sudo gem install -n /usr/bin cocoapods</code> to install CocoaPods.</div>

## Cannot install the latest Agora SDK

**Issue description**

When you install the Agora SDK, you might encounter the following issues:

- After entering `pod 'library_name'` in a Podfile and running `pod install` in Terminal, the Agora SDK that is installed is not the latest version.

- After entering `pod 'library_name', 'latest_version'` in a Podfile and running `pod install` in Terminal, the Terminal prompts error messages such as the following:

```shell
[!] CocoaPods could not find compatible versions for pod "AgoraRtcEngine_iOS":
In Podfile:
AgoraRtcEngine_iOS (= 3.5.0)
None of your spec sources contain a spec satisfying the dependency: `AgoraRtcEngine_iOS (= 3.5.0)`.
```

**Reason**

The local CocoaPods repository is not updated.

**Solution**

See the following steps to solve the issue:

1. Run `pod repo update` in Terminal to update the local CocoaPods repository.
2. Run `pod install` again to install the latest version of the Agora SDK.
Loading