diff --git a/.gitignore b/.gitignore deleted file mode 100644 index d749bf4..0000000 --- a/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# https://stackoverflow.com/a/12021580 - -*.xcuserstate -xcuserdata/ -Carthage/ -.DS_Store diff --git a/src/native-to-web/README.md b/src/native-to-web/README.md deleted file mode 100644 index 3f9e966..0000000 --- a/src/native-to-web/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Native to Web Mode - -- Create new XCode Single View application called Mobile -- Install Carthage -- Install Telegraph (web server, web socket server) and WebRTC -- `carthage update --platform iOS` -- Drag framework files from Carthage/Builds to Embedded Frameworks section in XCode - -## Native Offered Mode - -- Start web socket server and let web app connect -- Prepare connection and send offer -- Wait for JavaScript to prepare connection and send answer - -## Native Answerer Mode - -- Start web socket server and let web app connect -- Wait for JavaScript to prepare connection and send offer -- Prepare connection and send answer diff --git a/src/native-to-web/native/Cartfile b/src/native-to-web/native/Cartfile deleted file mode 100644 index 1e18d6e..0000000 --- a/src/native-to-web/native/Cartfile +++ /dev/null @@ -1,2 +0,0 @@ -github "Building42/Telegraph" "master" -github "Anakros/WebRTC" diff --git a/src/native-to-web/native/Cartfile.resolved b/src/native-to-web/native/Cartfile.resolved deleted file mode 100644 index 1184679..0000000 --- a/src/native-to-web/native/Cartfile.resolved +++ /dev/null @@ -1,4 +0,0 @@ -github "Anakros/WebRTC" "63.11.20455" -github "Building42/HTTPParserC" "2.7.3" -github "Building42/Telegraph" "b6084e4a3b916f0069f515a4817cd466eeae5bda" -github "robbiehanson/CocoaAsyncSocket" "7.6.2" diff --git a/src/native-to-web/native/Mobile.xcodeproj/project.pbxproj b/src/native-to-web/native/Mobile.xcodeproj/project.pbxproj deleted file mode 100644 index 3062a93..0000000 --- a/src/native-to-web/native/Mobile.xcodeproj/project.pbxproj +++ /dev/null @@ -1,377 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 48; - objects = { - -/* Begin PBXBuildFile section */ - E268457D202F54C40020466A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E268457C202F54C40020466A /* AppDelegate.swift */; }; - E268457F202F54C40020466A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E268457E202F54C40020466A /* ViewController.swift */; }; - E2684582202F54C40020466A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E2684580202F54C40020466A /* Main.storyboard */; }; - E2684584202F54C40020466A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E2684583202F54C40020466A /* Assets.xcassets */; }; - E2684587202F54C40020466A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E2684585202F54C40020466A /* LaunchScreen.storyboard */; }; - E2684592202F57C70020466A /* Telegraph.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E268458E202F57C60020466A /* Telegraph.framework */; }; - E2684593202F57C70020466A /* Telegraph.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E268458E202F57C60020466A /* Telegraph.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - E2684594202F57C70020466A /* CocoaAsyncSocket.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E268458F202F57C60020466A /* CocoaAsyncSocket.framework */; }; - E2684595202F57C70020466A /* CocoaAsyncSocket.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E268458F202F57C60020466A /* CocoaAsyncSocket.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - E2684596202F57C70020466A /* WebRTC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2684590202F57C60020466A /* WebRTC.framework */; }; - E2684597202F57C70020466A /* WebRTC.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E2684590202F57C60020466A /* WebRTC.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - E2684598202F57C70020466A /* HTTPParserC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2684591202F57C70020466A /* HTTPParserC.framework */; }; - E2684599202F57C70020466A /* HTTPParserC.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E2684591202F57C70020466A /* HTTPParserC.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - E268459C202F597B0020466A /* www in Resources */ = {isa = PBXBuildFile; fileRef = E268459B202F597B0020466A /* www */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - E268459A202F57C70020466A /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - E2684595202F57C70020466A /* CocoaAsyncSocket.framework in Embed Frameworks */, - E2684599202F57C70020466A /* HTTPParserC.framework in Embed Frameworks */, - E2684593202F57C70020466A /* Telegraph.framework in Embed Frameworks */, - E2684597202F57C70020466A /* WebRTC.framework in Embed Frameworks */, - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - E2684579202F54C40020466A /* Mobile.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Mobile.app; sourceTree = BUILT_PRODUCTS_DIR; }; - E268457C202F54C40020466A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - E268457E202F54C40020466A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - E2684581202F54C40020466A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - E2684583202F54C40020466A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - E2684586202F54C40020466A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - E2684588202F54C50020466A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E268458E202F57C60020466A /* Telegraph.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Telegraph.framework; path = Carthage/Build/iOS/Telegraph.framework; sourceTree = ""; }; - E268458F202F57C60020466A /* CocoaAsyncSocket.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CocoaAsyncSocket.framework; path = Carthage/Build/iOS/CocoaAsyncSocket.framework; sourceTree = ""; }; - E2684590202F57C60020466A /* WebRTC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebRTC.framework; path = Carthage/Build/iOS/WebRTC.framework; sourceTree = ""; }; - E2684591202F57C70020466A /* HTTPParserC.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HTTPParserC.framework; path = Carthage/Build/iOS/HTTPParserC.framework; sourceTree = ""; }; - E268459B202F597B0020466A /* www */ = {isa = PBXFileReference; lastKnownFileType = folder; name = www; path = ../../www; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - E2684576202F54C40020466A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E2684594202F57C70020466A /* CocoaAsyncSocket.framework in Frameworks */, - E2684598202F57C70020466A /* HTTPParserC.framework in Frameworks */, - E2684592202F57C70020466A /* Telegraph.framework in Frameworks */, - E2684596202F57C70020466A /* WebRTC.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - E2684570202F54C40020466A = { - isa = PBXGroup; - children = ( - E268458F202F57C60020466A /* CocoaAsyncSocket.framework */, - E2684591202F57C70020466A /* HTTPParserC.framework */, - E268458E202F57C60020466A /* Telegraph.framework */, - E2684590202F57C60020466A /* WebRTC.framework */, - E268457B202F54C40020466A /* Mobile */, - E268457A202F54C40020466A /* Products */, - ); - sourceTree = ""; - }; - E268457A202F54C40020466A /* Products */ = { - isa = PBXGroup; - children = ( - E2684579202F54C40020466A /* Mobile.app */, - ); - name = Products; - sourceTree = ""; - }; - E268457B202F54C40020466A /* Mobile */ = { - isa = PBXGroup; - children = ( - E268459B202F597B0020466A /* www */, - E268457C202F54C40020466A /* AppDelegate.swift */, - E268457E202F54C40020466A /* ViewController.swift */, - E2684580202F54C40020466A /* Main.storyboard */, - E2684583202F54C40020466A /* Assets.xcassets */, - E2684585202F54C40020466A /* LaunchScreen.storyboard */, - E2684588202F54C50020466A /* Info.plist */, - ); - path = Mobile; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - E2684578202F54C40020466A /* Mobile */ = { - isa = PBXNativeTarget; - buildConfigurationList = E268458B202F54C50020466A /* Build configuration list for PBXNativeTarget "Mobile" */; - buildPhases = ( - E2684575202F54C40020466A /* Sources */, - E2684576202F54C40020466A /* Frameworks */, - E2684577202F54C40020466A /* Resources */, - E268459A202F57C70020466A /* Embed Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Mobile; - productName = Mobile; - productReference = E2684579202F54C40020466A /* Mobile.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - E2684571202F54C40020466A /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 0920; - ORGANIZATIONNAME = "Tomas Hubelbauer"; - TargetAttributes = { - E2684578202F54C40020466A = { - CreatedOnToolsVersion = 9.2; - ProvisioningStyle = Automatic; - }; - }; - }; - buildConfigurationList = E2684574202F54C40020466A /* Build configuration list for PBXProject "Mobile" */; - compatibilityVersion = "Xcode 8.0"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = E2684570202F54C40020466A; - productRefGroup = E268457A202F54C40020466A /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - E2684578202F54C40020466A /* Mobile */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - E2684577202F54C40020466A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E268459C202F597B0020466A /* www in Resources */, - E2684587202F54C40020466A /* LaunchScreen.storyboard in Resources */, - E2684584202F54C40020466A /* Assets.xcassets in Resources */, - E2684582202F54C40020466A /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - E2684575202F54C40020466A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E268457F202F54C40020466A /* ViewController.swift in Sources */, - E268457D202F54C40020466A /* AppDelegate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - E2684580202F54C40020466A /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - E2684581202F54C40020466A /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - E2684585202F54C40020466A /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - E2684586202F54C40020466A /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - E2684589202F54C50020466A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.2; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - E268458A202F54C50020466A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.2; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - E268458C202F54C50020466A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = D8ATRFH5N2; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Mobile/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = TomasHubelbauer.Mobile; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - E268458D202F54C50020466A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = D8ATRFH5N2; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = Mobile/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = TomasHubelbauer.Mobile; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - E2684574202F54C40020466A /* Build configuration list for PBXProject "Mobile" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E2684589202F54C50020466A /* Debug */, - E268458A202F54C50020466A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E268458B202F54C50020466A /* Build configuration list for PBXNativeTarget "Mobile" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E268458C202F54C50020466A /* Debug */, - E268458D202F54C50020466A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = E2684571202F54C40020466A /* Project object */; -} diff --git a/src/native-to-web/native/Mobile.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/src/native-to-web/native/Mobile.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 7449f7d..0000000 --- a/src/native-to-web/native/Mobile.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/src/native-to-web/native/Mobile/AppDelegate.swift b/src/native-to-web/native/Mobile/AppDelegate.swift deleted file mode 100644 index 02f08d6..0000000 --- a/src/native-to-web/native/Mobile/AppDelegate.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// AppDelegate.swift -// Mobile -// -// Created by Tomas Hubelbauer on 10/02/2018. -// Copyright © 2018 Tomas Hubelbauer. All rights reserved. -// - -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - return true - } - - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - -} - diff --git a/src/native-to-web/native/Mobile/Assets.xcassets/AppIcon.appiconset/Contents.json b/src/native-to-web/native/Mobile/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 1d060ed..0000000 --- a/src/native-to-web/native/Mobile/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/src/native-to-web/native/Mobile/Base.lproj/LaunchScreen.storyboard b/src/native-to-web/native/Mobile/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f83f6fd..0000000 --- a/src/native-to-web/native/Mobile/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/native-to-web/native/Mobile/Base.lproj/Main.storyboard b/src/native-to-web/native/Mobile/Base.lproj/Main.storyboard deleted file mode 100644 index 03c13c2..0000000 --- a/src/native-to-web/native/Mobile/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/native-to-web/native/Mobile/Info.plist b/src/native-to-web/native/Mobile/Info.plist deleted file mode 100644 index 2feba9d..0000000 --- a/src/native-to-web/native/Mobile/Info.plist +++ /dev/null @@ -1,50 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/src/native-to-web/native/Mobile/ViewController.swift b/src/native-to-web/native/Mobile/ViewController.swift deleted file mode 100644 index ceaa0db..0000000 --- a/src/native-to-web/native/Mobile/ViewController.swift +++ /dev/null @@ -1,69 +0,0 @@ -import UIKit -import WebKit -import Telegraph -import WebRTC - -class ViewController: UIViewController { - var webView: WKWebView! - let server = Server() - - override func loadView() { - let webConfiguration = WKWebViewConfiguration() - webView = WKWebView(frame: .zero, configuration: webConfiguration) - webView.uiDelegate = self - view = webView - } - - override func viewDidLoad() { - super.viewDidLoad() - server.serveDirectory(Bundle.main.url(forResource: "www", withExtension: nil)!, "/") - server.webSocketDelegate = self - do { - try server.start(onPort: 8000) - // TODO: Add open in Safari button but figure out how to keep the server alive when in background - webView.load(URLRequest(url: URL(string: "http://localhost:8000")!)) - } catch { - print(error) - } - } - - func audit(_ message: String) { - // Telegraph delegate on background thread - DispatchQueue.main.async { - self.webView.evaluateJavaScript("audit('\(message)', 'answerer')", completionHandler: nil) - } - } -} - -extension ViewController: ServerWebSocketDelegate { - func server(_ server: Server, webSocketDidConnect webSocket: WebSocket, handshake: HTTPRequest) { - audit("web socket did connect") - } - - func server(_ server: Server, webSocketDidDisconnect webSocket: WebSocket, error: Error?) { - audit("web socket did disconnect") - } - - func server(_ server: Server, webSocket: WebSocket, didReceiveMessage message: WebSocketMessage) { - switch (message.opcode) { - case .binaryFrame: audit("web socket did receive binary frame op-code") - case .connectionClose: audit("web socket did receive connection close op-code") - case .continuationFrame: audit("web socket did receive continuation frame op-code") - case .ping: audit("web socket did receive ping op-code") - case .pong: audit("web socket did receive pong op-code") - case .textFrame: audit("web socket did receive text frame op-code \(String(data: message.payload.data!, encoding: .utf8)!)") - } - } - - func server(_ server: Server, webSocket: WebSocket, didSendMessage message: WebSocketMessage) { - audit("web socket did send message") - } - - func serverDidDisconnect(_ server: Server) { - audit("server did disconnect") - } -} - -extension ViewController: WKUIDelegate { - -} diff --git a/src/native-to-web/www/index.html b/src/native-to-web/www/index.html deleted file mode 100644 index b49d8f1..0000000 --- a/src/native-to-web/www/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Mobile - - - - -

Offerer

-
    - - diff --git a/src/native-to-web/www/index.js b/src/native-to-web/www/index.js deleted file mode 100644 index 39e71a4..0000000 --- a/src/native-to-web/www/index.js +++ /dev/null @@ -1,29 +0,0 @@ -window.addEventListener('load', async _ => { - try { - const url = new URL(window.location.href); - url.protocol = 'ws:'; - - const webSocket = new WebSocket(url); - - webSocket.addEventListener('open', _ => { - audit('web socket open', 'offerer'); - webSocket.send('TODO: Offer'); - }); - - webSocket.addEventListener('message', _ => audit('web socket message', 'offerer')); - - webSocket.addEventListener('data', _ => audit('web socket data', 'offerer')); - - webSocket.addEventListener('close', _ => audit('web socket close', 'offerer')); - - } catch (error) { - audit(error.message, 'offerer'); - } -}); - -function audit(message, source) { - const auditUl = document.getElementById('auditUl'); - const auditLi = document.createElement('li'); - auditLi.textContent = source + ':' + message; - auditUl.insertAdjacentElement('afterbegin', auditLi); -}