Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ class ViewModel: ObservableObject {
redirectUrl: "web3auth.ios-aggregate-example://auth",
loginConfig: [
TypeOfLogin.google.rawValue:
.init(
verifier: "aggregate-sapphire",
typeOfLogin: .google,
name: "Web3Auth-Aggregate-Verifier-Google-Example",
clientId: "519228911939-cri01h55lsjbsia1k7ll6qpalrus75ps.apps.googleusercontent.com",
verifierSubIdentifier: "w3a-google"
)
.init(
verifier: "aggregate-sapphire",
typeOfLogin: .google,
name: "Web3Auth-Aggregate-Verifier-Google-Example",
clientId: "519228911939-cri01h55lsjbsia1k7ll6qpalrus75ps.apps.googleusercontent.com",
verifierSubIdentifier: "w3a-google"
),
TypeOfLogin.jwt.rawValue:
.init(
verifier: "aggregate-sapphire",
typeOfLogin: .jwt,
name: "Web3Auth-Aggregate-Verifier-GitHub-Example",
clientId: "hiLqaop0amgzCC0AXo4w0rrG9abuJTdu",
verifierSubIdentifier: "w3a-a0-github"
)
],
whiteLabel: W3AWhiteLabelData(
appName: "Web3Auth Stub",
logoLight: "https://images.web3auth.io/web3auth-logo-w.svg",
logoDark: "https://images.web3auth.io/web3auth-logo-w.svg",
defaultLanguage: .en, // en, de, ja, ko, zh, es, fr, pt, nl
mode: .dark,
theme: ["primary": "#d53f8c"]
),
mfaSettings: MfaSettings(
deviceShareFactor: MfaSetting(enable: true, priority: 1),
backUpShareFactor: MfaSetting(enable: true, priority: 2),
Expand All @@ -56,18 +56,16 @@ class ViewModel: ObservableObject {
navigationTitle = loggedIn ? "UserInfo" : "Agg-Verifier Example"
})
}

