diff --git a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/Agora Mac Tutorial Objective-C/VideoChat/AppID.h b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/Agora Mac Tutorial Objective-C/VideoChat/AppID.h index 76b6de64..bcce43d8 100755 --- a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/Agora Mac Tutorial Objective-C/VideoChat/AppID.h +++ b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/Agora Mac Tutorial Objective-C/VideoChat/AppID.h @@ -7,3 +7,4 @@ // FOUNDATION_EXPORT NSString *const AppID; +FOUNDATION_EXPORT NSString *const Token; diff --git a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/Agora Mac Tutorial Objective-C/VideoChat/AppID.m b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/Agora Mac Tutorial Objective-C/VideoChat/AppID.m index 524471e4..27b8403c 100755 --- a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/Agora Mac Tutorial Objective-C/VideoChat/AppID.m +++ b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/Agora Mac Tutorial Objective-C/VideoChat/AppID.m @@ -9,3 +9,5 @@ #import NSString *const AppID = <#Your App ID#>; +//assign token to nil if you have not enabled app certificate, this usually happens to old projects +NSString *const Token = <#Temp Token#>; diff --git a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/Agora Mac Tutorial Objective-C/VideoChat/VideoChatViewController.m b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/Agora Mac Tutorial Objective-C/VideoChat/VideoChatViewController.m index 28a7464f..35c6b3e5 100755 --- a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/Agora Mac Tutorial Objective-C/VideoChat/VideoChatViewController.m +++ b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/Agora Mac Tutorial Objective-C/VideoChat/VideoChatViewController.m @@ -77,7 +77,7 @@ - (void)setupLocalVideo { } - (void)joinChannel { - [self.agoraKit joinChannelByToken:nil channelId:@"demoChannel1" info:nil uid:0 joinSuccess:^(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed) { + [self.agoraKit joinChannelByToken:Token channelId:@"demoChannel1" info:nil uid:0 joinSuccess:^(NSString * _Nonnull channel, NSUInteger uid, NSInteger elapsed) { // Did join channel "demoChannel1" }]; // The UID database is maintained by your app to track which users joined which channels. If not assigned (or set to 0), the SDK will allocate one and returns it in joinSuccessBlock callback. The App needs to record and maintain the returned value as the SDK does not maintain it. diff --git a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.md b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.md index 89adcfa5..5ed6c92e 100644 --- a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.md +++ b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.md @@ -30,12 +30,12 @@ To build and run the sample application, get an App ID: 3. Save the **App ID** from the Dashboard for later use. 4. Generate a temp **Access Token** (valid for 24 hours) from dashboard page with given channel name, save for later use. -4. Open `Agora Mac Tutorial Objective-C.xcodeproj` and edit the `KeyCenter.m` file. Update `<#Your App Id#>` with your app ID. +5. Open `Agora Mac Tutorial Objective-C.xcodeproj` and edit the `AppID.m` file. Update `<#Your App Id#>` with your app ID, and assign the token variable with the temp Access Token generated from dashboard. ``` - + (NSString *)AppId { - return @"Your App ID"; - } + NSString *const appID = @"<#Your App ID#>"; + // assign token to nil if you have not enabled app certificate, this usually happens to old projects + NSString *const token = @"<#Temp Token#>"; ``` ### Integrate the Agora Video SDK diff --git a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.yaml b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.yaml index 9fbe9bd8..e2c5d212 100644 --- a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.yaml +++ b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.yaml @@ -27,12 +27,12 @@ QuickStart: - title: Obtain an App ID content: | $_{APPID} - 4. Open `Agora Mac Tutorial Objective-C.xcodeproj` and edit the `KeyCenter.m` file. Update `<#Your App Id#>` with your app ID. + 5. Open `Agora Mac Tutorial Objective-C.xcodeproj` and edit the `AppID.m` file. Update `<#Your App Id#>` with your app ID, and assign the token variable with the temp Access Token generated from dashboard. ``` - + (NSString *)AppId { - return @"Your App ID"; - } + NSString *const appID = @"<#Your App ID#>"; + // assign token to nil if you have not enabled app certificate, this usually happens to old projects + NSString *const token = @"<#Temp Token#>"; ``` - title: Integrate the Agora Video SDK content: | diff --git a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.zh.md b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.zh.md index d1fafb8f..4c503fe7 100644 --- a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.zh.md +++ b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.zh.md @@ -30,11 +30,13 @@ 3. 复制后台的 **App ID** 并备注,稍后启动应用时会用到它 4. 在项目页面生成临时 **Access Token** (24小时内有效)并备注,注意生成的Token只能适用于对应的频道名。 -4. 将 AppID 填写进 KeyCenter.m +5. 将 AppID 和 Token 填写进 AppID.m -``` -static let AppId: String = "Your App ID" -``` + ``` + NSString *const appID = @"<#Your App ID#>"; + // 如果你是比较旧的项目,且没有打开Token功能,token可以直接给nil + NSString *const token = @"<#Temp Token#>"; + ``` ### 集成 Agora 视频 SDK diff --git a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.zh.yaml b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.zh.yaml index a06ad4bb..3cc67916 100644 --- a/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.zh.yaml +++ b/One-to-One-Video/Agora-macOS-Tutorial-Objective-C-1to1/README.zh.yaml @@ -27,11 +27,13 @@ QuickStart: - title: 创建Agora账号并获取AppId content: | $_{APPID} - 4. 将 AppID 填写进 KeyCenter.m + 5. 将 AppID 和 Token 填写进 AppID.m - ``` - static let AppId: String = "Your App ID" - ``` + ``` + NSString *const appID = @"<#Your App ID#>"; + // 如果你是比较旧的项目,且没有打开Token功能,token可以直接给nil + NSString *const token = @"<#Temp Token#>"; + ``` - title: 集成 Agora 视频 SDK content: | diff --git a/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/Agora Mac Tutorial Swift/VideoChat/AppID.swift b/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/Agora Mac Tutorial Swift/VideoChat/AppID.swift index c3930382..536fc4fb 100755 --- a/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/Agora Mac Tutorial Swift/VideoChat/AppID.swift +++ b/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/Agora Mac Tutorial Swift/VideoChat/AppID.swift @@ -7,3 +7,5 @@ // let AppID: String = <#Your App ID#> +// assign token to nil if you have not enabled app certificate, this usually happens to old projects +let Token: String? = <#Temp Token#> diff --git a/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/Agora Mac Tutorial Swift/VideoChat/VideoChatViewController.swift b/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/Agora Mac Tutorial Swift/VideoChat/VideoChatViewController.swift index 1e29264d..849de2f3 100755 --- a/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/Agora Mac Tutorial Swift/VideoChat/VideoChatViewController.swift +++ b/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/Agora Mac Tutorial Swift/VideoChat/VideoChatViewController.swift @@ -73,7 +73,7 @@ class VideoChatViewController: NSViewController { } func joinChannel() { - AgoraKit.joinChannel(byToken: nil, channelId: "demoChannel1", info:nil, uid:0) { (sid, uid, elapsed) -> Void in + AgoraKit.joinChannel(byToken: Token, channelId: "demoChannel1", info:nil, uid:0) { (sid, uid, elapsed) -> Void in // did join channel "demoChannel1" } } diff --git a/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.md b/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.md index 703a50e5..77e1d731 100644 --- a/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.md +++ b/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.md @@ -29,10 +29,12 @@ To build and run the sample application, get an App ID: 3. Save the **App ID** from the Dashboard for later use. 4. Generate a temp **Access Token** (valid for 24 hours) from dashboard page with given channel name, save for later use. -4. Open `Agora Mac Tutorial Swift.xcodeproj` and edit the `KeyCenter.swift` file. In the `agoraKit` declaration, update `<#Your App Id#>` with your app ID. +5. Open `Agora Mac Tutorial Swift.xcodeproj` and edit the `AppID.swift` file. In the `agoraKit` declaration, update `<#Your App Id#>` with your app ID, and assign the token variable with the temp Access Token generated from dashboard. ``` Swift - static let AppId: String = <#Your App Id#> + let AppID: String = <#Your App ID#> + // assign Token to nil if you have not enabled app certificate, this usually happens to old projects + let Token: String? = <#Temp Token#> ``` ### Integrate the Agora Video SDK diff --git a/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.yaml b/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.yaml index b87290e8..b43486a5 100644 --- a/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.yaml +++ b/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.yaml @@ -26,10 +26,12 @@ QuickStart: - title: Obtain an App ID content: | $_{APPID} - 4. Open `Agora Mac Tutorial Swift.xcodeproj` and edit the `KeyCenter.swift` file. In the `agoraKit` declaration, update `<#Your App Id#>` with your app ID. + 5. Open `Agora Mac Tutorial Swift.xcodeproj` and edit the `AppID.swift` file. In the `agoraKit` declaration, update `<#Your App Id#>` with your app ID, and assign the token variable with the temp Access Token generated from dashboard. ``` Swift - static let AppId: String = <#Your App Id#> + let AppID: String = <#Your App ID#> + // assign Token to nil if you have not enabled app certificate, this usually happens to old projects + let Token: String? = <#Temp Token#> ``` - title: Integrate the Agora Video SDK content: | diff --git a/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.zh.md b/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.zh.md index f982c618..ab0f45a5 100644 --- a/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.zh.md +++ b/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.zh.md @@ -30,11 +30,13 @@ 3. 复制后台的 **App ID** 并备注,稍后启动应用时会用到它 4. 在项目页面生成临时 **Access Token** (24小时内有效)并备注,注意生成的Token只能适用于对应的频道名。 -4. 将 AppID 填写进 KeyCenter.swift +5. 将 AppID 和 Token 填写进 AppID.swift -``` -static let AppId: String = "Your App ID" -``` + ``` + let AppID: String = <#Your App ID#> + // 如果你是比较旧的项目,且没有打开Token功能,token可以直接给nil + let Token: String? = <#Temp Token#> + ``` ### 集成 Agora 视频 SDK diff --git a/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.zh.yaml b/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.zh.yaml index 2985850e..0002eb92 100644 --- a/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.zh.yaml +++ b/One-to-One-Video/Agora-macOS-Tutorial-Swift-1to1/README.zh.yaml @@ -27,11 +27,13 @@ QuickStart: - title: 创建Agora账号并获取AppId content: | $_{APPID} - 4. 将 AppID 填写进 KeyCenter.swift + 5. 将 AppID 和 Token 填写进 AppID.swift - ``` - static let AppId: String = "Your App ID" - ``` + ``` + let AppID: String = <#Your App ID#> + // 如果你是比较旧的项目,且没有打开Token功能,token可以直接给nil + let Token: String? = <#Temp Token#> + ``` - title: 集成 Agora 视频 SDK content: |