Skip to content

Commit

Permalink
Add demo app google client id
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple committed Oct 12, 2023
1 parent 9358334 commit b84a0f0
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 81 deletions.
8 changes: 4 additions & 4 deletions DemoApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.googleusercontent.apps.347024607410-48j4atipav0tcr4pesap4elr1u9t11uh</string>
<string>$(GOOGLE_CLIENT_ID)</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.347024607410-48j4atipav0tcr4pesap4elr1u9t11uh</string>
<string>$(GOOGLE_CLIENT_ID)</string>
</array>
</dict>
</array>
<key>GIDClientID</key>
<string>$(GOOGLE_CLIENT_ID)</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>GIDClientID</key>
<string>com.googleusercontent.apps.347024607410-48j4atipav0tcr4pesap4elr1u9t11uh</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>NSAppTransportSecurity</key>
Expand Down
4 changes: 2 additions & 2 deletions DemoApp/Resources/GoogleSignIn.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com</string>
<string>$(GOOGLE_CLIENT_ID)</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.347024607410-48j4atipav0tcr4pesap4elr1u9t11uh</string>
<string>$(REVERSED_GOOGLE_CLIENT_ID)</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
Expand Down
3 changes: 2 additions & 1 deletion DemoApp/Sources/Components/AppEnvironment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extension AppEnvironment {
}()

static var googleClientId: String = {
return "347024607410-48j4atipav0tcr4pesap4elr1u9t11uh.apps.googleusercontent.com"
return AppEnvironment.value(for: .GoogleSignIn)!
}()
}

