Skip to content

Commit

Permalink
Merge pull request #153 from team-telnyx/feat/WEBRTC-2425-splash
Browse files Browse the repository at this point in the history
[iOS] Splash Screen and App Icon Adjustments - WEBRTC-2425
  • Loading branch information
gbattistel authored Jan 17, 2025
2 parents d0fc72f + e67427f commit 4636655
Show file tree
Hide file tree
Showing 42 changed files with 267 additions and 11 deletions.
4 changes: 4 additions & 0 deletions TelnyxRTC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
3BC03B592CC2653700FD2B29 /* TelnyxRTC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B368BEC025EDDB610032AE52 /* TelnyxRTC.framework */; };
3BF1D5842BEB7B8F0097453F /* TelnyxRTC.podspec in Resources */ = {isa = PBXBuildFile; fileRef = 3BF1D5832BEB7B8F0097453F /* TelnyxRTC.podspec */; };
9911247E2CF50092000C23BA /* Dictionary+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9911247D2CF50088000C23BA /* Dictionary+Extensions.swift */; };
991A6D442D3A96C100B29785 /* SplashScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 991A6D432D3A96C100B29785 /* SplashScreen.swift */; };
995BF7132CE7E8F100454076 /* WebRTCEnvironmentExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 995BF7122CE7E8EB00454076 /* WebRTCEnvironmentExtension.swift */; };
995BF7162CE7EB2600454076 /* SipUserCredential.swift in Sources */ = {isa = PBXBuildFile; fileRef = 995BF7152CE7EB2200454076 /* SipUserCredential.swift */; };
995BF71C2CE7EC0600454076 /* SipCredentialsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 995BF71A2CE7EBF800454076 /* SipCredentialsManager.swift */; };
Expand Down Expand Up @@ -155,6 +156,7 @@
7BDD4C7D15E0D900BBC54F25 /* Pods-TelnyxWebRTCDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TelnyxWebRTCDemo.release.xcconfig"; path = "Target Support Files/Pods-TelnyxWebRTCDemo/Pods-TelnyxWebRTCDemo.release.xcconfig"; sourceTree = "<group>"; };
8B61D13D5509735BFDC3E601 /* Pods-TelnyxRTC-TelnyxRTCTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TelnyxRTC-TelnyxRTCTests.release.xcconfig"; path = "Target Support Files/Pods-TelnyxRTC-TelnyxRTCTests/Pods-TelnyxRTC-TelnyxRTCTests.release.xcconfig"; sourceTree = "<group>"; };
9911247D2CF50088000C23BA /* Dictionary+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Dictionary+Extensions.swift"; sourceTree = "<group>"; };
991A6D432D3A96C100B29785 /* SplashScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashScreen.swift; sourceTree = "<group>"; };
995BF7122CE7E8EB00454076 /* WebRTCEnvironmentExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebRTCEnvironmentExtension.swift; sourceTree = "<group>"; };
995BF7152CE7EB2200454076 /* SipUserCredential.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SipUserCredential.swift; sourceTree = "<group>"; };
995BF71A2CE7EBF800454076 /* SipCredentialsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SipCredentialsManager.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -406,6 +408,7 @@
B309D1FB25F028F100A2AADF /* Views */ = {
isa = PBXGroup;
children = (
991A6D432D3A96C100B29785 /* SplashScreen.swift */,
995BF7232CE8471B00454076 /* UISipCredentialHeaderView.swift */,
B309D27A25F17C1700A2AADF /* UIIncomingCallView.xib */,
B309D27925F17C1700A2AADF /* UIIncomingCallView.swift */,
Expand Down Expand Up @@ -946,6 +949,7 @@
B309D25325F071DD00A2AADF /* UICallScreen.swift in Sources */,
B3B8F53726E7D4EF0007B583 /* AppDelegateTelnyxVoIPExtension.swift in Sources */,
B309D27B25F17C1700A2AADF /* UIIncomingCallView.swift in Sources */,
991A6D442D3A96C100B29785 /* SplashScreen.swift in Sources */,
B368BEEF25EDDD060032AE52 /* ViewController.swift in Sources */,
995BF7162CE7EB2600454076 /* SipUserCredential.swift in Sources */,
995BF71C2CE7EC0600454076 /* SipCredentialsManager.swift in Sources */,
Expand Down
16 changes: 12 additions & 4 deletions TelnyxWebRTCDemo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import UIKit
import PushKit
import CallKit
import TelnyxRTC
import SwiftUI

protocol VoIPDelegate: AnyObject {
func onSocketConnected()
Expand Down Expand Up @@ -41,10 +42,17 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let callKitCallController = CXCallController()

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

// Set delegate
let viewController = UIApplication.shared.windows.first?.rootViewController as? ViewController
self.voipDelegate = viewController
// Create and set window
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = UIHostingController(rootView: SplashScreen())
window?.makeKeyAndVisible()

// Set delegate after splash screen transition
DispatchQueue.main.asyncAfter(deadline: .now() + 2.1) {
if let viewController = self.window?.rootViewController?.children.first?.children.first as? ViewController {
self.voipDelegate = viewController
}
}

// Instantiate the Telnyx Client SDK
self.telnyxClient = TxClient()
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
135 changes: 134 additions & 1 deletion TelnyxWebRTCDemo/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1 +1,134 @@
{"images":[{"size":"60x60","expected-size":"180","filename":"180.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"40x40","expected-size":"80","filename":"80.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"40x40","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"60x60","expected-size":"120","filename":"120.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"57x57","expected-size":"57","filename":"57.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"58","filename":"58.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"29x29","expected-size":"29","filename":"29.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"1x"},{"size":"29x29","expected-size":"87","filename":"87.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"57x57","expected-size":"114","filename":"114.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"40","filename":"40.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"2x"},{"size":"20x20","expected-size":"60","filename":"60.png","folder":"Assets.xcassets/AppIcon.appiconset/","idiom":"iphone","scale":"3x"},{"size":"1024x1024","filename":"1024.png","expected-size":"1024","idiom":"ios-marketing","folder":"Assets.xcassets/AppIcon.appiconset/","scale":"1x"}]}
{
"images" : [
{
"filename" : "AppIcon-20@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "AppIcon-20@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "AppIcon-29.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "AppIcon-29@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "AppIcon-29@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "AppIcon-40@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "AppIcon-40@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "AppIcon@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "AppIcon@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "AppIcon-20~ipad.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "AppIcon-20@2x~ipad.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "AppIcon-29~ipad.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "AppIcon-29@2x~ipad.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "AppIcon-40~ipad.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "AppIcon-40@2x~ipad.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "AppIcon~ipad.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "AppIcon@2x~ipad.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "AppIcon-83.5@2x~ipad.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "AppIcon-60@2x~car.png",
"idiom" : "car",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "AppIcon-60@3x~car.png",
"idiom" : "car",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "AppIcon~ios-marketing.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "telnyx-icon.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "telnyx-logo.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
12 changes: 6 additions & 6 deletions TelnyxWebRTCDemo/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="logo-white" translatesAutoresizingMaskIntoConstraints="NO" id="qTo-wL-SLb">
<rect key="frame" x="50" y="398" width="314" height="100"/>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="telnyx-icon" translatesAutoresizingMaskIntoConstraints="NO" id="qTo-wL-SLb">
<rect key="frame" x="157" y="398" width="100" height="100"/>
<constraints>
<constraint firstAttribute="height" constant="100" id="e53-1A-DCx"/>
<constraint firstAttribute="width" constant="100" id="f53-1B-DCx"/>
</constraints>
</imageView>
</subviews>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
<color key="backgroundColor" red="0.11372549019607843" green="0.13333333333333333" blue="0.25490196078431371" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color key="backgroundColor" red="0.0" green="0.89019607843137254" blue="0.6666666666666666" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="qTo-wL-SLb" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="Que-g6-btM"/>
<constraint firstItem="qTo-wL-SLb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="bdm-iO-y2v"/>
<constraint firstItem="qTo-wL-SLb" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="50" id="oL8-1A-2Ml"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="qTo-wL-SLb" secondAttribute="trailing" constant="50" id="rPT-ha-5gZ"/>
<constraint firstItem="qTo-wL-SLb" firstAttribute="width" secondItem="qTo-wL-SLb" secondAttribute="height" multiplier="1:1" id="oL8-1A-2Ml"/>
</constraints>
</view>
</viewController>
Expand All @@ -38,6 +38,6 @@
</scene>
</scenes>
<resources>
<image name="logo-white" width="1000" height="191"/>
<image name="telnyx-icon" width="100" height="100"/>
</resources>
</document>
44 changes: 44 additions & 0 deletions TelnyxWebRTCDemo/SplashScreen.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import SwiftUI

struct SplashScreen: View {
@State private var isActive = false

var body: some View {
if isActive {
// Replace this with your main storyboard view
MainStoryboardView()
} else {
VStack {
Image("telnyx-logo")
.resizable()
.scaledToFit()
.frame(width: 200)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.white)
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
withAnimation {
self.isActive = true
}
}
}
}
}
}

struct MainStoryboardView: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> UIViewController {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let initialViewController = storyboard.instantiateInitialViewController()!
return initialViewController
}

func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
}

struct SplashScreen_Previews: PreviewProvider {
static var previews: some View {
SplashScreen()
}
}
43 changes: 43 additions & 0 deletions TelnyxWebRTCDemo/Views/SplashScreen.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import SwiftUI

struct SplashScreen: View {
@State private var isActive = false

var body: some View {
if isActive {
MainStoryboardView()
} else {
VStack {
Image("telnyx-logo")
.resizable()
.scaledToFit()
.frame(width: 200)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.white)
.onAppear {
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
withAnimation {
self.isActive = true
}
}
}
}
}
}

struct MainStoryboardView: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> UIViewController {
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let initialViewController = storyboard.instantiateInitialViewController()!
return initialViewController
}

func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
}

struct SplashScreen_Previews: PreviewProvider {
static var previews: some View {
SplashScreen()
}
}

0 comments on commit 4636655

Please sign in to comment.