Commit 955d7797 by zhangyunjie

添加接口

parent bd6cea63
......@@ -202,10 +202,23 @@
A96621F524EA84160024EB54 /* libxml2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A96621F424EA83D70024EB54 /* libxml2.tbd */; };
A96621F624EA84230024EB54 /* libsqlite3.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A96621F324EA83C90024EB54 /* libsqlite3.tbd */; };
A96621F724EA842E0024EB54 /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = A96621F224EA83BB0024EB54 /* libresolv.tbd */; };
A96621F924EA860E0024EB54 /* oimcore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A96621F824EA860E0024EB54 /* oimcore.framework */; };
A966274D24EBA56C0024EB54 /* OffcnIMSDKiOS.m in Sources */ = {isa = PBXBuildFile; fileRef = A966274C24EBA56C0024EB54 /* OffcnIMSDKiOS.m */; };
B94FCB1053F8932068A11CC9 /* libPods-OffcnIMSDKiOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 49CE5E230A14D9B821170F61 /* libPods-OffcnIMSDKiOS.a */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
A966275024EBD28A0024EB54 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
3F07C2EC97AF605DC6BD528E /* Pods-OffcnIMSDKiOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OffcnIMSDKiOS.debug.xcconfig"; path = "Target Support Files/Pods-OffcnIMSDKiOS/Pods-OffcnIMSDKiOS.debug.xcconfig"; sourceTree = "<group>"; };
49CE5E230A14D9B821170F61 /* libPods-OffcnIMSDKiOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OffcnIMSDKiOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
......@@ -615,7 +628,8 @@
A96621F224EA83BB0024EB54 /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; };
A96621F324EA83C90024EB54 /* libsqlite3.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libsqlite3.tbd; path = usr/lib/libsqlite3.tbd; sourceTree = SDKROOT; };
A96621F424EA83D70024EB54 /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = usr/lib/libxml2.tbd; sourceTree = SDKROOT; };
A96621F824EA860E0024EB54 /* oimcore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = oimcore.framework; sourceTree = "<group>"; };
A966274B24EBA56C0024EB54 /* OffcnIMSDKiOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OffcnIMSDKiOS.h; sourceTree = "<group>"; };
A966274C24EBA56C0024EB54 /* OffcnIMSDKiOS.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OffcnIMSDKiOS.m; sourceTree = "<group>"; };
D7DCDED1DEE7F99F223D5C73 /* Pods-OffcnIMSDKiOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OffcnIMSDKiOS.release.xcconfig"; path = "Target Support Files/Pods-OffcnIMSDKiOS/Pods-OffcnIMSDKiOS.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
......@@ -628,7 +642,6 @@
A96621F624EA84230024EB54 /* libsqlite3.tbd in Frameworks */,
A96621F524EA84160024EB54 /* libxml2.tbd in Frameworks */,
A96621EF24EA83A80024EB54 /* SystemConfiguration.framework in Frameworks */,
A96621F924EA860E0024EB54 /* oimcore.framework in Frameworks */,
A96621F124EA83B10024EB54 /* CoreTelephony.framework in Frameworks */,
B94FCB1053F8932068A11CC9 /* libPods-OffcnIMSDKiOS.a in Frameworks */,
);
......@@ -667,7 +680,7 @@
A9661B4224EA64EE0024EB54 /* OffcnIMSDKiOS */ = {
isa = PBXGroup;
children = (
A96621F824EA860E0024EB54 /* oimcore.framework */,
A966274724EBA36A0024EB54 /* ExposedInterface-(外放接口) */,
A9661FC824EA7AD10024EB54 /* Common-(宏) */,
A9661F8124EA7AD10024EB54 /* Tools-(工具) */,
A9661B5C24EA72900024EB54 /* AppDelegate.h */,
......@@ -856,10 +869,10 @@
A9661FC324EA7AD10024EB54 /* GeneralTool */ = {
isa = PBXGroup;
children = (
A9661FC424EA7AD10024EB54 /* SDGeneralTool.m */,
A9661FC524EA7AD10024EB54 /* OffcnToast.m */,
A9661FC624EA7AD10024EB54 /* SDGeneralTool.h */,
A9661FC424EA7AD10024EB54 /* SDGeneralTool.m */,
A9661FC724EA7AD10024EB54 /* OffcnToast.h */,
A9661FC524EA7AD10024EB54 /* OffcnToast.m */,
);
path = GeneralTool;
sourceTree = "<group>";
......@@ -1408,6 +1421,15 @@
path = ZYJAFNetworking;
sourceTree = "<group>";
};
A966274724EBA36A0024EB54 /* ExposedInterface-(外放接口) */ = {
isa = PBXGroup;
children = (
A966274B24EBA56C0024EB54 /* OffcnIMSDKiOS.h */,
A966274C24EBA56C0024EB54 /* OffcnIMSDKiOS.m */,
);
path = "ExposedInterface-(外放接口)";
sourceTree = "<group>";
};
CC1958D307ED3EA5F9EA7118 /* Frameworks */ = {
isa = PBXGroup;
children = (
......@@ -1432,6 +1454,7 @@
A9661B3C24EA64ED0024EB54 /* Sources */,
A9661B3D24EA64ED0024EB54 /* Frameworks */,
A9661B3E24EA64ED0024EB54 /* Resources */,
A966275024EBD28A0024EB54 /* Embed Frameworks */,
);
buildRules = (
);
......@@ -1552,6 +1575,7 @@
A9661FDF24EA7AD10024EB54 /* NSAttributedString+SDSize.m in Sources */,
A96621C424EA80A60024EB54 /* ZYJOSSIPv6PrefixResolver.m in Sources */,
A96621EB24EA80A60024EB54 /* ZYJAFURLSessionManager.m in Sources */,
A966274D24EBA56C0024EB54 /* OffcnIMSDKiOS.m in Sources */,
A96621AF24EA80A60024EB54 /* ZYJOSSResult.m in Sources */,
A966219124EA80A60024EB54 /* ZYJMJRefreshAutoGifFooter.m in Sources */,
A966215C24EA80A60024EB54 /* NSObject+ZYJMJClass.m in Sources */,
......@@ -1847,6 +1871,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = LA78A3696S;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/OffcnIMSDKiOS",
......@@ -1858,9 +1883,13 @@
"@executable_path/Frameworks",
);
ONLY_ACTIVE_ARCH = YES;
PRODUCT_BUNDLE_IDENTIFIER = com.eoffcn.classonline;
OTHER_LDFLAGS = (
"-ObjC",
"$(inherited)",
);
PRODUCT_BUNDLE_IDENTIFIER = com.eoffcn.questions;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ClassonlineDev;
PROVISIONING_PROFILE_SPECIFIER = WXQuestionDev;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
......@@ -1873,6 +1902,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
DEVELOPMENT_TEAM = LA78A3696S;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/OffcnIMSDKiOS",
......@@ -1883,9 +1913,13 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.eoffcn.classonline;
OTHER_LDFLAGS = (
"-ObjC",
"$(inherited)",
);
PRODUCT_BUNDLE_IDENTIFIER = com.eoffcn.questions;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ClassonlineDev;
PROVISIONING_PROFILE_SPECIFIER = WXQuestionDev;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
......
......@@ -52,7 +52,7 @@
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
......
//
// AppDelegate.h
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/7/25.
// Copyright © 2018年 中公教育. All rights reserved.
......
//
// AppDelegate.m
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/7/25.
// Copyright © 2018年 中公教育. All rights reserved.
......@@ -8,6 +8,7 @@
#import "AppDelegate.h"
#import "ViewController.h"
#import "OffcnIMSDKiOS.h"
@interface AppDelegate ()
......@@ -28,12 +29,14 @@
//中公直播使用测试环境设置为YES,正式环境设置为NO或者去掉这个配置
// NSNumber *changeEnvironment = [[NSUserDefaults standardUserDefaults] valueForKey:kOffcnLiveSDK_changeEnvironment];
// NSLog(@"changeEnvironment---%@",changeEnvironment);
// [OffcnLiveSDK defaultService].isTest = [changeEnvironment boolValue];
NSNumber *changeEnvironment = [[NSUserDefaults standardUserDefaults] valueForKey:kOffcnIMSDKiOS_changeEnvironment];
NSLog(@"changeEnvironment---%@",changeEnvironment);
[OffcnIMSDKiOS defaultService].isTest = [changeEnvironment boolValue];
[OffcnIMSDKiOS defaultService].isTest = YES;
//获取网络状态和内部初始化处理
// [[OffcnLiveSDK defaultService] startNotifierUseRealReachability];
[[OffcnIMSDKiOS defaultService] startNotifierUseRealReachability];
return YES;
}
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="15505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15510"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
......@@ -21,66 +19,8 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入小班课房间口令" textAlignment="natural" minimumFontSize="17" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="BUe-hm-JG9">
<rect key="frame" x="15" y="145" width="345" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入昵称" textAlignment="natural" minimumFontSize="17" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="GT0-B9-RQ5">
<rect key="frame" x="15" y="75" width="345" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="5ga-Si-2Sb"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入uuid" textAlignment="natural" minimumFontSize="17" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="60L-bR-OE1">
<rect key="frame" x="15" y="110" width="345" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RZ3-2O-Iin">
<rect key="frame" x="15" y="180" width="80" height="30"/>
<color key="backgroundColor" red="0.44563790509203638" green="1" blue="0.34767431509271307" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="KHm-fD-Sh8"/>
<constraint firstAttribute="width" constant="80" id="XeW-gF-t7R"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<state key="normal" title="小班直播"/>
<connections>
<action selector="enterRoomAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="7lH-rN-Dqe"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pjv-b2-iPq">
<rect key="frame" x="105" y="180" width="80" height="30"/>
<color key="backgroundColor" red="0.0" green="0.99143940210000003" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<state key="normal" title="小班回放"/>
<connections>
<action selector="playBackAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="lxo-uP-zHJ"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="CmS-a0-5Ps">
<rect key="frame" x="195" y="180" width="80" height="30"/>
<color key="backgroundColor" red="0.95065469941089453" green="1" blue="0.23935494223729314" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="15"/>
<state key="normal" title="小班下载"/>
<connections>
<action selector="downloadAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="RY2-R8-ttG"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AiL-Tl-7G9">
<rect key="frame" x="15" y="396" width="345" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="muO-oT-o7X"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="HDM-va-7kG">
<rect key="frame" x="0.0" y="20" width="375" height="50"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="50"/>
<color key="backgroundColor" red="1" green="0.21225945169999999" blue="0.26982277180000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="hEt-Jn-qfb"/>
......@@ -90,161 +30,88 @@
<action selector="clickExitKeyboardAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="gS2-qL-GWP"/>
</connections>
</button>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入大班课房间口令" textAlignment="natural" minimumFontSize="17" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="yKv-m4-w6H">
<rect key="frame" x="15" y="220" width="345" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="请输入大班课房间口令" textAlignment="natural" minimumFontSize="17" clearButtonMode="always" translatesAutoresizingMaskIntoConstraints="NO" id="ji1-iU-ZLA">
<rect key="frame" x="15" y="295" width="345" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="A6O-U4-UGr">
<rect key="frame" x="15" y="255" width="80" height="30"/>
<color key="backgroundColor" red="0.44563790510000001" green="1" blue="0.34767431510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<state key="normal" title="大班直播"/>
<connections>
<action selector="enterRoomAction2:" destination="BYZ-38-t0r" eventType="touchUpInside" id="nEf-AE-IjQ"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="27e-O9-DsT">
<rect key="frame" x="195" y="255" width="80" height="30"/>
<color key="backgroundColor" red="0.96235413439999995" green="1" blue="0.30322128329999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<state key="normal" title="大班下载"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="so4-rI-aRi">
<rect key="frame" x="0.0" y="55" width="375" height="30"/>
<color key="backgroundColor" red="0.63529411759999999" green="0.51764705879999995" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="FlU-ab-1sz"/>
</constraints>
<color key="tintColor" red="0.63529411759999999" green="0.51764705879999995" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<state key="normal" title="当前为正式环境,点击切换为测试环境">
<color key="titleColor" red="1" green="0.1764705882" blue="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<state key="selected" title="当前为测试环境,点击切换为正式环境"/>
<connections>
<action selector="downloadAction2:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Qko-cv-Ri3"/>
<action selector="clickChangeEnvironmentBtnAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="3bs-lx-zXl"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hum-Mo-zFX">
<rect key="frame" x="105" y="255" width="80" height="30"/>
<color key="backgroundColor" red="0.0" green="0.99143940210000003" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<state key="normal" title="大班回放"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TnX-iH-azN">
<rect key="frame" x="15" y="90" width="62" height="30"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="发送消息"/>
<connections>
<action selector="playBackAction2:" destination="BYZ-38-t0r" eventType="touchUpInside" id="AQt-h0-Gv2"/>
<action selector="sendMeg:" destination="BYZ-38-t0r" eventType="touchUpInside" id="FvS-MG-NH7"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ryi-dE-cYg">
<rect key="frame" x="15" y="330" width="80" height="30"/>
<color key="backgroundColor" red="0.44563790510000001" green="1" blue="0.34767431510000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<state key="normal" title="大班直播"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9JE-Lz-Dma">
<rect key="frame" x="15" y="160" width="123" height="30"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="用户信息标记已读"/>
<connections>
<action selector="enterRoomAction3:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Va6-Dp-FWo"/>
<action selector="readedAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="TG3-vr-mmf"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LAX-tH-pF3">
<rect key="frame" x="195" y="330" width="80" height="30"/>
<color key="backgroundColor" red="0.95065469940000003" green="1" blue="0.2393549422" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<state key="normal" title="大班下载"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="1dp-RW-FhV">
<rect key="frame" x="15" y="125" width="153" height="30"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="获取会话未读消息列表"/>
<connections>
<action selector="downloadAction3:" destination="BYZ-38-t0r" eventType="touchUpInside" id="w7G-rl-s6r"/>
<action selector="noReadListAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="10K-gk-bQ8"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dUU-kM-qiM">
<rect key="frame" x="105" y="330" width="80" height="30"/>
<color key="backgroundColor" red="0.0" green="0.99143940210000003" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<state key="normal" title="大班回放"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="F7y-mH-mpC">
<rect key="frame" x="15" y="195" width="153" height="30"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="获取用户最近会话记录"/>
<connections>
<action selector="playBackAction3:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Vmi-lj-S7k"/>
<action selector="recentVChatAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="3oJ-mA-RCP"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="so4-rI-aRi">
<rect key="frame" x="15" y="365" width="345" height="30"/>
<color key="backgroundColor" red="0.63529411759999999" green="0.51764705879999995" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="FlU-ab-1sz"/>
</constraints>
<color key="tintColor" red="0.63529411759999999" green="0.51764705879999995" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<state key="normal" title="当前为正式环境,点击切换为测试环境">
<color key="titleColor" red="1" green="0.1764705882" blue="0.33333333329999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<state key="selected" title="当前为测试环境,点击切换为正式环境"/>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7fD-Hf-Afy">
<rect key="frame" x="15" y="230" width="153" height="30"/>
<color key="backgroundColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="获取会话历史消息列表"/>
<connections>
<action selector="clickChangeEnvironmentBtnAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="3bs-lx-zXl"/>
<action selector="historyMegListAction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="5oc-rs-t23"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="pjv-b2-iPq" firstAttribute="height" secondItem="RZ3-2O-Iin" secondAttribute="height" id="4lJ-mJ-psu"/>
<constraint firstItem="60L-bR-OE1" firstAttribute="top" secondItem="GT0-B9-RQ5" secondAttribute="bottom" constant="5" id="5jF-p1-60w"/>
<constraint firstItem="CmS-a0-5Ps" firstAttribute="width" secondItem="RZ3-2O-Iin" secondAttribute="width" id="718-9y-FsA"/>
<constraint firstItem="GT0-B9-RQ5" firstAttribute="top" secondItem="HDM-va-7kG" secondAttribute="bottom" constant="5" id="7ee-h4-Js5"/>
<constraint firstAttribute="trailing" secondItem="so4-rI-aRi" secondAttribute="trailing" constant="15" id="83W-xz-1xP"/>
<constraint firstItem="pjv-b2-iPq" firstAttribute="top" secondItem="RZ3-2O-Iin" secondAttribute="top" id="8Ts-hq-Aez"/>
<constraint firstItem="CmS-a0-5Ps" firstAttribute="leading" secondItem="pjv-b2-iPq" secondAttribute="trailing" constant="10" id="9S4-B3-rM7"/>
<constraint firstItem="dUU-kM-qiM" firstAttribute="height" secondItem="Ryi-dE-cYg" secondAttribute="height" id="9og-Ad-UKy"/>
<constraint firstItem="ji1-iU-ZLA" firstAttribute="top" secondItem="27e-O9-DsT" secondAttribute="bottom" constant="10" id="AI6-tq-bz1"/>
<constraint firstItem="so4-rI-aRi" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="15" id="Acv-YJ-6xY"/>
<constraint firstItem="ji1-iU-ZLA" firstAttribute="leading" secondItem="yKv-m4-w6H" secondAttribute="leading" id="CLE-xZ-ENb"/>
<constraint firstItem="27e-O9-DsT" firstAttribute="width" secondItem="hum-Mo-zFX" secondAttribute="width" id="DLw-3V-a1E"/>
<constraint firstItem="BUe-hm-JG9" firstAttribute="top" secondItem="60L-bR-OE1" secondAttribute="bottom" constant="5" id="F9c-fh-EuF"/>
<constraint firstItem="Ryi-dE-cYg" firstAttribute="width" secondItem="A6O-U4-UGr" secondAttribute="width" id="FDS-QF-HYd"/>
<constraint firstItem="pjv-b2-iPq" firstAttribute="width" secondItem="RZ3-2O-Iin" secondAttribute="width" id="FZz-Fu-Yux"/>
<constraint firstItem="RZ3-2O-Iin" firstAttribute="top" secondItem="BUe-hm-JG9" secondAttribute="bottom" constant="5" id="IdV-xo-JpZ"/>
<constraint firstItem="dUU-kM-qiM" firstAttribute="width" secondItem="Ryi-dE-cYg" secondAttribute="width" id="IqZ-Ha-ahL"/>
<constraint firstItem="ji1-iU-ZLA" firstAttribute="trailing" secondItem="yKv-m4-w6H" secondAttribute="trailing" id="Jbl-Df-zM4"/>
<constraint firstItem="RZ3-2O-Iin" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="15" id="L4u-z9-skq"/>
<constraint firstItem="27e-O9-DsT" firstAttribute="top" secondItem="hum-Mo-zFX" secondAttribute="top" id="LPQ-yc-xXF"/>
<constraint firstItem="7fD-Hf-Afy" firstAttribute="top" secondItem="F7y-mH-mpC" secondAttribute="bottom" constant="5" id="3iZ-Fk-2i8"/>
<constraint firstItem="F7y-mH-mpC" firstAttribute="leading" secondItem="TnX-iH-azN" secondAttribute="leading" id="6b7-ni-Ag1"/>
<constraint firstAttribute="trailing" secondItem="so4-rI-aRi" secondAttribute="trailing" id="83W-xz-1xP"/>
<constraint firstItem="1dp-RW-FhV" firstAttribute="top" secondItem="TnX-iH-azN" secondAttribute="bottom" constant="5" id="8dX-xU-6MF"/>
<constraint firstItem="so4-rI-aRi" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="Acv-YJ-6xY"/>
<constraint firstItem="F7y-mH-mpC" firstAttribute="height" secondItem="TnX-iH-azN" secondAttribute="height" id="HV9-jc-VLg"/>
<constraint firstItem="F7y-mH-mpC" firstAttribute="top" secondItem="9JE-Lz-Dma" secondAttribute="bottom" constant="5" id="HdJ-KZ-Mo0"/>
<constraint firstItem="so4-rI-aRi" firstAttribute="top" secondItem="HDM-va-7kG" secondAttribute="bottom" constant="5" id="JGR-v7-Dr6"/>
<constraint firstItem="HDM-va-7kG" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="LVQ-dP-gyt"/>
<constraint firstItem="CmS-a0-5Ps" firstAttribute="top" secondItem="RZ3-2O-Iin" secondAttribute="top" id="Lzh-n3-u5h"/>
<constraint firstItem="Ryi-dE-cYg" firstAttribute="leading" secondItem="A6O-U4-UGr" secondAttribute="leading" id="M83-BA-iNB"/>
<constraint firstItem="A6O-U4-UGr" firstAttribute="height" secondItem="RZ3-2O-Iin" secondAttribute="height" id="MaH-jb-mkY"/>
<constraint firstItem="yKv-m4-w6H" firstAttribute="trailing" secondItem="BUe-hm-JG9" secondAttribute="trailing" id="MuI-sX-Bm6"/>
<constraint firstItem="Ryi-dE-cYg" firstAttribute="top" secondItem="ji1-iU-ZLA" secondAttribute="bottom" constant="5" id="NTc-om-xbo"/>
<constraint firstItem="dUU-kM-qiM" firstAttribute="top" secondItem="Ryi-dE-cYg" secondAttribute="top" id="Odp-4E-dNt"/>
<constraint firstItem="hum-Mo-zFX" firstAttribute="width" secondItem="A6O-U4-UGr" secondAttribute="width" id="On2-ns-dgL"/>
<constraint firstItem="yKv-m4-w6H" firstAttribute="top" secondItem="pjv-b2-iPq" secondAttribute="bottom" constant="10" id="Pha-fy-ofS"/>
<constraint firstItem="A6O-U4-UGr" firstAttribute="width" secondItem="RZ3-2O-Iin" secondAttribute="width" id="S25-OH-w3v"/>
<constraint firstItem="yKv-m4-w6H" firstAttribute="leading" secondItem="BUe-hm-JG9" secondAttribute="leading" id="TCE-SN-9dP"/>
<constraint firstAttribute="trailing" secondItem="AiL-Tl-7G9" secondAttribute="trailing" constant="15" id="VNd-9Q-Xs8"/>
<constraint firstItem="GT0-B9-RQ5" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="15" id="Vdm-B9-tfL"/>
<constraint firstItem="LAX-tH-pF3" firstAttribute="leading" secondItem="dUU-kM-qiM" secondAttribute="trailing" constant="10" id="Vgz-ap-sss"/>
<constraint firstItem="BUe-hm-JG9" firstAttribute="trailing" secondItem="GT0-B9-RQ5" secondAttribute="trailing" id="Vu9-io-1kc"/>
<constraint firstItem="hum-Mo-zFX" firstAttribute="height" secondItem="A6O-U4-UGr" secondAttribute="height" id="Vy6-cE-d3g"/>
<constraint firstItem="hum-Mo-zFX" firstAttribute="top" secondItem="A6O-U4-UGr" secondAttribute="top" id="XGo-vJ-qNq"/>
<constraint firstItem="TnX-iH-azN" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="15" id="UOK-BA-rIV"/>
<constraint firstAttribute="trailing" secondItem="HDM-va-7kG" secondAttribute="trailing" id="YX6-FQ-G4J"/>
<constraint firstItem="60L-bR-OE1" firstAttribute="leading" secondItem="GT0-B9-RQ5" secondAttribute="leading" id="YzX-Yt-FHF"/>
<constraint firstItem="60L-bR-OE1" firstAttribute="trailing" secondItem="GT0-B9-RQ5" secondAttribute="trailing" id="Z5I-sc-C6O"/>
<constraint firstItem="CmS-a0-5Ps" firstAttribute="height" secondItem="RZ3-2O-Iin" secondAttribute="height" id="ZoL-fa-jho"/>
<constraint firstItem="A6O-U4-UGr" firstAttribute="top" secondItem="yKv-m4-w6H" secondAttribute="bottom" constant="5" id="a5l-Ei-bbK"/>
<constraint firstItem="yKv-m4-w6H" firstAttribute="height" secondItem="BUe-hm-JG9" secondAttribute="height" id="cHE-fe-Au1"/>
<constraint firstAttribute="trailing" secondItem="GT0-B9-RQ5" secondAttribute="trailing" constant="15" id="dgb-T9-FSc"/>
<constraint firstItem="ji1-iU-ZLA" firstAttribute="height" secondItem="yKv-m4-w6H" secondAttribute="height" id="ecd-7D-fOM"/>
<constraint firstItem="BUe-hm-JG9" firstAttribute="leading" secondItem="GT0-B9-RQ5" secondAttribute="leading" id="g69-Lr-ETg"/>
<constraint firstItem="A6O-U4-UGr" firstAttribute="leading" secondItem="RZ3-2O-Iin" secondAttribute="leading" id="g9t-sF-u8K"/>
<constraint firstItem="so4-rI-aRi" firstAttribute="top" secondItem="LAX-tH-pF3" secondAttribute="bottom" constant="5" id="gbP-4A-nvp"/>
<constraint firstItem="LAX-tH-pF3" firstAttribute="top" secondItem="dUU-kM-qiM" secondAttribute="top" id="gsS-c4-5Jl"/>
<constraint firstItem="27e-O9-DsT" firstAttribute="leading" secondItem="hum-Mo-zFX" secondAttribute="trailing" constant="10" id="gyD-D2-fza"/>
<constraint firstItem="pjv-b2-iPq" firstAttribute="leading" secondItem="RZ3-2O-Iin" secondAttribute="trailing" constant="10" id="jl9-N9-Ryw"/>
<constraint firstItem="hum-Mo-zFX" firstAttribute="leading" secondItem="A6O-U4-UGr" secondAttribute="trailing" constant="10" id="jp2-Ks-94v"/>
<constraint firstItem="Ryi-dE-cYg" firstAttribute="height" secondItem="A6O-U4-UGr" secondAttribute="height" id="jpu-Tc-TLw"/>
<constraint firstItem="9JE-Lz-Dma" firstAttribute="height" secondItem="TnX-iH-azN" secondAttribute="height" id="fRe-gX-tKo"/>
<constraint firstItem="1dp-RW-FhV" firstAttribute="leading" secondItem="TnX-iH-azN" secondAttribute="leading" id="gpR-z2-ljd"/>
<constraint firstItem="7fD-Hf-Afy" firstAttribute="height" secondItem="TnX-iH-azN" secondAttribute="height" id="j3W-5R-k7D"/>
<constraint firstItem="9JE-Lz-Dma" firstAttribute="leading" secondItem="TnX-iH-azN" secondAttribute="leading" id="kqV-nZ-dh4"/>
<constraint firstItem="HDM-va-7kG" firstAttribute="top" secondItem="a21-3W-10n" secondAttribute="bottom" id="lS8-hA-rmu"/>
<constraint firstItem="AiL-Tl-7G9" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="15" id="mY8-Cu-Dx5"/>
<constraint firstItem="LAX-tH-pF3" firstAttribute="width" secondItem="dUU-kM-qiM" secondAttribute="width" id="n6u-cZ-xDD"/>
<constraint firstItem="LAX-tH-pF3" firstAttribute="height" secondItem="dUU-kM-qiM" secondAttribute="height" id="oOC-eq-7wJ"/>
<constraint firstItem="AiL-Tl-7G9" firstAttribute="top" secondItem="so4-rI-aRi" secondAttribute="bottom" constant="1" id="s88-7x-SBb"/>
<constraint firstItem="dUU-kM-qiM" firstAttribute="leading" secondItem="Ryi-dE-cYg" secondAttribute="trailing" constant="10" id="xo8-nd-nWt"/>
<constraint firstItem="27e-O9-DsT" firstAttribute="height" secondItem="hum-Mo-zFX" secondAttribute="height" id="zZa-aw-otV"/>
<constraint firstItem="7fD-Hf-Afy" firstAttribute="leading" secondItem="TnX-iH-azN" secondAttribute="leading" id="lea-oR-ecV"/>
<constraint firstItem="1dp-RW-FhV" firstAttribute="height" secondItem="TnX-iH-azN" secondAttribute="height" id="pCJ-es-iPl"/>
<constraint firstItem="TnX-iH-azN" firstAttribute="top" secondItem="so4-rI-aRi" secondAttribute="bottom" constant="5" id="pCV-ca-w4c"/>
<constraint firstItem="9JE-Lz-Dma" firstAttribute="top" secondItem="1dp-RW-FhV" secondAttribute="bottom" constant="5" id="xMf-AL-l1H"/>
</constraints>
</view>
<connections>
<outlet property="changeEnvironmentBtn" destination="so4-rI-aRi" id="ong-vG-zJ6"/>
<outlet property="downLoadBtn" destination="CmS-a0-5Ps" id="WnG-U6-5Us"/>
<outlet property="downLoadBtn2" destination="27e-O9-DsT" id="3aL-Hw-CdZ"/>
<outlet property="downLoadBtn3" destination="LAX-tH-pF3" id="oCw-OI-RiL"/>
<outlet property="enterRoomBtn" destination="RZ3-2O-Iin" id="rS3-Zw-S9B"/>
<outlet property="enterRoomBtn2" destination="A6O-U4-UGr" id="hty-a8-Odf"/>
<outlet property="enterRoomBtn3" destination="Ryi-dE-cYg" id="orB-TO-QsR"/>
<outlet property="koulingTextField" destination="BUe-hm-JG9" id="Dq2-2W-R41"/>
<outlet property="koulingTextField2" destination="yKv-m4-w6H" id="ZGW-k1-789"/>
<outlet property="koulingTextField3" destination="ji1-iU-ZLA" id="5SE-lf-e8p"/>
<outlet property="nameTextField" destination="GT0-B9-RQ5" id="RnI-Yg-hb5"/>
<outlet property="playBackBtn" destination="pjv-b2-iPq" id="3Gn-xw-QpA"/>
<outlet property="playBackBtn2" destination="hum-Mo-zFX" id="fWA-nJ-C8x"/>
<outlet property="playBackBtn3" destination="dUU-kM-qiM" id="iOd-Q4-nxu"/>
<outlet property="uuidTextField" destination="60L-bR-OE1" id="bHN-Ij-ANe"/>
<outlet property="versionLab" destination="AiL-Tl-7G9" id="UBb-Js-N2V"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
......
//
//
//
// ConfigrationNetwork.h
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/7/25.
// Copyright © 2018年 中公教育. All rights reserved.
......@@ -10,41 +10,22 @@
#define ConfigrationNetwork_h
//默认大班课开发模式接口
#define DEV_BASEURL @"https://live.offcncloud.com/"
#define DEV_BASEURL @"http://im.offcncloud.com:8080"
#define DEV_IMAGEBASEURL @""
#define DEV_h5live @"https://h5live.offcncloud.com/"
#define DEV_call_server_topic @"rtc.offcncloud.com"
#define DEV_h5live @""
#define DEV_call_server_topic @""
//默认大班课测试模式接口
#define TEST_BASEURL @"http://test-live.offcncloud.com/"
#define TEST_BASEURL @"http://test-im.offcncloud.com:8080"
#define TEST_IMAGEBASEURL @""
#define TEST_h5live @"http://test-h5live.offcncloud.com/"
#define TEST_call_server_topic @"test-rtc.offcncloud.com"
#define TEST_h5live @""
#define TEST_call_server_topic @""
//默认大班课生产模式接口
#define PRO_BASEURL @"https://live.offcncloud.com/"
#define PRO_BASEURL @"http://im.offcncloud.com:8080"
#define PRO_IMAGEBASEURL @""
#define PRO_h5live @"https://h5live.offcncloud.com/"
#define PRO_call_server_topic @"rtc.offcncloud.com"
//小班课开发模式接口
#define DEV_BASEURL_SMALLCLASS @"https://api.live.offcncloud.com/"
#define DEV_IMAGEBASEURL_SMALLCLASS @""
#define DEV_h5live_SMALLCLASS @"https://api.h5live.offcncloud.com/"
#define DEV_call_server_topic_SMALLCLASS @"rtc.smallroom.offcncloud.com"
//小班课测试模式接口
#define TEST_BASEURL_SMALLCLASS @"http://test-api.live.offcncloud.com/"
#define TEST_IMAGEBASEURL_SMALLCLASS @""
#define TEST_h5live_SMALLCLASS @"http://test-api.h5live.offcncloud.com/"
#define TEST_call_server_topic_SMALLCLASS @"test-rtc.smallroom.offcncloud.com"
//小班课生产模式接口
#define PRO_BASEURL_SMALLCLASS @"https://api.live.offcncloud.com/"
#define PRO_IMAGEBASEURL_SMALLCLASS @""
#define PRO_h5live_SMALLCLASS @"https://api.h5live.offcncloud.com/"
#define PRO_call_server_topic_SMALLCLASS @"rtc.smallroom.offcncloud.com"
#define PRO_h5live @""
#define PRO_call_server_topic @""
//切换连麦call_server_topic
......@@ -57,17 +38,21 @@
#define BASE_H5_URL [OffcnBaseNetworking get_h5live]
#define BASE_URL [NSString stringWithFormat:@"%@api/v1/",BASE_DOMAIN_URL]
#define BASE_USER_URL [NSString stringWithFormat:@"%@api/user/",BASE_DOMAIN_URL]
#define BASE_URL [NSString stringWithFormat:@"%@/v1/",BASE_DOMAIN_URL]
#define BASE_USER_URL [NSString stringWithFormat:@"%@/user/",BASE_DOMAIN_URL]
#define HTTPS_IMAGEBASEURL @""
#pragma mark - 二级API
//客户端登陆
//#define LoginURL [NSString stringWithFormat:@"%@users",BASE_URL]
//回放拉流
//#define PlaybackPullURL [NSString stringWithFormat:@"%@on_demand",BASE_USER_URL]
//发送消息
#define sendMsgURL [NSString stringWithFormat:@"%@sendMsg",BASE_URL]
//用户信息标记已读
#define markMsgReadURL [NSString stringWithFormat:@"%@markMsgRead",BASE_URL]
//获取会话未读消息列表
#define getSessionUnreadMsgURL [NSString stringWithFormat:@"%@getSessionUnreadMsg",BASE_URL]
//获取用户最近会话记录
#define getRecentSessionsURL [NSString stringWithFormat:@"%@getRecentSessions",BASE_URL]
//获取会话历史消息列表
#define getSessionHistoryMsgURL [NSString stringWithFormat:@"%@getSessionHistoryMsg",BASE_URL]
#endif /* ConfigrationNetwork_h */
//
// SDEnum.h
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/8/13.
// Copyright © 2018年 中公教育. All rights reserved.
......
//
//
......@@ -20,7 +20,8 @@ fprintf(stderr, "-------\n"); \
#define NSLog(FORMAT, ...)
#endif
#define KCustomerAPPKEY @""
#define KCustomerAPPKEY @"offcn_live"
#define KCustomerSecre @"offcn_im"
#pragma mark - 尺寸所有宏
......@@ -54,9 +55,9 @@ fprintf(stderr, "-------\n"); \
#define KSetFont(size) [UIFont systemFontOfSize:size]
#define KImageNamed(name) [UIImage imageNamed:[NSString stringWithFormat:@"OffcnLiveSDK.bundle/%@",name]]
#define KImageNamed(name) [UIImage imageNamed:[NSString stringWithFormat:@"OffcnIMSDKiOS.bundle/%@",name]]
#define KEmojiImageNamed(name) [UIImage imageNamed:[NSString stringWithFormat:@"OffcnLiveSDK.bundle/emoji/%@",name]]
#define KEmojiImageNamed(name) [UIImage imageNamed:[NSString stringWithFormat:@"OffcnIMSDKiOS.bundle/emoji/%@",name]]
#define KWeakSelf __weak typeof(self) weakSelf = self;
......
//
//
//
// SDKeyBoard.h
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/9/6.
// Copyright © 2018年 中公教育. All rights reserved.
......
//
//
// OffcnIMSDKiOS.h
// OffcnIMSDKiOS
//
// Created by vockey on 2018/10/16.
// Copyright © 2018年 中公教育. All rights reserved.
//
#import <UIKit/UIKit.h>
static const NSString *OffcnIMSDKiOSVersion = @"1.0.0.0";
typedef NS_ENUM(NSUInteger, OffcnSDKReachabilityStatus) {
OffcnSDKReachabilityStatusNotReachable = 0,
OffcnSDKReachabilityStatusViaWWAN,
OffcnSDKReachabilityStatusViaWiFi,
};
typedef NS_ENUM(NSUInteger, OffcnSDKMsgType) {
OffcnSDKMsgTypeText = 1, //文本消息
OffcnSDKMsgTypePicture, //图片消息
OffcnSDKMsgTypeAudio, //音频消息
OffcnSDKMsgTypeVideo, //视频消息
OffcnSDKMsgTypeFile, //文件消息
};
typedef NS_ENUM(NSUInteger, OffcnSDKMsgScope) {
OffcnSDKMsgScopeSingleChat = 1, //单聊消息
OffcnSDKMsgScopeGroupChat, //群聊消息
};
typedef NS_ENUM(NSUInteger, OffcnSDKType) {
OffcnSDKTypeIM = 1, //IM 消息
};
//网络监听回调
typedef void(^OffcnSDKReachabilityStatusCallBack)(OffcnSDKReachabilityStatus status);
@interface OffcnIMSDKiOS : NSObject
//返回单例对象
+ (OffcnIMSDKiOS *)defaultService;
//是否选用测试环境
@property (nonatomic, assign) BOOL isTest;
@property (nonatomic, assign) OffcnSDKReachabilityStatus OffcnReachabilityStatus;
@property (nonatomic, copy) OffcnSDKReachabilityStatusCallBack reachabilityStatusCallBack;
//监听网络状态
-(void)startNotifierUseRealReachability;
@end
//
//
// OffcnIMSDKiOS.m
// OffcnIMSDKiOS
//
// Created by vockey on 2018/10/16.
// Copyright © 2018年 中公教育. All rights reserved.
//
#import "OffcnIMSDKiOS.h"
#import "OffcnBaseNetworking.h"
#import "ZYJRealReachability.h"
#import "SDGeneralDefine.h"
#import "OffcnNetworkExecutor.h"
@interface OffcnIMSDKiOS ()
@end
@implementation OffcnIMSDKiOS
static OffcnIMSDKiOS *liveTelecastSDK;
+ (OffcnIMSDKiOS *)defaultService{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
liveTelecastSDK = [[OffcnIMSDKiOS alloc] init];
});
return liveTelecastSDK;
}
-(void)setIsTest:(BOOL)isTest{
if (isTest) {
[[OffcnBaseNetworking sharedInstance] setServiceType:2];
}else{
[[OffcnBaseNetworking sharedInstance] setServiceType:3];
}
_isTest = isTest;
}
#pragma mark - 使用RealReachability监听网络状态
-(void)startNotifierUseRealReachability{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(networkChanged:) name:ZYJkRealReachabilityChangedNotification object:nil];
GLobalRealReachability.hostForPing = @"api.live.offcncloud.com";
GLobalRealReachability.pingTimeout = 10;
[GLobalRealReachability startNotifier];
ReachabilityStatus status = [GLobalRealReachability currentReachabilityStatus];
[self realNetworkingStatus:status];
}
- (void)networkChanged:(NSNotification *)notification
{
ZYJRealReachability *reachability= (ZYJRealReachability *)notification.object;
ReachabilityStatus status= [reachability currentReachabilityStatus];
[self realNetworkingStatus:status];
}
-(void)realNetworkingStatus:(ReachabilityStatus)status{
KWeakSelf
switch (status){
case RealStatusUnknown:
case RealStatusNotReachable:
{
[OffcnNetworkExecutor requesImgJsonWithUrlStr:@"https://api.live.offcncloud.com" Finished:^(BOOL success, id response, NSString *message) {
if (success) {
weakSelf.OffcnReachabilityStatus = OffcnSDKReachabilityStatusViaWiFi;
if (weakSelf.reachabilityStatusCallBack) {
weakSelf.reachabilityStatusCallBack(OffcnSDKReachabilityStatusViaWiFi);
}
}else{
weakSelf.OffcnReachabilityStatus = OffcnSDKReachabilityStatusNotReachable;
if (weakSelf.reachabilityStatusCallBack) {
weakSelf.reachabilityStatusCallBack(OffcnSDKReachabilityStatusNotReachable);
}
}
}];
break;
}
case RealStatusViaWWAN:
{
self.OffcnReachabilityStatus = OffcnSDKReachabilityStatusViaWWAN;
if (self.reachabilityStatusCallBack) {
self.reachabilityStatusCallBack(OffcnSDKReachabilityStatusViaWWAN);
}
break;
}
case RealStatusViaWiFi:
{
self.OffcnReachabilityStatus = OffcnSDKReachabilityStatusViaWiFi;
if (self.reachabilityStatusCallBack) {
self.reachabilityStatusCallBack(OffcnSDKReachabilityStatusViaWiFi);
}
break;
}
default:
break;
}
}
-(void)dealloc{
}
@end
......@@ -2,6 +2,11 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
......
//
//
//
// NSAttributedString+SDSize.h
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/8/23.
// Copyright © 2018年 中公教育. All rights reserved.
......
//
// NSAttributedString+SDSize.m
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/8/23.
// Copyright © 2018年 中公教育. All rights reserved.
......
//
//
//
// NSMutableAttributedString+SDSize.h
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/8/23.
// Copyright © 2018年 中公教育. All rights reserved.
......
//
//
//
// NSMutableAttributedString+SDSize.m
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/8/23.
// Copyright © 2018年 中公教育. All rights reserved.
......
//
//
//
// SDButton.h
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/7/31.
// Copyright © 2018年 中公教育. All rights reserved.
......
//
//
//
// SDButton.m
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/7/31.
// Copyright © 2018年 中公教育. All rights reserved.
......
//
//
//
// SDLabel.h
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/8/8.
// Copyright © 2018年 中公教育. All rights reserved.
......
//
// SDLabel.m
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/8/8.
// Copyright © 2018年 中公教育. All rights reserved.
......
//
//
//
// OffcnToast.h
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2019/4/9.
// Copyright © 2019年 中公教育. All rights reserved.
......
//
//
//
// OffcnToast.m
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2019/4/9.
// Copyright © 2019年 中公教育. All rights reserved.
......
//
//
......@@ -35,6 +35,10 @@
+(NSString*)getAllCurrentTimes;
//获取当前时间戳(以毫秒为单位)
+(NSString *)getNowTimeTimestampMillisecond;
//获取当前时间戳(以秒为单位)
+(NSString *)getNowSSTimeTimestamp;
//获取当前时间戳(以毫秒为单位)
+(NSString *)getNowSSSTimeTimestamp;
+(NSString *)getHHTimeWithSeconds:(NSTimeInterval)s;
......@@ -67,4 +71,7 @@
+(NSString *)getGMTTimestamp;
//隐藏手机号
+(NSString *)hidNameWithStr:(NSString *)str;
//普通字符串转换为十六进制的
+(NSString *)hexStringFromString:(NSString *)string;
@end
//
//
......@@ -256,7 +256,7 @@
[format setDateFormat:@"yyyy-MM-dd"];
return [format stringFromDate:date];
}
//获取当前时间(以毫秒为单位)
//获取当前时间(以毫秒为单位)
+(NSString *)getNowTimeTimestampMillisecond{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
......@@ -303,6 +303,33 @@
NSInteger timeSp = [[NSNumber numberWithDouble:[date timeIntervalSince1970]] integerValue];
return timeSp;
}
//获取当前时间戳(以秒为单位)
+(NSString *)getNowSSTimeTimestamp{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateStyle:NSDateFormatterMediumStyle];
[formatter setTimeStyle:NSDateFormatterShortStyle];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; //
NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"];
[formatter setTimeZone:timeZone];
NSDate *datenow = [NSDate date];
NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)[datenow timeIntervalSince1970]];
return timeSp;
}
//获取当前时间戳(以毫秒为单位)
+(NSString *)getNowSSSTimeTimestamp{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateStyle:NSDateFormatterMediumStyle];
[formatter setTimeStyle:NSDateFormatterShortStyle];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss SSS"]; //
NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Beijing"];
[formatter setTimeZone:timeZone];
NSDate *datenow = [NSDate date];
NSString *timeSp = [NSString stringWithFormat:@"%ld", (long)([datenow timeIntervalSince1970]*1000)];
return timeSp;
}
#pragma mark 获取系统开机时间到1970时间差值
+(double)getLaunchSystemTime{
NSTimeInterval sysTime = [NSProcessInfo processInfo].systemUptime;
......@@ -364,4 +391,21 @@
return str;
}
//普通字符串转换为十六进制的
+(NSString *)hexStringFromString:(NSString *)string{
NSData *myD = [string dataUsingEncoding:NSUTF8StringEncoding];
Byte *bytes = (Byte *)[myD bytes];
//下面是Byte 转换为16进制。
NSString *hexStr = @"";
for(int i=0;i<[myD length];i++){
NSString *newHexStr = [NSString stringWithFormat:@"%x",bytes[i]&0xff];///16进制数
if([newHexStr length]==1){
hexStr = [NSString stringWithFormat:@"%@0%@",hexStr,newHexStr];
}else{
hexStr = [NSString stringWithFormat:@"%@%@",hexStr,newHexStr];
}
}
return hexStr;
}
@end
//
//
//
// OffcnBaseNetworking.h
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/7/25.
// Copyright © 2018年 中公教育. All rights reserved.
......
//
//
//
// OffcnBaseNetworking.m
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/7/25.
// Copyright © 2018年 中公教育. All rights reserved.
......@@ -13,6 +13,8 @@
#import "SDGeneralTool.h"
#import "SDConfigrationNetwork.h"
#import "ZYJMJExtension.h"
#import "SDGeneralDefine.h"
#import "ZYJOSSUtil.h"
static OffcnBaseNetworking *baseNetWorkApi;
......@@ -31,37 +33,37 @@ static OffcnBaseNetworking *baseNetWorkApi;
+(NSString *)get_BASEURL{
NSInteger type = [OffcnBaseNetworking sharedInstance].serviceType;
if (type == 1) {
return DEV_BASEURL_SMALLCLASS;
return DEV_BASEURL;
}else if (type == 2) {
return TEST_BASEURL_SMALLCLASS;
return TEST_BASEURL;
}else if (type == 3) {
return PRO_BASEURL_SMALLCLASS;
return PRO_BASEURL;
}
return PRO_BASEURL_SMALLCLASS;
return PRO_BASEURL;
}
//h5服务器
+(NSString *)get_h5live{
NSInteger type = [OffcnBaseNetworking sharedInstance].serviceType;
if (type == 1) {
return DEV_h5live_SMALLCLASS;
return DEV_h5live;
}else if (type == 2) {
return TEST_h5live_SMALLCLASS;
return TEST_h5live;
}else if (type == 3) {
return PRO_h5live_SMALLCLASS;
return PRO_h5live;
}
return PRO_h5live_SMALLCLASS;
return PRO_h5live;
}
//call_server_topic服务器
+(NSString *)get_call_server_topic{
NSInteger type = [OffcnBaseNetworking sharedInstance].serviceType;
if (type == 1) {
return DEV_call_server_topic_SMALLCLASS;
return DEV_call_server_topic;
}else if (type == 2) {
return TEST_call_server_topic_SMALLCLASS;
return TEST_call_server_topic;
}else if (type == 3) {
return PRO_call_server_topic_SMALLCLASS;
return PRO_call_server_topic;
}
return PRO_call_server_topic_SMALLCLASS;
return PRO_call_server_topic;
}
//图片服务器
+(NSString *)get_ImageBaseUrl{
......@@ -202,22 +204,35 @@ static OffcnBaseNetworking *baseNetWorkApi;
}
+ (void)setHttpCommonHeader:(ZYJAFHTTPSessionManager *)manager{
// [manager.requestSerializer setValue:XiaoHongMaoAPPKEY forHTTPHeaderField:@"phoneKey"];
[manager.requestSerializer setValue:@"ZgLiveStudent" forHTTPHeaderField:@"zgl-clienttype"];
[manager.requestSerializer setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] forHTTPHeaderField:@"zgl-clientversion"];
[manager.requestSerializer setValue:@"iOS" forHTTPHeaderField:@"zgl-systemtype"];
NSString *systemString = [NSString stringWithFormat:@"%@",[UIDevice currentDevice].systemVersion];
[manager.requestSerializer setValue:systemString forHTTPHeaderField:@"zgl-systemversion"];
[manager.requestSerializer setValue:[UIDevice currentDevice].identifierForVendor.UUIDString forHTTPHeaderField:@"zgl-phonekey"];
[manager.requestSerializer setValue:[SDGeneralTool deviceVersion] forHTTPHeaderField:@"zgl-phonetype"];
NSString *screenString = [NSString stringWithFormat:@"%.0fx%.0f",[UIScreen mainScreen].bounds.size.width * [UIScreen mainScreen].scale,[UIScreen mainScreen].bounds.size.height * [UIScreen mainScreen].scale];
[manager.requestSerializer setValue:screenString forHTTPHeaderField:@"zgl-resolution"];
if ([OffcnBaseNetworking sharedInstance].token.length) {
[manager.requestSerializer setValue:[OffcnBaseNetworking sharedInstance].token forHTTPHeaderField:@"Authorization"];
}else{
[manager.requestSerializer setValue:@"" forHTTPHeaderField:@"Authorization"];
}
[manager.requestSerializer setValue:KCustomerAPPKEY forHTTPHeaderField:@"appkey"];
//随机数(最大长度128个字符)
NSString *nonceStr = [SDGeneralTool getNowSSSTimeTimestamp];
[manager.requestSerializer setValue:nonceStr forHTTPHeaderField:@"nonce"];
//当前UTC时间戳,从1970年1月1日0点0 分0 秒开始到现在的秒数(String)
NSString *curtimeStr = [SDGeneralTool getNowSSTimeTimestamp];
[manager.requestSerializer setValue:curtimeStr forHTTPHeaderField:@"curtime"];
//SHA1(AppSecret + Nonce + CurTime),三个参数拼接的字符串,进行SHA1哈希计算,转化成16进制字符(String,小写)
NSString *margeStr = [NSString stringWithFormat:@"%@%@%@",KCustomerSecre,nonceStr,curtimeStr];
NSString *checksumStr = [ZYJOSSUtil sha1WithString:margeStr];
checksumStr = [[SDGeneralTool hexStringFromString:checksumStr] lowercaseString];
[manager.requestSerializer setValue:checksumStr forHTTPHeaderField:@"checksum"];
// [manager.requestSerializer setValue:@"ZgLiveStudent" forHTTPHeaderField:@"zgl-clienttype"];
// [manager.requestSerializer setValue:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"] forHTTPHeaderField:@"zgl-clientversion"];
// [manager.requestSerializer setValue:@"iOS" forHTTPHeaderField:@"zgl-systemtype"];
// NSString *systemString = [NSString stringWithFormat:@"%@",[UIDevice currentDevice].systemVersion];
// [manager.requestSerializer setValue:systemString forHTTPHeaderField:@"zgl-systemversion"];
// [manager.requestSerializer setValue:[UIDevice currentDevice].identifierForVendor.UUIDString forHTTPHeaderField:@"zgl-phonekey"];
// [manager.requestSerializer setValue:[SDGeneralTool deviceVersion] forHTTPHeaderField:@"zgl-phonetype"];
// NSString *screenString = [NSString stringWithFormat:@"%.0fx%.0f",[UIScreen mainScreen].bounds.size.width * [UIScreen mainScreen].scale,[UIScreen mainScreen].bounds.size.height * [UIScreen mainScreen].scale];
// [manager.requestSerializer setValue:screenString forHTTPHeaderField:@"zgl-resolution"];
// if ([OffcnBaseNetworking sharedInstance].token.length) {
// [manager.requestSerializer setValue:[OffcnBaseNetworking sharedInstance].token forHTTPHeaderField:@"Authorization"];
// }else{
// [manager.requestSerializer setValue:@"" forHTTPHeaderField:@"Authorization"];
// }
}
- (ZYJAFHTTPSessionManager *)manager
......
//
//
//
// OffcnNetworkExecutor.h
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/7/25.
// Copyright © 2018年 中公教育. All rights reserved.
......@@ -12,13 +12,19 @@
@interface OffcnNetworkExecutor : NSObject
+ (void)cancelAllOperations;
//客户端登陆
//+ (void)requestLoginWithPassword:(NSString *)password nickname:(NSString *)nickname hook:(NSString *)hook extensionDic:(NSDictionary *)extensionDic Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished;
//检测房间是否启录制
//+ (void)requestPlaybackRecordCheckWithAccount:(NSString *)account Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished;
//获取图片json
//+ (void)requesImgJsonWithUrlStr:(NSString *)urlStr Finished:(void(^)(BOOL success,id response,NSString *message))finished;
//sendAsynchronousRequest
+ (void)requesImgJsonWithUrlStr:(NSString *)urlStr Finished:(void(^)(BOOL success,id response,NSString *message))finished;
//发送消息
+ (void)requestSendMsgWithMsg_fromID:(NSString *)msg_fromID msg_toID:(NSString *)msg_toID msg_type:(NSInteger)msg_type msg:(NSMutableDictionary *)msgDic Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished;
//用户信息标记已读
+ (void)requestMarkMsgReadWithMsg_fromID:(NSString *)msg_fromID msg_toID:(NSString *)msg_toID Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished;
//获取会话未读消息列表
+ (void)requestGetSessionUnreadMsgWithFromID:(NSString *)fromID toID:(NSString *)toID Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished;
//获取用户最近会话记录
+ (void)requestGetRecentSessionsWithAccid:(NSString *)accid Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished;
//获取会话历史消息列表
+ (void)requestGetSessionHistoryMsgWithFromID:(NSString *)fromID toID:(NSString *)toID msg_seq:(NSString *)msg_seq Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished;
......
//
//
//
// OffcnNetworkExecutor.m
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/7/25.
// Copyright © 2018年 中公教育. All rights reserved.
......@@ -14,71 +14,405 @@
+ (void)cancelAllOperations{
[[OffcnBaseNetworking sharedInstance] cancelAllOperations];
}
//客户端登陆
//+ (void)requestLoginWithPassword:(NSString *)password nickname:(NSString *)nickname hook:(NSString *)hook extensionDic:(NSDictionary *)extensionDic Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished{
//
// NSMutableDictionary *dic = [NSMutableDictionary dictionary];
// password = [password stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
// [dic setObjectOnSafe:password forKey:@"password"];
// [dic setObjectOnSafe:nickname forKey:@"nickname"];
// [dic setObjectOnSafe:hook forKey:@"hook"];
//
// if (extensionDic && [extensionDic allKeys].count) {
// [extensionDic enumerateKeysAndObjectsUsingBlock:^(NSString *key, id _Nonnull obj, BOOL * _Nonnull stop) {
// if ([key isEqualToString:@"password"] || [key isEqualToString:@"nickname"] || [key isEqualToString:@"uuid"]) {
//
// }else{
// [dic setObjectOnSafe:obj forKey:key];
// }
// }];
// }
//
// [OffcnBaseNetworking postToURL:LoginURL bodyParams:dic finished:^(BaseResponse *baseResponse) {
// if (baseResponse.isSuccess) {
//
// finished(YES,baseResponse.responseObject,nil);
// }else{
//
// finished(NO,nil,baseResponse);
// }
// }];
//}
//检测房间是否启录制
//+ (void)requestPlaybackRecordCheckWithAccount:(NSString *)account Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished{
//
// NSString *url = [NSString stringWithFormat:@"%@%@",Record_check,account];
// [OffcnBaseNetworking getFromURL:url params:nil finished:^(BaseResponse *baseResponse) {
// if (baseResponse.isSuccess) {
// finished(YES,baseResponse.responseObject,nil);
// }else{
// finished(NO,nil,baseResponse);
//sendAsynchronousRequest
+ (void)requesImgJsonWithUrlStr:(NSString *)urlStr Finished:(void(^)(BOOL success,id response,NSString *message))finished{
NSURL *url = [NSURL URLWithString:urlStr];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse * _Nullable response, NSData * _Nullable data, NSError * _Nullable connectionError) {
if (!connectionError) {
if (!data) {
data = [NSData data];
}
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
finished(YES,dic,nil);
}else{
finished(NO,nil,connectionError.localizedDescription);
}
}];
}
//发送消息
+ (void)requestSendMsgWithMsg_fromID:(NSString *)msg_fromID msg_toID:(NSString *)msg_toID msg_type:(NSInteger)msg_type msg:(NSMutableDictionary *)msgDic Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished{
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
[dic setObjectOnSafe:msg_fromID forKey:@"msg_from"];
[dic setObjectOnSafe:msg_toID forKey:@"msg_to"];
[dic setObjectOnSafe:[NSNumber numberWithInteger:msg_type] forKey:@"msg_type"];
[dic setObjectOnSafe:msgDic forKey:@"msg"];
[OffcnBaseNetworking postToURL:sendMsgURL bodyParams:dic finished:^(BaseResponse *baseResponse) {
if (baseResponse.isSuccess) {
finished(YES,baseResponse.responseObject,nil);
}else{
finished(NO,nil,baseResponse);
}
}];
}
//用户信息标记已读
+ (void)requestMarkMsgReadWithMsg_fromID:(NSString *)msg_fromID msg_toID:(NSString *)msg_toID Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished{
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
[dic setObjectOnSafe:msg_fromID forKey:@"msg_from"];
[dic setObjectOnSafe:msg_toID forKey:@"msg_to"];
[OffcnBaseNetworking postToURL:markMsgReadURL bodyParams:dic finished:^(BaseResponse *baseResponse) {
if (baseResponse.isSuccess) {
finished(YES,baseResponse.responseObject,nil);
}else{
finished(NO,nil,baseResponse);
}
}];
}
//{
// "msg_list" = (
// {
// msg = {
// msg = "\U6211\U662f\U4e00\U53ea\U5c0f\U9752\U9f99";
// };
// "msg_from" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_id" = "13e266f3-e139-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597744585;
// "msg_to" = jfdfjei0343;
// "msg_type" = 1;
// "send_time" = "2020-08-18 17:56:25";
// },
// {
// msg = {
// msg = "\U6211\U662f\U4e00\U53ea\U5c0f\U9752\U9f99";
// };
// "msg_from" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_id" = "85eb12d1-e13b-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597745635;
// "msg_to" = jfdfjei0343;
// "msg_type" = 1;
// "send_time" = "2020-08-18 18:13:55";
// }
// }];
// );
//}
//获取图片json
//+ (void)requesImgJsonWithUrlStr:(NSString *)urlStr Finished:(void(^)(BOOL success,id response,NSString *message))finished{
//
// NSURL *url = [NSURL URLWithString:urlStr];
// NSURLRequest *request = [NSURLRequest requestWithURL:url];
// [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse * _Nullable response, NSData * _Nullable data, NSError * _Nullable connectionError) {
//
// if (!connectionError) {
// if (!data) {
// data = [NSData data];
// }
// NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
// finished(YES,dic,nil);
// }else{
// finished(NO,nil,connectionError.localizedDescription);
//获取会话未读消息列表
+ (void)requestGetSessionUnreadMsgWithFromID:(NSString *)fromID toID:(NSString *)toID Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished{
NSString *url = [NSString stringWithFormat:@"%@?from=%@&to=%@",getSessionUnreadMsgURL,fromID,toID];
[OffcnBaseNetworking getFromURL:url params:nil finished:^(BaseResponse *baseResponse) {
if (baseResponse.isSuccess) {
finished(YES,baseResponse.responseObject,nil);
}else{
finished(NO,nil,baseResponse);
}
}];
}
//{
// sessions = (
// {
// "last_msg" = {
// "msg_content" = {
// msg = "\U6211\U662f\U4e00\U53ea\U5c0f\U9752\U9f99";
// };
// "msg_type" = 1;
// "send_time" = "2020-08-18 17:48:09";
// };
// "session_id" = "a05517f0-ddec-11ea-88a4-4a5555fb6ab4";
// to = jfdfjei0343;
// type = 1;
// "unread_number" = 11;
// },
// {
// "last_msg" = {
// "msg_content" = {
// msg = 94563;
// };
// "msg_type" = 1;
// "send_time" = "2020-08-17 13:44:47";
// };
// "session_id" = "a4cccd4e-e04c-11ea-88a4-4a5555fb6ab4";
// to = 11;
// type = 1;
// "unread_number" = 2;
// },
// {
// "last_msg" = {
// "msg_content" = {
// msg = "\U4f60\U597d";
// };
// "msg_type" = 1;
// "send_time" = "2020-08-14 13:11:36";
// };
// "session_id" = "a0650499-ddec-11ea-88a4-4a5555fb6ab4";
// to = jfdfjei0343;
// type = 1;
// "unread_number" = 1;
// },
// {
// "last_msg" = {
// "msg_content" = {
// msg = "\U4f60\U597d";
// };
// "msg_type" = 1;
// "send_time" = "2020-08-14 13:11:36";
// };
// "session_id" = "a082dc37-ddec-11ea-88a4-4a5555fb6ab4";
// to = jfdfjei0343;
// type = 1;
// "unread_number" = 1;
// },
// {
// "last_msg" = {
// "msg_content" = {
// msg = "\U4f60\U597d";
// };
// "msg_type" = 1;
// "send_time" = "2020-08-14 13:11:37";
// };
// "session_id" = "a073155b-ddec-11ea-88a4-4a5555fb6ab4";
// to = jfdfjei0343;
// type = 1;
// "unread_number" = 1;
// },
// {
// "last_msg" = {
// "msg_content" = {
// msg = "\U4f60\U597d";
// };
// "msg_type" = 1;
// "send_time" = "2020-08-14 13:11:37";
// };
// "session_id" = "a073b3a6-ddec-11ea-88a4-4a5555fb6ab4";
// to = jfdfjei0343;
// type = 1;
// "unread_number" = 1;
// }
// }];
// );
//}
//获取用户最近会话记录
+ (void)requestGetRecentSessionsWithAccid:(NSString *)accid Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished{
NSString *url = [NSString stringWithFormat:@"%@?accid=%@",getRecentSessionsURL,accid];
[OffcnBaseNetworking getFromURL:url params:nil finished:^(BaseResponse *baseResponse) {
if (baseResponse.isSuccess) {
finished(YES,baseResponse.responseObject,nil);
}else{
finished(NO,nil,baseResponse);
}
}];
}
//获取会话历史消息列表
+ (void)requestGetSessionHistoryMsgWithFromID:(NSString *)fromID toID:(NSString *)toID msg_seq:(NSString *)msg_seq Finished:(void(^)(BOOL success,id response,BaseResponse *baseResponse))finished{
NSString *url = [NSString stringWithFormat:@"%@?from=%@&to=%@&msg_seq=%@",getSessionHistoryMsgURL,fromID,toID,msg_seq];
[OffcnBaseNetworking getFromURL:url params:nil finished:^(BaseResponse *baseResponse) {
if (baseResponse.isSuccess) {
finished(YES,baseResponse.responseObject,nil);
}else{
finished(NO,nil,baseResponse);
}
}];
}
@end
//{
// "msg_list" = (
// {
// msg = {
// msg = "\U4f60\U597d";
// };
// "msg_from" = jfdfjei0343;
// "msg_id" = "a0c76912-ddec-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597381897;
// "msg_to" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_type" = 1;
// "send_time" = "2020-08-14 13:11:36";
// },
// {
// msg = {
// msg = 8025;
// };
// "msg_from" = jfdfjei0343;
// "msg_id" = "f9ed87ec-e04f-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597644468;
// "msg_to" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_type" = 1;
// "send_time" = "2020-08-17 14:07:48";
// },
// {
// msg = {
// msg = 83443;
// };
// "msg_from" = jfdfjei0343;
// "msg_id" = "07a48919-e053-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597645780;
// "msg_to" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_type" = 1;
// "send_time" = "2020-08-17 14:29:40";
// },
// {
// msg = {
// msg = 43394;
// };
// "msg_from" = jfdfjei0343;
// "msg_id" = "1b450a3d-e053-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597645813;
// "msg_to" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_type" = 1;
// "send_time" = "2020-08-17 14:30:13";
// },
// {
// msg = {
// msg = 43887;
// };
// "msg_from" = jfdfjei0343;
// "msg_id" = "221b33cc-e053-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597645824;
// "msg_to" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_type" = 1;
// "send_time" = "2020-08-17 14:30:24";
// },
// {
// msg = {
// msg = 84730;
// };
// "msg_from" = jfdfjei0343;
// "msg_id" = "4bf86940-e053-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597645895;
// "msg_to" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_type" = 1;
// "send_time" = "2020-08-17 14:31:34";
// },
// {
// msg = {
// msg = 29875;
// };
// "msg_from" = jfdfjei0343;
// "msg_id" = "4efc6485-e053-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597645900;
// "msg_to" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_type" = 1;
// "send_time" = "2020-08-17 14:31:40";
// },
// {
// msg = {
// msg = 15702;
// };
// "msg_from" = jfdfjei0343;
// "msg_id" = "1cc40899-e055-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597646674;
// "msg_to" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_type" = 1;
// "send_time" = "2020-08-17 14:44:34";
// },
// {
// msg = {
// msg = 71562;
// };
// "msg_from" = jfdfjei0343;
// "msg_id" = "d4b1a5ec-e05b-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597649560;
// "msg_to" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_type" = 1;
// "send_time" = "2020-08-17 15:32:40";
// },
// {
// msg = {
// msg = 9505;
// };
// "msg_from" = jfdfjei0343;
// "msg_id" = "cc398ec9-e05c-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597649975;
// "msg_to" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_type" = 1;
// "send_time" = "2020-08-17 15:39:35";
// },
// {
// msg = {
// msg = 26136;
// };
// "msg_from" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_id" = "ecf62e44-e05e-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597650889;
// "msg_to" = jfdfjei0343;
// "msg_type" = 1;
// "send_time" = "2020-08-17 15:54:49";
// },
// {
// msg = {
// msg = 51775;
// };
// "msg_from" = jfdfjei0343;
// "msg_id" = "289fefdb-e05f-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597650989;
// "msg_to" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_type" = 1;
// "send_time" = "2020-08-17 15:56:29";
// },
// {
// msg = {
// msg = 22159;
// };
// "msg_from" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_id" = "2fb43160-e0f0-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597713278;
// "msg_to" = jfdfjei0343;
// "msg_type" = 1;
// "send_time" = "2020-08-18 09:14:38";
// },
// {
// msg = {
// msg = "\U6211\U662f\U4e00\U53ea\U5c0f\U9752\U9f99";
// };
// "msg_from" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_id" = "31bcd9c7-e137-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597743776;
// "msg_to" = jfdfjei0343;
// "msg_type" = 1;
// "send_time" = "2020-08-18 17:42:56";
// },
// {
// msg = {
// msg = "\U6211\U662f\U4e00\U53ea\U5c0f\U9752\U9f99";
// };
// "msg_from" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_id" = "ec318df1-e137-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597744089;
// "msg_to" = jfdfjei0343;
// "msg_type" = 1;
// "send_time" = "2020-08-18 17:48:09";
// },
// {
// msg = {
// msg = "\U6211\U662f\U4e00\U53ea\U5c0f\U9752\U9f99";
// };
// "msg_from" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_id" = "895e2cbc-e138-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597744353;
// "msg_to" = jfdfjei0343;
// "msg_type" = 1;
// "send_time" = "2020-08-18 17:52:32";
// },
// {
// msg = {
// msg = "\U6211\U662f\U4e00\U53ea\U5c0f\U9752\U9f99";
// };
// "msg_from" = ce0819db8391f1e7258a71cc9e2c3235;
// "msg_id" = "dda56169-e138-11ea-88a4-4a5555fb6ab4";
// "msg_seq" = 1597744494;
// "msg_to" = jfdfjei0343;
// "msg_type" = 1;
// "send_time" = "2020-08-18 17:54:54";
// }
// );
//}
//
//
//
// OffcnZYJFMDBHandler.h
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2019/4/9.
// Copyright © 2019年 中公教育. All rights reserved.
......
//
//
//
// OffcnZYJFMDBHandler.m
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2019/4/9.
// Copyright © 2019年 中公教育. All rights reserved.
......
//
//
......@@ -8,7 +8,7 @@
@import Foundation;
static const NSString *OffcnLiveSDKZYJMQTTVersion = @"1.4.3";
static const NSString *OffcnIMSDKiOSZYJMQTTVersion = @"1.4.3";
#define NSLog(format, ...) do { \
fprintf(stderr, "<%s : %d> %s\n", \
......
//
// ViewController.h
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/7/25.
// Copyright © 2018年 中公教育. All rights reserved.
......@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
#define kOffcnLiveSDK_changeEnvironment @"kOffcnLiveSDK_changeEnvironment"
#define kOffcnIMSDKiOS_changeEnvironment @"kOffcnIMSDKiOS_changeEnvironment"
@interface ViewController : UIViewController
......
//
// ViewController.m
// OffcnLiveSDK
// OffcnIMSDKiOS
//
// Created by vockey on 2018/7/25.
// Copyright © 2018年 中公教育. All rights reserved.
//
#import "ViewController.h"
#import "OffcnIMSDKiOS.h"
#import "OffcnNetworkExecutor.h"
@interface ViewController ()<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UITextField *nameTextField;
@property (weak, nonatomic) IBOutlet UITextField *uuidTextField;
@property (weak, nonatomic) IBOutlet UITextField *koulingTextField;
@property (weak, nonatomic) IBOutlet UIButton *enterRoomBtn;
@property (weak, nonatomic) IBOutlet UIButton *playBackBtn;
@property (weak, nonatomic) IBOutlet UIButton *downLoadBtn;
@property (weak, nonatomic) IBOutlet UILabel *versionLab;
@property (weak, nonatomic) IBOutlet UITextField *koulingTextField2;
@property (weak, nonatomic) IBOutlet UIButton *enterRoomBtn2;
@property (weak, nonatomic) IBOutlet UIButton *playBackBtn2;
@property (weak, nonatomic) IBOutlet UIButton *downLoadBtn2;
@property (weak, nonatomic) IBOutlet UITextField *koulingTextField3;
@property (weak, nonatomic) IBOutlet UIButton *enterRoomBtn3;
@property (weak, nonatomic) IBOutlet UIButton *playBackBtn3;
@property (weak, nonatomic) IBOutlet UIButton *downLoadBtn3;
@property (weak, nonatomic) IBOutlet UIButton *changeEnvironmentBtn;
@property (strong, nonatomic) NSString *fromId;
@property (strong, nonatomic) NSString *toId;
@property (assign, nonatomic) OffcnSDKMsgType msg_type;
@property (strong, nonatomic) NSMutableDictionary *dataDic;
@end
@implementation ViewController
#pragma mark - 测试专用:本地文件内容查看插件
- (IBAction)logBtnAction:(UIButton *)sender {
// [[FLEXManager sharedManager] showExplorer];
}
#pragma mark - 切换环境
- (IBAction)clickChangeEnvironmentBtnAction:(UIButton *)sender {
sender.selected = !sender.isSelected;
//中公直播使用测试环境设置为YES,正式环境设置为NO或者去掉这个配置
// [OffcnLiveSDK defaultService].isTest = sender.isSelected;
//
// [[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithBool:[OffcnLiveSDK defaultService].isTest] forKey:kOffcnLiveSDK_changeEnvironment];
// [[NSUserDefaults standardUserDefaults] synchronize];
[OffcnIMSDKiOS defaultService].isTest = sender.isSelected;
[[NSUserDefaults standardUserDefaults] setValue:[NSNumber numberWithBool:[OffcnIMSDKiOS defaultService].isTest] forKey:kOffcnIMSDKiOS_changeEnvironment];
[[NSUserDefaults standardUserDefaults] synchronize];
}
#pragma mark - 点我退出键盘
- (IBAction)clickExitKeyboardAction:(UIButton *)sender {
[self.view endEditing:YES];
}
- (IBAction)sendMeg:(UIButton *)sender {
//发送消息
[OffcnNetworkExecutor requestSendMsgWithMsg_fromID:self.fromId msg_toID:self.toId msg_type:self.msg_type msg:self.dataDic Finished:^(BOOL success, id response, BaseResponse *baseResponse) {
#pragma mark - 直播事件
- (IBAction)enterRoomAction:(UIButton *)sender {
[self enterSmallClassWithNickname:self.nameTextField.text password:self.koulingTextField.text uuid:self.uuidTextField.text];
}];
}
-(void)enterSmallClassWithNickname:(NSString *)nickname password:(NSString *)password uuid:(NSString *)uuid{
[self.view endEditing:YES];
- (IBAction)noReadListAction:(UIButton *)sender {
//获取会话未读消息列表
[OffcnNetworkExecutor requestGetSessionUnreadMsgWithFromID:self.fromId toID:self.toId Finished:^(BOOL success, id response, BaseResponse *baseResponse) {
}];
}
- (IBAction)readedAction:(UIButton *)sender {
//用户信息标记已读
[OffcnNetworkExecutor requestMarkMsgReadWithMsg_fromID:self.fromId msg_toID:self.toId Finished:^(BOOL success, id response, BaseResponse *baseResponse) {
- (IBAction)enterRoomAction2:(UIButton *)sender {
[self enterRoomPublicMethodWithNickname:self.nameTextField.text password:self.koulingTextField2.text uuid:self.uuidTextField.text];
}];
}
- (IBAction)enterRoomAction3:(UIButton *)sender {
- (IBAction)recentVChatAction:(UIButton *)sender {
//获取用户最近会话记录
[OffcnNetworkExecutor requestGetRecentSessionsWithAccid:self.fromId Finished:^(BOOL success, id response, BaseResponse *baseResponse) {
[self enterRoomPublicMethodWithNickname:self.nameTextField.text password:self.koulingTextField3.text uuid:self.uuidTextField.text];
}];
}
-(void)enterRoomPublicMethodWithNickname:(NSString *)nickname password:(NSString *)password uuid:(NSString *)uuid{
- (IBAction)historyMegListAction:(UIButton *)sender {
//获取会话历史消息列表,msg_seq当前时间的时间戳
[OffcnNetworkExecutor requestGetSessionHistoryMsgWithFromID:self.fromId toID:self.toId msg_seq:@"" Finished:^(BOOL success, id response, BaseResponse *baseResponse) {
[self.view endEditing:YES];
}];
}
#pragma mark - 回放视频事件
- (IBAction)playBackAction:(UIButton *)sender {
}
- (IBAction)playBackAction2:(UIButton *)sender {
[self playBackPublicMethodWithNickname:self.nameTextField.text password:self.koulingTextField2.text uuid:self.uuidTextField.text];
}
- (IBAction)playBackAction3:(UIButton *)sender {
[self playBackPublicMethodWithNickname:self.nameTextField.text password:self.koulingTextField3.text uuid:self.uuidTextField.text];
}
-(void)playBackPublicMethodWithNickname:(NSString *)nickname password:(NSString *)password uuid:(NSString *)uuid{
[self.view endEditing:YES];
}
#pragma mark - 下载视频事件
- (IBAction)downloadAction:(UIButton *)sender {
[self downloadPublicMethod];
}
- (IBAction)downloadAction2:(UIButton *)sender {
[self downloadPublicMethod];
}
- (IBAction)downloadAction3:(UIButton *)sender {
[self downloadPublicMethod];
}
-(void)downloadPublicMethod{
}
//测试环境小班课录制z84pkgl743il-大班课录制11pvxwnxp3ce//疫情开会z4mndpdmuq-ev0gm7xqsq
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"demo";
// self.changeEnvironmentBtn.selected = [OffcnLiveSDK defaultService].isTest;
NSString *dateStr = [self getAllCurrentTimes];
self.versionLab.text = [NSString stringWithFormat:@"版本号-打包日期:\n%@(%@)",[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"],dateStr];
self.nameTextField.text = @"张";
// self.uuidTextField.text = @"12310";
self.uuidTextField.text = [NSString stringWithFormat:@"%d",arc4random_uniform(1000000)];
self.koulingTextField.text = @"";
self.koulingTextField2.text = @"";
self.koulingTextField3.text = @"";
self.nameTextField.delegate = self;
self.uuidTextField.delegate = self;
[self.nameTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
[self.uuidTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
self.koulingTextField.delegate = self;
[self.koulingTextField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
self.koulingTextField2.delegate = self;
[self.koulingTextField2 addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
self.koulingTextField3.delegate = self;
[self.koulingTextField3 addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
if (self.nameTextField.text.length && self.koulingTextField.text.length && self.uuidTextField.text.length) {
self.enterRoomBtn.enabled = YES;
self.playBackBtn.enabled = YES;
self.downLoadBtn.enabled = YES;
}else{
self.enterRoomBtn.enabled = NO;
self.playBackBtn.enabled = NO;
self.downLoadBtn.enabled = NO;
}
if (self.nameTextField.text.length && self.koulingTextField2.text.length && self.uuidTextField.text.length) {
self.changeEnvironmentBtn.selected = [OffcnIMSDKiOS defaultService].isTest;
self.enterRoomBtn2.enabled = YES;
self.playBackBtn2.enabled = YES;
self.downLoadBtn2.enabled = YES;
}else{
self.enterRoomBtn2.enabled = NO;
self.playBackBtn2.enabled = NO;
self.downLoadBtn2.enabled = NO;
}
if (self.nameTextField.text.length && self.koulingTextField3.text.length && self.uuidTextField.text.length) {
self.enterRoomBtn3.enabled = YES;
self.playBackBtn3.enabled = YES;
self.downLoadBtn3.enabled = YES;
}else{
self.enterRoomBtn3.enabled = NO;
self.playBackBtn3.enabled = NO;
self.downLoadBtn3.enabled = NO;
}
self.fromId = @"ce0819db8391f1e7258a71cc9e2c3235";
self.toId = @"jfdfjei0343";
self.msg_type = OffcnSDKMsgTypeText;
self.dataDic = [NSMutableDictionary dictionaryWithObject:@"我是一只小青龙" forKey:@"msg"];
}
-(NSString*)getAllCurrentTimes{
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
......@@ -178,69 +88,6 @@
NSString *currentTimeString = [formatter stringFromDate:datenow];
return currentTimeString;
}
#pragma mark - UITextField代理
-(void)textFieldDidChange:(UITextField *)textField{
if (self.nameTextField.text.length && self.koulingTextField.text.length && self.uuidTextField.text.length) {
self.enterRoomBtn.enabled = YES;
self.playBackBtn.enabled = YES;
self.downLoadBtn.enabled = YES;
}else{
self.enterRoomBtn.enabled = NO;
self.playBackBtn.enabled = NO;
self.downLoadBtn.enabled = NO;
}
if (self.nameTextField.text.length && self.koulingTextField2.text.length && self.uuidTextField.text.length) {
self.enterRoomBtn2.enabled = YES;
self.playBackBtn2.enabled = YES;
self.downLoadBtn2.enabled = YES;
}else{
self.enterRoomBtn2.enabled = NO;
self.playBackBtn2.enabled = NO;
self.downLoadBtn2.enabled = NO;
}
if (self.nameTextField.text.length && self.koulingTextField3.text.length && self.uuidTextField.text.length) {
self.enterRoomBtn3.enabled = YES;
self.playBackBtn3.enabled = YES;
self.downLoadBtn3.enabled = YES;
}else{
self.enterRoomBtn3.enabled = NO;
self.playBackBtn3.enabled = NO;
self.downLoadBtn3.enabled = NO;
}
}
- (BOOL)textFieldShouldClear:(UITextField *)textField{
if (textField == self.koulingTextField) {
self.enterRoomBtn.enabled = NO;
self.playBackBtn.enabled = NO;
self.downLoadBtn.enabled = NO;
}else if (textField == self.koulingTextField2){
self.enterRoomBtn2.enabled = NO;
self.playBackBtn2.enabled = NO;
self.downLoadBtn2.enabled = NO;
}else if (textField == self.koulingTextField3){
self.enterRoomBtn3.enabled = NO;
self.playBackBtn3.enabled = NO;
self.downLoadBtn3.enabled = NO;
}else{
self.enterRoomBtn.enabled = NO;
self.playBackBtn.enabled = NO;
self.downLoadBtn.enabled = NO;
self.enterRoomBtn2.enabled = NO;
self.playBackBtn2.enabled = NO;
self.downLoadBtn2.enabled = NO;
self.enterRoomBtn3.enabled = NO;
self.playBackBtn3.enabled = NO;
self.downLoadBtn3.enabled = NO;
}
return YES;
}
- (NSString *)documentPath{
NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject];
docDir = [docDir stringByAppendingPathComponent:@"test"];
......
#ifndef __OFFCN_IM__TYPES_H__
#define __OFFCN_IM__TYPES_H__
#include <stdio.h>
#ifdef _WIN32
#define ZG_OIM_API_EXPORT __declspec(dllexport)
#define ZG_OIM_API_IMPORT __declspec(dllimport)
#else
#define ZG_OIM_API_EXPORT __attribute__ ((visibility("default")))
#define ZG_OIM_API_IMPORT
#endif
#ifdef __cplusplus
#define ZG_OIM_C_API_EXPORT extern "C" ZG_OIM_API_EXPORT
#define ZG_OIM_C_API_IMPORT extern "C" ZG_OIM_API_IMPORT
#else
#define ZG_OIM_C_API_EXPORT ZG_OIM_API_EXPORT
#define ZG_OIM_C_API_IMPORT ZG_OIM_API_IMPORT
#endif
#ifdef ZG_OIM_SDK_EXPORTS //need define this micro,when build dll, undefine this micro when use this dll
#define ZG_OIM_C_API ZG_OIM_C_API_EXPORT
#else
#define ZG_OIM_C_API ZG_OIM_C_API_IMPORT
#endif
namespace offcn
{
namespace im
{
typedef enum
{
kMsg_Type_Normal, //正常的聊天消息
kMsg_Type_Recv_Confirm, //收到服务端发来的消息确认消息
}OImMsgType;
typedef enum
{
Z_CONN_IM_SRV_OK,
Z_CONN_IM_SRV_FAILED,
Z_CONN_IM_SRV_BROKEN,
Z_DISCONN_IM_SRV_OK,
}OImEventCode;
class OImCoreObserver
{
public:
virtual void OnOImCoreEvent(int code, const char *context) = 0;
virtual void OnOImCoreMessage(const char *message, int len) = 0;
};
}
}
#endif
//
// OIMCore.h
//
// Created by zxl on 2020/8/7.
// Copyright © 2020 zxl. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "oim_types.h"
@protocol OIMCoreDelegate <NSObject>
-(void) OnOImCoreMessageWithMessage:(const char *)message msgLength:(int)len;
-(void) OnOImCoreEventWithCode:(int)code context:(const char *)context;
@end
NS_ASSUME_NONNULL_BEGIN
@interface OIMCoreAdapter : NSObject
@property(nonatomic, readonly) id<OIMCoreDelegate> delegate;
+ (instancetype)sharedOIMCore;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
- (id)copy NS_UNAVAILABLE;
- (id)mutableCopy NS_UNAVAILABLE;
/**
* 连接服务器
*
* @param params must contain server'ip and port in json format eg:{"server_ip": "xxxx", "server_port": 123}
*/
-(void) ConnectImServerWithParam:(NSString*)param;
/**
* 与服务器断开连接
*/
-(void) DisConnectImServer;
/**
* 发送消息
*
* @param message message data, size less than 256 BYTES
* @param type message's type
*/
-(void) SendUserMessage:(NSString*)message length:(int)len type:(offcn::im::OImMsgType)type;
@end
NS_ASSUME_NONNULL_END
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment