From d8b678d3bd76541ddf8e1bdbf314989b9574a6db Mon Sep 17 00:00:00 2001 From: Jon Date: Thu, 17 Jun 2021 15:46:09 +0100 Subject: [PATCH] initial commit --- prebuilt-ui/ios-webview/README.md | 13 + .../ios-webview/ios-webview/.gitignore | 142 +++++++ prebuilt-ui/ios-webview/ios-webview/README.md | 18 + .../WebViewPrebuilt.xcodeproj/project.pbxproj | 346 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../WebViewPrebuilt/AppDelegate.swift | 36 ++ .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 98 +++++ .../Assets.xcassets/Contents.json | 6 + .../Base.lproj/LaunchScreen.storyboard | 25 ++ .../Base.lproj/Main.storyboard | 24 ++ .../ios-webview/WebViewPrebuilt/Info.plist | 77 ++++ .../WebViewPrebuilt/SceneDelegate.swift | 52 +++ .../WebViewPrebuilt/ViewController.swift | 68 ++++ prebuilt-ui/ios-webview/ios-webview/image.png | Bin 0 -> 256970 bytes 16 files changed, 931 insertions(+) create mode 100644 prebuilt-ui/ios-webview/README.md create mode 100644 prebuilt-ui/ios-webview/ios-webview/.gitignore create mode 100644 prebuilt-ui/ios-webview/ios-webview/README.md create mode 100644 prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt.xcodeproj/project.pbxproj create mode 100644 prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/AppDelegate.swift create mode 100644 prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Assets.xcassets/Contents.json create mode 100644 prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Base.lproj/LaunchScreen.storyboard create mode 100644 prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Base.lproj/Main.storyboard create mode 100644 prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Info.plist create mode 100644 prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/SceneDelegate.swift create mode 100644 prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/ViewController.swift create mode 100644 prebuilt-ui/ios-webview/ios-webview/image.png diff --git a/prebuilt-ui/ios-webview/README.md b/prebuilt-ui/ios-webview/README.md new file mode 100644 index 0000000..951f93f --- /dev/null +++ b/prebuilt-ui/ios-webview/README.md @@ -0,0 +1,13 @@ +# Prebuilt UI Examples + +Daily Prebuilt makes it easy for developers to add video calls — in minutes — to any site or app. Out-of-the-box features include 1,000 person calls, recording, dual screen sharing, and more. Our secure infrastructure is trusted worldwide, from startups to Fortune 500 companies. + +These examples demonstrate how to customise and extend the prebuilt UI. + +--- + +## Examples + +### [🤙 iOS WebView](./ios-webview) + +Shows how to wrap the prebuilt UI in a native iOS application (using WKWebView) diff --git a/prebuilt-ui/ios-webview/ios-webview/.gitignore b/prebuilt-ui/ios-webview/ios-webview/.gitignore new file mode 100644 index 0000000..9f16eb5 --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/.gitignore @@ -0,0 +1,142 @@ + +# Created by https://www.toptal.com/developers/gitignore/api/swift +# Edit at https://www.toptal.com/developers/gitignore?templates=swift + +client/ +### Swift ### +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## User settings +xcuserdata/ + +## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) +*.xcscmblueprint +*.xccheckout + +## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) +build/ +DerivedData/ +*.moved-aside +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 + +## Obj-C/Swift specific +*.hmap + +## App packaging +*.ipa +*.dSYM.zip +*.dSYM + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +# Package.pins +# Package.resolved +# *.xcodeproj +# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata +# hence it is not needed unless you have added a package configuration file to your project +# .swiftpm + +.build/ + +# CocoaPods +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# Pods/ +# Add this line if you want to avoid checking in source code from the Xcode workspace +# *.xcworkspace + +# Carthage +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build/ + +# Add this lines if you are using Accio dependency management (Deprecated since Xcode 12) +# Dependencies/ +# .accio/ + +# fastlane +# It is recommended to not store the screenshots in the git repo. +# Instead, use fastlane to re-generate the screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/#source-control + +fastlane/report.xml +fastlane/Preview.html +fastlane/screenshots/**/*.png +fastlane/test_output + +# Code Injection +# After new code Injection tools there's a generated folder /iOSInjectionProject +# https://github.com/johnno1962/injectionforxcode + +iOSInjectionProject/ + +# End of https://www.toptal.com/developers/gitignore/api/swift + +# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode +# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode + +# Created by https://www.toptal.com/developers/gitignore/api/macos +# Edit at https://www.toptal.com/developers/gitignore?templates=macos + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# End of https://www.toptal.com/developers/gitignore/api/macos diff --git a/prebuilt-ui/ios-webview/ios-webview/README.md b/prebuilt-ui/ios-webview/ios-webview/README.md new file mode 100644 index 0000000..9eb17e3 --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/README.md @@ -0,0 +1,18 @@ +# WKWebView prebuilt example + +![WebViewPrebuilt](./image.png) + +## What does this demo do? + +Embeds the Daily Prebuilt UI in native iOS applicaiton using WKWebView + +Notes: + +- `getUserMedia` support was added to WKWebView in iOS >=14.4 +- You must add both `NSCameraUsageDescription` & `NSMicrophoneUsageDescription` to `info.plist` or `navigator.mediaDevices` will resolve as undefined + +### Getting started + +- Load XCode project +- Update the url property found in [ViewController.swift](./WebViewPrebuilt/ViewController.swift) +- Run on device / simulator targeting iOS >=14.4 diff --git a/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt.xcodeproj/project.pbxproj b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt.xcodeproj/project.pbxproj new file mode 100644 index 0000000..949407c --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt.xcodeproj/project.pbxproj @@ -0,0 +1,346 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 016773B326727315006BC038 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 016773B226727315006BC038 /* AppDelegate.swift */; }; + 016773B526727315006BC038 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 016773B426727315006BC038 /* SceneDelegate.swift */; }; + 016773B726727315006BC038 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 016773B626727315006BC038 /* ViewController.swift */; }; + 016773BA26727315006BC038 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 016773B826727315006BC038 /* Main.storyboard */; }; + 016773BC26727316006BC038 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 016773BB26727316006BC038 /* Assets.xcassets */; }; + 016773BF26727316006BC038 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 016773BD26727316006BC038 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 016773AF26727315006BC038 /* WebViewPrebuilt.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WebViewPrebuilt.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 016773B226727315006BC038 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 016773B426727315006BC038 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + 016773B626727315006BC038 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 016773B926727315006BC038 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 016773BB26727316006BC038 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 016773BE26727316006BC038 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 016773C026727316006BC038 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 016773AC26727315006BC038 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 016773A626727314006BC038 = { + isa = PBXGroup; + children = ( + 016773B126727315006BC038 /* WebViewPrebuilt */, + 016773B026727315006BC038 /* Products */, + ); + sourceTree = ""; + }; + 016773B026727315006BC038 /* Products */ = { + isa = PBXGroup; + children = ( + 016773AF26727315006BC038 /* WebViewPrebuilt.app */, + ); + name = Products; + sourceTree = ""; + }; + 016773B126727315006BC038 /* WebViewPrebuilt */ = { + isa = PBXGroup; + children = ( + 016773B226727315006BC038 /* AppDelegate.swift */, + 016773B426727315006BC038 /* SceneDelegate.swift */, + 016773B626727315006BC038 /* ViewController.swift */, + 016773B826727315006BC038 /* Main.storyboard */, + 016773BB26727316006BC038 /* Assets.xcassets */, + 016773BD26727316006BC038 /* LaunchScreen.storyboard */, + 016773C026727316006BC038 /* Info.plist */, + ); + path = WebViewPrebuilt; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 016773AE26727315006BC038 /* WebViewPrebuilt */ = { + isa = PBXNativeTarget; + buildConfigurationList = 016773C326727316006BC038 /* Build configuration list for PBXNativeTarget "WebViewPrebuilt" */; + buildPhases = ( + 016773AB26727315006BC038 /* Sources */, + 016773AC26727315006BC038 /* Frameworks */, + 016773AD26727315006BC038 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WebViewPrebuilt; + productName = WebViewPrebuilt; + productReference = 016773AF26727315006BC038 /* WebViewPrebuilt.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 016773A726727314006BC038 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1250; + LastUpgradeCheck = 1250; + TargetAttributes = { + 016773AE26727315006BC038 = { + CreatedOnToolsVersion = 12.5; + }; + }; + }; + buildConfigurationList = 016773AA26727314006BC038 /* Build configuration list for PBXProject "WebViewPrebuilt" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 016773A626727314006BC038; + productRefGroup = 016773B026727315006BC038 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 016773AE26727315006BC038 /* WebViewPrebuilt */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 016773AD26727315006BC038 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 016773BF26727316006BC038 /* LaunchScreen.storyboard in Resources */, + 016773BC26727316006BC038 /* Assets.xcassets in Resources */, + 016773BA26727315006BC038 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 016773AB26727315006BC038 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 016773B726727315006BC038 /* ViewController.swift in Sources */, + 016773B326727315006BC038 /* AppDelegate.swift in Sources */, + 016773B526727315006BC038 /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 016773B826727315006BC038 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 016773B926727315006BC038 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 016773BD26727316006BC038 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 016773BE26727316006BC038 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 016773C126727316006BC038 /* 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_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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; + 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 = 14.3; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 016773C226727316006BC038 /* 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_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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; + 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 = 14.3; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 016773C426727316006BC038 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = T2S6FJ6R3Q; + INFOPLIST_FILE = WebViewPrebuilt/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.daily.WebViewPrebuilt; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Debug; + }; + 016773C526727316006BC038 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = T2S6FJ6R3Q; + INFOPLIST_FILE = WebViewPrebuilt/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = co.daily.WebViewPrebuilt; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 016773AA26727314006BC038 /* Build configuration list for PBXProject "WebViewPrebuilt" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 016773C126727316006BC038 /* Debug */, + 016773C226727316006BC038 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 016773C326727316006BC038 /* Build configuration list for PBXNativeTarget "WebViewPrebuilt" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 016773C426727316006BC038 /* Debug */, + 016773C526727316006BC038 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 016773A726727314006BC038 /* Project object */; +} diff --git a/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/AppDelegate.swift b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/AppDelegate.swift new file mode 100644 index 0000000..2615d6d --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/AppDelegate.swift @@ -0,0 +1,36 @@ +// +// AppDelegate.swift +// WebViewPrebuilt +// +// Created by Daily on 10/06/2021. +// + +import UIKit + +@main +class AppDelegate: UIResponder, UIApplicationDelegate { + + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + // MARK: UISceneSession Lifecycle + + func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role) + } + + func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. + } + + +} + diff --git a/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Assets.xcassets/AccentColor.colorset/Contents.json b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Assets.xcassets/AppIcon.appiconset/Contents.json b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..9221b9b --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Assets.xcassets/Contents.json b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Base.lproj/LaunchScreen.storyboard b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Base.lproj/Main.storyboard b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Base.lproj/Main.storyboard new file mode 100644 index 0000000..25a7638 --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Info.plist b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Info.plist new file mode 100644 index 0000000..fc514bf --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/Info.plist @@ -0,0 +1,77 @@ + + + + + NSMicrophoneUsageDescription + + NSCameraUsageDescription + + NSAppTransportSecurity + + NSAllowsArbitraryLoadsInWebContent + + NSAllowsArbitraryLoadsForMedia + + + LSApplicationCategoryType + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/SceneDelegate.swift b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/SceneDelegate.swift new file mode 100644 index 0000000..eb3fc73 --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/SceneDelegate.swift @@ -0,0 +1,52 @@ +// +// SceneDelegate.swift +// WebViewPrebuilt +// +// Created by Daily on 10/06/2021. +// + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + guard let _ = (scene as? UIWindowScene) else { return } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/ViewController.swift b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/ViewController.swift new file mode 100644 index 0000000..6652e9c --- /dev/null +++ b/prebuilt-ui/ios-webview/ios-webview/WebViewPrebuilt/ViewController.swift @@ -0,0 +1,68 @@ +// +// ViewController.swift +// WebViewPrebuilt +// +// Created by Daily on 10/06/2021. +// + +import UIKit +import WebKit + +class ViewController: UIViewController { + private var webView: WKWebView? = nil + + override func viewDidLoad() { + super.viewDidLoad() + + let webView = Self.makeWebView() + self.webView = webView + + self.view.addSubview(webView) + webView.translatesAutoresizingMaskIntoConstraints = false + webView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor).isActive = true + webView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor).isActive = true + webView.topAnchor.constraint(equalTo: self.view.topAnchor).isActive = true + webView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true + + let url = URL(string: "[YOUR DAILY ROOM URL HERE]"); + + webView.load(URLRequest(url: url!)); + } + + private static func makeWebView() -> WKWebView { + let webpagePreferences = WKWebpagePreferences() + webpagePreferences.allowsContentJavaScript = true + webpagePreferences.preferredContentMode = .mobile + + let configuration = WKWebViewConfiguration() + + // Make sure the webview's `