Expand Down Expand Up @@ -115,6 +115,7 @@ extension AppEnvironment {

enum Variable: String {
case JWTExpiration = "JWT_EXPIRATION"
case GoogleSignIn = "REVERSED_GOOGLE_CLIENT_ID"
}

static func contains(_ argument: Argument) -> Bool {
Expand Down
18 changes: 10 additions & 8 deletions DemoApp/Sources/Views/Login/LoginView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,17 @@ struct LoginView: View {
Image(systemName: "person.crop.circle.badge.clock.fill")
}

LoginItemView {
Task {
let credentials = try await GoogleHelper.signIn()
completion(credentials)
if AppEnvironment.value(for: .GoogleSignIn)?.isEmpty == false {
LoginItemView {
Task {
let credentials = try await GoogleHelper.signIn()
completion(credentials)
}
} title: {
Text("Login with Stream account")
} icon: {
Image(systemName: "person.crop.circle.badge.clock.fill")
}
} title: {
Text("Login with Stream account")
} icon: {
Image(systemName: "person.crop.circle.badge.clock.fill")
}

LoginItemView {
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ GEM
bundler
fastlane
pry
fastlane-plugin-stream_actions (0.3.20)
fastlane-plugin-stream_actions (0.3.22)
xctest_list (= 1.2.1)
fastlane-plugin-versioning (0.5.2)
ffi (1.16.2)
Expand Down Expand Up @@ -406,7 +406,7 @@ DEPENDENCIES
fastlane
fastlane-plugin-emerge
fastlane-plugin-lizard
fastlane-plugin-stream_actions (= 0.3.20)
fastlane-plugin-stream_actions (= 0.3.22)
fastlane-plugin-versioning
jazzy
json
Expand Down
59 changes: 1 addition & 58 deletions StreamVideo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3247,7 +3247,6 @@
isa = PBXNativeTarget;
buildConfigurationList = 842D8BD12865B31D00801910 /* Build configuration list for PBXNativeTarget "DemoApp" */;
buildPhases = (
82DE10C72A827B010057BDA8 /* ShellScript */,
842D8BBF2865B31B00801910 /* Sources */,
842D8BC02865B31B00801910 /* Frameworks */,
842D8BC12865B31B00801910 /* Resources */,
Expand Down Expand Up @@ -3299,7 +3298,6 @@
isa = PBXNativeTarget;
buildConfigurationList = 8493225D2908378B0013C029 /* Build configuration list for PBXNativeTarget "DemoAppUIKit" */;
buildPhases = (
82010CAD2A851C06005C125D /* ShellScript */,
84932248290837890013C029 /* Sources */,
84932249290837890013C029 /* Frameworks */,
8493224A290837890013C029 /* Resources */,
Expand Down Expand Up @@ -3347,7 +3345,6 @@
isa = PBXNativeTarget;
buildConfigurationList = 84F737FF287C13AD00A363F4 /* Build configuration list for PBXNativeTarget "StreamVideoTests" */;
buildPhases = (
827297E42A4585EA00774306 /* ShellScript */,
84F737F0287C13AD00A363F4 /* Sources */,
84F737F1287C13AD00A363F4 /* Frameworks */,
84F737F2287C13AD00A363F4 /* Resources */,
Expand Down Expand Up @@ -3664,61 +3661,6 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
82010CAD2A851C06005C125D /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ \"$CONFIGURATION\" == \"Test\" ]; then\n touch \"$SRCROOT/TestTools/Credentials.xcconfig\"\nfi\n";
};
827297E42A4585EA00774306 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ \"$CONFIGURATION\" == \"Test\" ]; then\n touch \"$SRCROOT/TestTools/Credentials.xcconfig\"\nfi\n";
showEnvVarsInLog = 0;
};
82DE10C72A827B010057BDA8 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ \"$CONFIGURATION\" == \"Test\" ]; then\n touch \"$SRCROOT/TestTools/Credentials.xcconfig\"\nfi\n";
};
8434C53A289BBDF30001490A /* SwiftGen */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
Expand Down Expand Up @@ -5208,6 +5150,7 @@
};
842D8BD22865B31D00801910 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 8206D84F2A5DB9300099F5EC /* Credentials.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
Expand Down
39 changes: 39 additions & 0 deletions StreamVideo.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "touch &quot;$SRCROOT/TestTools/Credentials.xcconfig&quot;&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "842D8BC22865B31B00801910"
BuildableName = "StreamVideoCallApp.app"
BlueprintName = "DemoApp"
ReferencedContainer = "container:StreamVideo.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down Expand Up @@ -57,6 +75,15 @@
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "touch &quot;$SRCROOT/TestTools/Credentials.xcconfig&quot;&#10;">
</ActionContent>
</ExecutionAction>
</PreActions>
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
Expand All @@ -67,6 +94,18 @@
ReferencedContainer = "container:StreamVideo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "GOOGLE_CLIENT_ID"
value = "$(GOOGLE_CLIENT_ID)"
isEnabled = "YES">
</EnvironmentVariable>
<EnvironmentVariable
key = "REVERSED_GOOGLE_CLIENT_ID"
value = "$(REVERSED_GOOGLE_CLIENT_ID)"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.3">
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "touch &quot;$SRCROOT/TestTools/Credentials.xcconfig&quot;&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8493224B290837890013C029"
BuildableName = "DemoAppUIKit.app"
BlueprintName = "DemoAppUIKit"
ReferencedContainer = "container:StreamVideo.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
18 changes: 18 additions & 0 deletions StreamVideo.xcodeproj/xcshareddata/xcschemes/StreamVideo.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "touch &quot;$SRCROOT/TestTools/Credentials.xcconfig&quot;&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "84F737EC287C13AC00A363F4"
BuildableName = "StreamVideo.framework"
BlueprintName = "StreamVideo"
ReferencedContainer = "container:StreamVideo.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand Down
18 changes: 14 additions & 4 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ app_secret = ENV.fetch('STREAM_VIDEO_SECRET', nil)
derived_data_path = 'derived_data'
source_packages_path = 'spm_cache'
buildcache_xcargs = 'CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++'
gci = 'com.googleusercontent.apps.347024607410-48j4atipav0tcr4pesap4elr1u9t11uh'
reversed_gci = gci.split('.').tap { |a| a.unshift(a.pop) }.join('.')
is_localhost = !is_ci
@force_check = false

Expand Down Expand Up @@ -85,11 +87,17 @@ lane :match_me do |options|
)
end

lane :swiftui_testflight_build do
upload_beta(app_target: 'DemoApp', app_identifier: 'io.getstream.iOS.VideoDemoApp')
lane :swiftui_testflight_build do |options|
xcargs = options[:configuration] == 'Debug' ? "GOOGLE_CLIENT_ID='#{gci}' REVERSED_GOOGLE_CLIENT_ID=#{reversed_gci}" : nil
upload_beta(
app_target: 'DemoApp',
app_identifier: 'io.getstream.iOS.VideoDemoApp',
configuration: options[:configuration],
xcargs: xcargs
)
end

lane :uikit_testflight_build do
lane :uikit_testflight_build do |options|
upload_beta(app_target: 'DemoAppUIKit', app_identifier: 'io.getstream.iOS.DemoAppUIKit')
end

Expand All @@ -101,7 +109,9 @@ private_lane :upload_beta do |options|
sdk_target: 'StreamVideo',
app_target: options[:app_target],
app_identifier: options[:app_identifier],
extensions: ['CallIntent', 'ScreenSharing']
configuration: options[:configuration] || 'Release',
extensions: ['CallIntent', 'ScreenSharing'],
xcargs: options[:xcargs]
)
end

Expand Down
2 changes: 1 addition & 1 deletion fastlane/Pluginfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gem 'fastlane-plugin-versioning'
gem 'fastlane-plugin-emerge'
gem 'fastlane-plugin-stream_actions', '0.3.20'
gem 'fastlane-plugin-stream_actions', '0.3.22'

0 comments on commit b84a0f0

Please sign in to comment.