func loginWithGoogle() {
Task{
do {
let result = try await web3Auth?.login(
W3ALoginParams(
loginProvider: .GOOGLE,
dappShare: nil,
extraLoginOptions: ExtraLoginOptions(display: nil, prompt: nil, max_age: nil, ui_locales: nil, id_token_hint: nil, id_token: nil, login_hint: nil, acr_values: nil, scope: nil, audience: nil, connection: nil, domain: nil, client_id: nil, redirect_uri: nil, leeway: nil, verifierIdField: nil, isVerifierIdCaseSensitive: nil, additionalParams: nil),
mfaLevel: .DEFAULT,
curve: .SECP256K1
))
W3ALoginParams(
loginProvider: .GOOGLE,
dappShare: nil,
extraLoginOptions: ExtraLoginOptions(display: nil, prompt: nil, max_age: nil, ui_locales: nil, id_token_hint: nil, id_token: nil, login_hint: nil, acr_values: nil, scope: nil, audience: nil, connection: nil, domain: nil, client_id: nil, redirect_uri: nil, leeway: nil, verifierIdField: nil, isVerifierIdCaseSensitive: nil, additionalParams: nil)
))
await MainActor.run(body: {
user = result
loggedIn = true
Expand All @@ -83,11 +81,9 @@ class ViewModel: ObservableObject {
do {
let result = try await web3Auth?.login(
W3ALoginParams(
loginProvider: .JWT,
dappShare: nil,
extraLoginOptions: ExtraLoginOptions(display: nil, prompt: nil, max_age: nil, ui_locales: nil, id_token_hint: nil, id_token: nil, login_hint: nil, acr_values: nil, scope: nil, audience: nil, connection: "github", domain: "https://web3auth.au.auth0.com", client_id: nil, redirect_uri: nil, leeway: nil, verifierIdField: "email", isVerifierIdCaseSensitive: false, additionalParams: nil),
mfaLevel: .DEFAULT,
curve: .SECP256K1
loginProvider: .JWT,
dappShare: nil,
extraLoginOptions: ExtraLoginOptions(display: nil, prompt: nil, max_age: nil, ui_locales: nil, id_token_hint: nil, id_token: nil, login_hint: nil, acr_values: nil, scope: nil, audience: nil, connection: "github", domain: "https://web3auth.au.auth0.com", client_id: nil, redirect_uri: nil, leeway: nil, verifierIdField: "email", isVerifierIdCaseSensitive: false, additionalParams: nil)
))
await MainActor.run(body: {
user = result
Expand Down
Binary file not shown.
11 changes: 2 additions & 9 deletions ios/ios-firebase-example/ios-firebase-example/ViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class ViewModel: ObservableObject {
})

web3Auth = try await Web3Auth(W3AInitParams(
clientId: clientId, network: network,
buildEnv: .testing,
clientId: clientId,
network: network,
redirectUrl: "web3auth.ios-firebase-example://auth",
loginConfig: [
TypeOfLogin.jwt.rawValue:
Expand All @@ -32,13 +32,6 @@ class ViewModel: ObservableObject {
clientId: self.clientId
)
],
whiteLabel: W3AWhiteLabelData(
appName: "Web3Auth Stub",
logoLight: "https://images.toruswallet.io/sol.svg",
logoDark: "https://images.toruswallet.io/sol.svg",
defaultLanguage: .en, // en, de, ja, ko, zh, es, fr, pt, nl
theme: ["primary": "#d53f8c"]
),
mfaSettings: MfaSettings(
deviceShareFactor: MfaSetting(enable: true, priority: 1),
backUpShareFactor: MfaSetting(enable: true, priority: 2),
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D8FF827294339F100AB4F51"
BuildableName = "ios-example.app"
BlueprintName = "ios-example"
ReferencedContainer = "container:ios-example.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D8FF827294339F100AB4F51"
BuildableName = "ios-example.app"
BlueprintName = "ios-example"
ReferencedContainer = "container:ios-example.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4D8FF827294339F100AB4F51"
BuildableName = "ios-example.app"
BlueprintName = "ios-example"
ReferencedContainer = "container:ios-example.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
30 changes: 15 additions & 15 deletions ios/ios-solana-example/ios-solana-example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
2833BEE82BD6383C00243B09 /* SolanaSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 2833BEE72BD6383C00243B09 /* SolanaSwift */; };
2833BEEB2BD6384800243B09 /* Web3Auth in Frameworks */ = {isa = PBXBuildFile; productRef = 2833BEEA2BD6384800243B09 /* Web3Auth */; };
285651362B8A555900796F67 /* ios_solana_exampleApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 285651352B8A555900796F67 /* ios_solana_exampleApp.swift */; };
285651382B8A555900796F67 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 285651372B8A555900796F67 /* ContentView.swift */; };
Expand All @@ -16,6 +15,7 @@
285651472B8A555A00796F67 /* ios_solana_exampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 285651462B8A555A00796F67 /* ios_solana_exampleTests.swift */; };
285651512B8A555A00796F67 /* ios_solana_exampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 285651502B8A555A00796F67 /* ios_solana_exampleUITests.swift */; };
285651532B8A555A00796F67 /* ios_solana_exampleUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 285651522B8A555A00796F67 /* ios_solana_exampleUITestsLaunchTests.swift */; };
28C341892CB4017F00360382 /* SolanaSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 28C341882CB4017F00360382 /* SolanaSwift */; };
28DFB2C42B8C3EFA005DDCB6 /* Web3AuthHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28DFB2C32B8C3EFA005DDCB6 /* Web3AuthHelper.swift */; };
28DFB2C62B8C4D7A005DDCB6 /* ViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28DFB2C52B8C4D7A005DDCB6 /* ViewModel.swift */; };
28DFB2C82B8C4F53005DDCB6 /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28DFB2C72B8C4F53005DDCB6 /* LoginView.swift */; };
Expand Down Expand Up @@ -63,7 +63,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2833BEE82BD6383C00243B09 /* SolanaSwift in Frameworks */,
28C341892CB4017F00360382 /* SolanaSwift in Frameworks */,
2833BEEB2BD6384800243B09 /* Web3Auth in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -187,8 +187,8 @@
);
name = "ios-solana-example";
packageProductDependencies = (
2833BEE72BD6383C00243B09 /* SolanaSwift */,
2833BEEA2BD6384800243B09 /* Web3Auth */,
28C341882CB4017F00360382 /* SolanaSwift */,
);
productName = "ios-solana-example";
productReference = 285651322B8A555900796F67 /* ios-solana-example.app */;
Expand Down Expand Up @@ -263,8 +263,8 @@
);
mainGroup = 285651292B8A555900796F67;
packageReferences = (
2833BEE62BD6383C00243B09 /* XCRemoteSwiftPackageReference "solana-swift" */,
2833BEE92BD6384800243B09 /* XCRemoteSwiftPackageReference "web3auth-swift-sdk" */,
28C341872CB4017F00360382 /* XCRemoteSwiftPackageReference "solana-swift" */,
);
productRefGroup = 285651332B8A555900796F67 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -646,35 +646,35 @@
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
2833BEE62BD6383C00243B09 /* XCRemoteSwiftPackageReference "solana-swift" */ = {
2833BEE92BD6384800243B09 /* XCRemoteSwiftPackageReference "web3auth-swift-sdk" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/p2p-org/solana-swift.git";
repositoryURL = "https://github.com/Web3Auth/web3auth-swift-sdk/";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 5.0.0;
minimumVersion = 9.0.0;
};
};
2833BEE92BD6384800243B09 /* XCRemoteSwiftPackageReference "web3auth-swift-sdk" */ = {
28C341872CB4017F00360382 /* XCRemoteSwiftPackageReference "solana-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/Web3Auth/web3auth-swift-sdk/";
repositoryURL = "https://github.com/p2p-org/solana-swift.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 9.0.0;
minimumVersion = 5.0.0;
};
};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
2833BEE72BD6383C00243B09 /* SolanaSwift */ = {
isa = XCSwiftPackageProductDependency;
package = 2833BEE62BD6383C00243B09 /* XCRemoteSwiftPackageReference "solana-swift" */;
productName = SolanaSwift;
};
2833BEEA2BD6384800243B09 /* Web3Auth */ = {
isa = XCSwiftPackageProductDependency;
package = 2833BEE92BD6384800243B09 /* XCRemoteSwiftPackageReference "web3auth-swift-sdk" */;
productName = Web3Auth;
};
28C341882CB4017F00360382 /* SolanaSwift */ = {
isa = XCSwiftPackageProductDependency;
package = 28C341872CB4017F00360382 /* XCRemoteSwiftPackageReference "solana-swift" */;
productName = SolanaSwift;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 2856512A2B8A555900796F67 /* Project object */;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.