Skip to content

Commit

Permalink
Merge pull request #68 from AgoraIO-Community/rtm-separate
Browse files Browse the repository at this point in the history
Version 1.8.0

- RTM Changes - compatible with React Native and others.
  - This update changes messages to be sent as regular messages, rather than RtmRawMessage types.
- Pod and Swift Package now have separate packages, RtmControl can be independent of AgoraUIKit.
- New import statements, use `import AgoraUIKit` for iOS and macOS.
- Bumped native RTC and RTM SDKs to 3.7.0 and 1.4.10 respectively.
- The RTM package can be included in your project without Agora UIKit.

Fixes:
- Fix issue where re-joining member's video feed would not render.
- Fix issue where RTM messages are different from Agora UIKit React Native.
  • Loading branch information
maxxfrazer authored Apr 13, 2022
2 parents 336f6a5 + c6a6646 commit eace3fb
Show file tree
Hide file tree
Showing 48 changed files with 2,078 additions and 697 deletions.
7 changes: 7 additions & 0 deletions .githooks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# iOS UIKit Git Hooks

To apply these hooks:

```sh
git config --local core.hooksPath .githooks/
```
40 changes: 40 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/zsh

# An example hook script to verify what is about to be pushed. Called by "git
# push" after it has checked the remote status, but before anything has been
# pushed. If this script exits with a non-zero status nothing will be pushed.
#
# This hook is called with the following parameters:
#
# $1 -- Name of the remote to which the push is being done
# $2 -- URL to which the push is being done
#
# If pushing without using a named remote those arguments will be equal.
#
# Information about the commits which are being pushed is supplied as lines to
# the standard input in the form:
#
# <local ref> <local oid> <remote ref> <remote oid>
#
# This sample shows how to prevent push of commits where the log message starts
# with "WIP" (work in progress).

remote="$1"
url="$2"

zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')

while read local_ref local_oid remote_ref remote_oid
do
VRSN=$(grep 'static let version' Sources/Agora-UIKit/AgoraUIKit.swift | sed -e 's,.*\"\(.*\)\",\1,')
pat="ref.+tags.+[0-9]+\.[0-9]+\.[0-9]+.*"
if [[ $local_ref =~ $pat ]]; then
TAG_VERSION=$(echo $local_ref | sed -e 's/refs\/tags\///g')
if [ "$TAG_VERSION" != "$VRSN" ]; then
echo "Invalid tag ${TAG_VERSION}, not matching AgoraUIKit.swift: ${VRSN}"
exit 1
fi
fi
done

exit 0
32 changes: 32 additions & 0 deletions .github/workflows/deploy_to_cocoapods.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: deploy_to_cocoapods

on:
push:
tags:
- '*'

jobs:
build:

runs-on: macOS-latest

steps:
- uses: actions/checkout@v3

- name: Install Cocoapods
run: gem install cocoapods

- name: Deploy to Cocoapods
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: |
set -eo pipefail
export LIB_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
export VRSN=$(grep 'static let version' Sources/Agora-UIKit/AgoraUIKit.swift | sed -e 's,.*\"\(.*\)\",\1,')
if [ "$LIB_VERSION" != "$VRSN" ]; then
exit 1
fi
pod trunk push AgoraRtmControl_macOS.podspec --allow-warnings --skip-import-validation;
pod trunk push AgoraRtmControl_iOS.podspec --allow-warnings --skip-import-validation;
pod trunk push AgoraUIKit_macOS.podspec --allow-warnings --skip-import-validation --synchronous;
pod trunk push AgoraUIKit_iOS.podspec --allow-warnings --skip-import-validation --synchronous;
5 changes: 3 additions & 2 deletions .github/workflows/podlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ jobs:
podlint:
runs-on: macOS-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- name: Pod Lint
run: |
pod lib lint --allow-warnings --skip-import-validation
pod lib lint AgoraUIKit_iOS.podspec --allow-warnings --skip-import-validation --include-podspecs='AgoraRtmControl_iOS.podspec';
pod lib lint AgoraUIKit_macOS.podspec --allow-warnings --skip-import-validation --include-podspecs='AgoraRtmControl_macOS.podspec';
shell: bash
14 changes: 7 additions & 7 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: swiftlint
name: Swiftlint

on:
push:
Expand All @@ -9,11 +9,11 @@ on:
- "*"

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: GitHub Action for SwiftLint
uses: norio-nomura/[email protected]
with:
args: --strict
- uses: actions/checkout@v3
- name: GitHub Action for SwiftLint
uses: norio-nomura/[email protected]
with:
args: --strict
5 changes: 3 additions & 2 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ line_length:
excluded:
- Agora-*-Example
- Sources/Agora-UIKit/AgoraUIKit+MD5.swift
- Sources/Agora-UIKit/AgoraRtmController+RtmDelegateOverflows.swift
- Sources/AgoraRtmControl/AgoraRtmController+RtmDelegateOverflows.swift
- Sources/Agora-UIKit/AgoraVideoViewer+RtcEngineDelegateOverflow.swift
- .build
- .build
- docc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import Cocoa
import AgoraUIKit_macOS
import AgoraUIKit

