diff --git a/Basic-Video-Chat/Basic-Video-Chat.xcodeproj/project.pbxproj b/Basic-Video-Chat/Basic-Video-Chat.xcodeproj/project.pbxproj index 43fd027..22f4866 100644 --- a/Basic-Video-Chat/Basic-Video-Chat.xcodeproj/project.pbxproj +++ b/Basic-Video-Chat/Basic-Video-Chat.xcodeproj/project.pbxproj @@ -12,6 +12,7 @@ A05375D91EB1633400645696 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A05375D11EB1633400645696 /* LaunchScreen.storyboard */; }; A05375DA1EB1633400645696 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A05375D31EB1633400645696 /* Main.storyboard */; }; A05375DC1EB1633400645696 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A05375D61EB1633400645696 /* ViewController.swift */; }; + F825CCC522CD0728005F9085 /* OTKLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = F825CCC422CD0728005F9085 /* OTKLogger.m */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -21,6 +22,9 @@ A05375D41EB1633400645696 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; A05375D51EB1633400645696 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A05375D61EB1633400645696 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + F825CCC222CD0727005F9085 /* Basic-Video-Chat-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Basic-Video-Chat-Bridging-Header.h"; sourceTree = ""; }; + F825CCC322CD0728005F9085 /* OTKLogger.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OTKLogger.h; sourceTree = ""; }; + F825CCC422CD0728005F9085 /* OTKLogger.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OTKLogger.m; sourceTree = ""; }; F86C649A1D5C7C630081846D /* Basic-Video-Chat.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Basic-Video-Chat.app"; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -48,9 +52,20 @@ path = "Basic-Video-Chat"; sourceTree = ""; }; + F825CCC122CD06FF005F9085 /* Support */ = { + isa = PBXGroup; + children = ( + F825CCC322CD0728005F9085 /* OTKLogger.h */, + F825CCC422CD0728005F9085 /* OTKLogger.m */, + F825CCC222CD0727005F9085 /* Basic-Video-Chat-Bridging-Header.h */, + ); + path = Support; + sourceTree = ""; + }; F86C64911D5C7C630081846D = { isa = PBXGroup; children = ( + F825CCC122CD06FF005F9085 /* Support */, A05375CE1EB1633400645696 /* Basic-Video-Chat */, F86C649B1D5C7C630081846D /* Products */, ); @@ -97,7 +112,7 @@ F86C64991D5C7C630081846D = { CreatedOnToolsVersion = 7.3.1; DevelopmentTeam = ""; - LastSwiftMigration = 0930; + LastSwiftMigration = 1100; ProvisioningStyle = Manual; }; }; @@ -107,6 +122,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -138,6 +154,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + F825CCC522CD0728005F9085 /* OTKLogger.m in Sources */, A05375DC1EB1633400645696 /* ViewController.swift in Sources */, A05375D71EB1633400645696 /* AppDelegate.swift in Sources */, ); @@ -271,6 +288,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "$(SRCROOT)/Basic-Video-Chat/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -278,6 +296,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "Support/Basic-Video-Chat-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 4.2; }; name = Debug; @@ -286,11 +306,13 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "$(SRCROOT)/Basic-Video-Chat/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.tokbox.Hello-World"; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Support/Basic-Video-Chat-Bridging-Header.h"; SWIFT_VERSION = 4.2; }; name = Release; diff --git a/Basic-Video-Chat/Basic-Video-Chat/AppDelegate.swift b/Basic-Video-Chat/Basic-Video-Chat/AppDelegate.swift index 8004b8d..cb0ba7d 100644 --- a/Basic-Video-Chat/Basic-Video-Chat/AppDelegate.swift +++ b/Basic-Video-Chat/Basic-Video-Chat/AppDelegate.swift @@ -14,6 +14,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + + // Uncomment below line to show logs + // let _ = OTKLogger() return true } } diff --git a/Basic-Video-Chat/Podfile.lock b/Basic-Video-Chat/Podfile.lock index a84323d..47c0c13 100644 --- a/Basic-Video-Chat/Podfile.lock +++ b/Basic-Video-Chat/Podfile.lock @@ -1,16 +1,16 @@ PODS: - - OpenTok (2.15.0) + - OpenTok (2.16.1) DEPENDENCIES: - - OpenTok (= 2.15.0) + - OpenTok (= 2.16.1) SPEC REPOS: https://github.com/cocoapods/specs.git: - OpenTok SPEC CHECKSUMS: - OpenTok: f2729ddade8dae49f233b22670dc795ecd236660 + OpenTok: 556374577b66cbf791190c84612346c8f3997c9e PODFILE CHECKSUM: 5d5d67221d38bc9f64ee6b0f086eae6bcf9072ca -COCOAPODS: 1.5.3 +COCOAPODS: 1.7.3 diff --git a/Basic-Video-Chat/Support/Basic-Video-Chat-Bridging-Header.h b/Basic-Video-Chat/Support/Basic-Video-Chat-Bridging-Header.h new file mode 100644 index 0000000..c3c1d4c --- /dev/null +++ b/Basic-Video-Chat/Support/Basic-Video-Chat-Bridging-Header.h @@ -0,0 +1,6 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + +#import +#import "OTKLogger.h" diff --git a/Basic-Video-Chat/Support/OTKLogger.h b/Basic-Video-Chat/Support/OTKLogger.h new file mode 100644 index 0000000..735fd19 --- /dev/null +++ b/Basic-Video-Chat/Support/OTKLogger.h @@ -0,0 +1,16 @@ +// +// OTKLogger.h +// Basic-Video-Chat +// +// Created by rpc on 03/07/2019. +// Copyright © 2019 tokbox. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@interface OTKLogger : NSObject + +@end + +NS_ASSUME_NONNULL_END diff --git a/Basic-Video-Chat/Support/OTKLogger.m b/Basic-Video-Chat/Support/OTKLogger.m new file mode 100644 index 0000000..14d676a --- /dev/null +++ b/Basic-Video-Chat/Support/OTKLogger.m @@ -0,0 +1,28 @@ +// +// OTKLogger.m +// Basic-Video-Chat +// +// Created by rpc on 03/07/2019. +// Copyright © 2019 tokbox. All rights reserved. +// + +#import "OTKLogger.h" + +@interface OpenTokObjC : NSObject ++ (void)setLogBlockQueue:(dispatch_queue_t)queue; ++ (void)setLogBlock:(void (^)(NSString* message, void* arg))logBlock; +@end + +static dispatch_queue_t _logQueue; + +@implementation OTKLogger ++ (void)initialize { + _logQueue = dispatch_queue_create("log-queue", DISPATCH_QUEUE_SERIAL); + [OpenTokObjC setLogBlockQueue:_logQueue]; + [OpenTokObjC setLogBlock:^(NSString *message, void *arg) { + NSLog(@"%@", message); + }]; +} +@end + +