class ViewController: NSViewController {

Expand Down
3 changes: 2 additions & 1 deletion Agora-AppKit-Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Uncomment the next line to define a global platform for your project
platform :macos, '10.14'
platform :macos, '10.15'

target 'Agora-AppKit-Example' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for Agora-UIKit-Example
pod 'AgoraRtmControl_macOS', :path => '../'
pod 'AgoraUIKit_macOS', :path => '../'

end
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
objects = {

/* Begin PBXBuildFile section */
F327EEC928057D2A00C86D3D /* AgoraUIKit in Frameworks */ = {isa = PBXBuildFile; productRef = F327EEC828057D2A00C86D3D /* AgoraUIKit */; };
F327EECB28057D3200C86D3D /* AgoraRtmControl in Frameworks */ = {isa = PBXBuildFile; productRef = F327EECA28057D3200C86D3D /* AgoraRtmControl */; };
F327FCFB259B97ED00922764 /* Agora_SwiftUI_ExampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F327FCFA259B97ED00922764 /* Agora_SwiftUI_ExampleApp.swift */; };
F327FCFD259B97ED00922764 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F327FCFC259B97ED00922764 /* ContentView.swift */; };
F327FCFF259B97EF00922764 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F327FCFE259B97EF00922764 /* Assets.xcassets */; };
F327FD02259B97EF00922764 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F327FD01259B97EF00922764 /* Preview Assets.xcassets */; };
F3DDD460278D8C38003D4A16 /* AgoraUIKit_iOS in Frameworks */ = {isa = PBXBuildFile; productRef = F3DDD45F278D8C38003D4A16 /* AgoraUIKit_iOS */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
Expand All @@ -29,7 +30,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F3DDD460278D8C38003D4A16 /* AgoraUIKit_iOS in Frameworks */,
F327EEC928057D2A00C86D3D /* AgoraUIKit in Frameworks */,
F327EECB28057D3200C86D3D /* AgoraRtmControl in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -106,7 +108,8 @@
);
name = "Agora-SwiftUI-Example";
packageProductDependencies = (
F3DDD45F278D8C38003D4A16 /* AgoraUIKit_iOS */,
F327EEC828057D2A00C86D3D /* AgoraUIKit */,
F327EECA28057D3200C86D3D /* AgoraRtmControl */,
);
productName = "Agora-SwiftUI-Example";
productReference = F327FCF7259B97ED00922764 /* Agora-SwiftUI-Example.app */;
Expand Down Expand Up @@ -353,9 +356,13 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
F3DDD45F278D8C38003D4A16 /* AgoraUIKit_iOS */ = {
F327EEC828057D2A00C86D3D /* AgoraUIKit */ = {
isa = XCSwiftPackageProductDependency;
productName = AgoraUIKit_iOS;
productName = AgoraUIKit;
};
F327EECA28057D3200C86D3D /* AgoraRtmControl */ = {
isa = XCSwiftPackageProductDependency;
productName = AgoraRtmControl;
};
/* End XCSwiftPackageProductDependency section */
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import SwiftUI
import AgoraUIKit_iOS
import AgoraUIKit

struct ContentView: View {
@State private var connectedToChannel = false
Expand Down
51 changes: 40 additions & 11 deletions Agora-UIKit-Example/Agora-UIKit-Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
F39B87D327200A8900C644C7 /* AgoraUIKit_iOS in Frameworks */ = {isa = PBXBuildFile; productRef = F39B87D227200A8900C644C7 /* AgoraUIKit_iOS */; };
F366512627FDF05700DDD521 /* AgoraUIKit in Frameworks */ = {isa = PBXBuildFile; productRef = F366512527FDF05700DDD521 /* AgoraUIKit */; };
F366512827FDF07100DDD521 /* AgoraRtmControl in Frameworks */ = {isa = PBXBuildFile; productRef = F366512727FDF07100DDD521 /* AgoraRtmControl */; };
F3C4328E256FB56C00E2AD43 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3C4328D256FB56C00E2AD43 /* AppDelegate.swift */; };
F3C43290256FB56C00E2AD43 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3C4328F256FB56C00E2AD43 /* SceneDelegate.swift */; };
F3C43292256FB56C00E2AD43 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3C43291256FB56C00E2AD43 /* ViewController.swift */; };
Expand All @@ -16,8 +17,21 @@
F3C4329A256FB56F00E2AD43 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F3C43298256FB56F00E2AD43 /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
F33CA68E27FB3C7500541A7A /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
F39B87D0272009FA00C644C7 /* iOS-UIKit */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "iOS-UIKit"; path = ..; sourceTree = "<group>"; };
F366512327FDF03F00DDD521 /* iOS-UIKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = "iOS-UIKit"; path = ..; sourceTree = "<group>"; };
F3C4328A256FB56C00E2AD43 /* Agora-UIKit-Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Agora-UIKit-Example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
F3C4328D256FB56C00E2AD43 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
F3C4328F256FB56C00E2AD43 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand All @@ -33,35 +47,44 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
F39B87D327200A8900C644C7 /* AgoraUIKit_iOS in Frameworks */,
F366512627FDF05700DDD521 /* AgoraUIKit in Frameworks */,
F366512827FDF07100DDD521 /* AgoraRtmControl in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
F39B87CF272009FA00C644C7 /* Packages */ = {
E4B1C9811C27629FB0E02419 /* Pods */ = {
isa = PBXGroup;
children = (
F39B87D0272009FA00C644C7 /* iOS-UIKit */,
);
name = Packages;
path = Pods;
sourceTree = "<group>";
};
F39B87D127200A8900C644C7 /* Frameworks */ = {
F366512427FDF05700DDD521 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
F39B87CF272009FA00C644C7 /* Packages */ = {
isa = PBXGroup;
children = (
F366512327FDF03F00DDD521 /* iOS-UIKit */,
);
name = Packages;
sourceTree = "<group>";
};
F3C43281256FB56C00E2AD43 = {
isa = PBXGroup;
children = (
F39B87CF272009FA00C644C7 /* Packages */,
F3C4328C256FB56C00E2AD43 /* Agora-UIKit-Example */,
F3C4328B256FB56C00E2AD43 /* Products */,
F39B87D127200A8900C644C7 /* Frameworks */,
E4B1C9811C27629FB0E02419 /* Pods */,
F366512427FDF05700DDD521 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -97,14 +120,16 @@
F3C43286256FB56C00E2AD43 /* Sources */,
F3C43287256FB56C00E2AD43 /* Frameworks */,
F3C43288256FB56C00E2AD43 /* Resources */,
F33CA68E27FB3C7500541A7A /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = "Agora-UIKit-Example";
packageProductDependencies = (
F39B87D227200A8900C644C7 /* AgoraUIKit_iOS */,
F366512527FDF05700DDD521 /* AgoraUIKit */,
F366512727FDF07100DDD521 /* AgoraRtmControl */,
);
productName = "Agora-UIKit-Example";
productReference = F3C4328A256FB56C00E2AD43 /* Agora-UIKit-Example.app */;
Expand Down Expand Up @@ -366,9 +391,13 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
F39B87D227200A8900C644C7 /* AgoraUIKit_iOS */ = {
F366512527FDF05700DDD521 /* AgoraUIKit */ = {
isa = XCSwiftPackageProductDependency;
productName = AgoraUIKit;
};
F366512727FDF07100DDD521 /* AgoraRtmControl */ = {
isa = XCSwiftPackageProductDependency;
productName = AgoraUIKit_iOS;
productName = AgoraRtmControl;
};
/* End XCSwiftPackageProductDependency section */
};
Expand Down
6 changes: 4 additions & 2 deletions Agora-UIKit-Example/Agora-UIKit-Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
//

import UIKit

import AgoraRtcKit
import AgoraUIKit_iOS
import AgoraUIKit

class ViewController: UIViewController {

Expand All @@ -18,6 +17,9 @@ class ViewController: UIViewController {

var agSettings = AgoraSettings()
agSettings.enabledButtons = [.cameraButton, .micButton, .flipButton]
agSettings.buttonPosition = .right
AgoraVideoViewer.printLevel = .verbose

let agoraView = AgoraVideoViewer(
connectionData: AgoraConnectionData(
appId: <#Agora App ID#>,
Expand Down
10 changes: 10 additions & 0 deletions Agora-UIKit-Example/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Agora-UIKit-Example' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

# Pods for Agora-UIKit-Example
pod 'AgoraUIKit_iOS', :path => '../'
end
31 changes: 31 additions & 0 deletions AgoraRtmControl_iOS.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Be sure to run `pod lib lint AgoraRtmControl_iOS.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
s.name = 'AgoraRtmControl_iOS'
s.module_name = 'AgoraRtmControl'
s.version = ENV['LIB_VERSION'] || '1.8.0'
s.summary = 'Agora Real-time Messaging Wrapper.'

s.description = <<-DESC
Use this Pod to interact with Agora Real-time messaging SDK with additional properties and commands,
to make the usage simpler with the AgoraRtmController class.
DESC

s.homepage = 'https://github.com/AgoraIO-Community/iOS-UIKit'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Max Cobb' => '[email protected]' }
s.source = { :git => 'https://github.com/AgoraIO-Community/iOS-UIKit.git', :tag => s.version.to_s }

s.ios.deployment_target = '11.0'
s.swift_versions = ['5.0']

s.static_framework = true
s.source_files = 'Sources/AgoraRtmControl/*'
s.dependency 'AgoraRtm_iOS', '~> 1.4.10'
end
Loading

0 comments on commit eace3fb

Please sign in to comment.