Skip to content

Commit e84accd

Browse files
authored
Merge pull request #61 from Web3Auth/bump-iOS-sdk
Fix sessionTime issue of always being default
2 parents 3927eb4 + 1b6294d commit e84accd

File tree

5 files changed

+122
-103
lines changed

5 files changed

+122
-103
lines changed

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>11.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

example/ios/Podfile.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PODS:
22
- BigInt (5.0.0)
3-
- CryptoSwift (1.8.0)
3+
- CryptoSwift (1.8.1)
44
- Flutter (1.0.0)
55
- GenericJSON (2.0.2)
66
- KeychainSwift (20.0.0)
@@ -15,14 +15,14 @@ PODS:
1515
- GenericJSON (~> 2.0)
1616
- Logging (~> 1.0.0)
1717
- secp256k1.swift (~> 0.1)
18-
- Web3Auth (7.4.0):
18+
- Web3Auth (7.5.0):
1919
- CryptoSwift (~> 1.8.0)
2020
- KeychainSwift (~> 20.0.0)
2121
- TorusSessionManager (~> 3.0.1)
2222
- web3.swift (~> 1.6.0)
23-
- web3auth_flutter (2.0.0):
23+
- web3auth_flutter (2.0.1):
2424
- Flutter
25-
- Web3Auth (~> 7.4.0)
25+
- Web3Auth (~> 7.5.0)
2626

2727
DEPENDENCIES:
2828
- Flutter (from `Flutter`)
@@ -48,17 +48,17 @@ EXTERNAL SOURCES:
4848

4949
SPEC CHECKSUMS:
5050
BigInt: 74b4d88367b0e819d9f77393549226d36faeb0d8
51-
CryptoSwift: 52aaf3fce7337552863b1d952e408085f0e65030
52-
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
51+
CryptoSwift: b9c701d6f5011df23794dbf7f2e480a77835d83d
52+
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
5353
GenericJSON: 79a840eeb77030962e8cf02a62d36bd413b67626
5454
KeychainSwift: 0ce6a4d13f7228054d1a71bb1b500448fb2ab837
5555
Logging: 9ef4ecb546ad3169398d5a723bc9bea1c46bef26
5656
secp256k1.swift: a7e7a214f6db6ce5db32cc6b2b45e5c4dd633634
5757
TorusSessionManager: 829495789427b7ad7e29f2b535092a44f3900b42
5858
web3.swift: 2263d1e12e121b2c42ffb63a5a7beb1acaf33959
59-
Web3Auth: 3d269bd583e7209961bf8752f3d52f70fc1689ae
60-
web3auth_flutter: 776a8ad6436005de9072c0645473c688065c90ed
59+
Web3Auth: ebfbcefa4d343c93ec1df88e50f74a115125e833
60+
web3auth_flutter: 5a6ca40dc689af62523a9f00924c884fa3788276
6161

6262
PODFILE CHECKSUM: 1d58595b82b880200a7ded05da9181d30ef8c1b7
6363

64-
COCOAPODS: 1.14.2
64+
COCOAPODS: 1.14.3

example/lib/main.dart

Lines changed: 49 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dart:async';
22
import 'dart:collection';
3+
import 'dart:developer';
34
import 'dart:io';
45

56
import 'package:flutter/material.dart';
@@ -16,7 +17,7 @@ class MyApp extends StatefulWidget {
1617
const MyApp({Key? key}) : super(key: key);
1718

1819
@override
19-
_MyAppState createState() => _MyAppState();
20+
State<MyApp> createState() => _MyAppState();
2021
}
2122

2223
class _MyAppState extends State<MyApp> {
@@ -45,22 +46,26 @@ class _MyAppState extends State<MyApp> {
4546
throw UnKnownException('Unknown platform');
4647
}
4748

48-
await Web3AuthFlutter.init(Web3AuthOptions(
49+
await Web3AuthFlutter.init(
50+
Web3AuthOptions(
4951
clientId:
5052
'BHgArYmWwSeq21czpcarYh0EVq2WWOzflX-NTK-tY1-1pauPzHKRRLgpABkmYiIV_og9jAvoIxQ8L3Smrwe04Lw',
5153
network: Network.sapphire_devnet,
5254
buildEnv: BuildEnv.testing,
5355
redirectUrl: redirectUrl,
5456
whiteLabel: WhiteLabelData(
55-
mode: ThemeModes.dark,
56-
defaultLanguage: Language.en,
57-
appName: "Web3Auth Flutter App",
58-
theme: themeMap)));
57+
mode: ThemeModes.dark,
58+
defaultLanguage: Language.en,
59+
appName: "Web3Auth Flutter App",
60+
theme: themeMap,
61+
),
62+
),
63+
);
5964

6065
await Web3AuthFlutter.initialize();
6166

6267
final String res = await Web3AuthFlutter.getPrivKey();
63-
print(res);
68+
log(res);
6469
if (res.isNotEmpty) {
6570
setState(() {
6671
logoutVisible = true;
@@ -123,22 +128,26 @@ class _MyAppState extends State<MyApp> {
123128
height: 20,
124129
),
125130
ElevatedButton(
126-
onPressed: _login(_withGoogle),
127-
child: const Text('Google')),
131+
onPressed: _login(_withGoogle),
132+
child: const Text('Google'),
133+
),
128134
ElevatedButton(
129-
onPressed: _login(_withFacebook),
130-
child: const Text('Facebook')),
135+
onPressed: _login(_withFacebook),
136+
child: const Text('Facebook'),
137+
),
131138
ElevatedButton(
132-
onPressed: _login(_withEmailPasswordless),
133-
child: const Text('Email Passwordless')),
139+
onPressed: _login(_withEmailPasswordless),
140+
child: const Text('Email Passwordless'),
141+
),
134142
ElevatedButton(
135-
onPressed: _login(_withDiscord),
136-
child: const Text('Discord')),
143+
onPressed: _login(_withDiscord),
144+
child: const Text('Discord'),
145+
),
137146
],
138147
),
139148
),
140149
Visibility(
141-
// ignore: sort_child_properties_last
150+
visible: logoutVisible,
142151
child: Column(
143152
children: [
144153
Center(
@@ -155,14 +164,15 @@ class _MyAppState extends State<MyApp> {
155164
)),
156165
),
157166
ElevatedButton(
158-
onPressed: _privKey(_getPrivKey),
159-
child: const Text('Get PrivKey')),
167+
onPressed: _privKey(_getPrivKey),
168+
child: const Text('Get PrivKey'),
169+
),
160170
ElevatedButton(
161-
onPressed: _userInfo(_getUserInfo),
162-
child: const Text('Get UserInfo')),
171+
onPressed: _userInfo(_getUserInfo),
172+
child: const Text('Get UserInfo'),
173+
),
163174
],
164175
),
165-
visible: logoutVisible,
166176
),
167177
Padding(
168178
padding: const EdgeInsets.all(8.0),
@@ -178,14 +188,14 @@ class _MyAppState extends State<MyApp> {
178188
VoidCallback _login(Future<Web3AuthResponse> Function() method) {
179189
return () async {
180190
try {
181-
final Web3AuthResponse response = await method();
191+
final Web3AuthResponse _ = await method();
182192
setState(() {
183193
logoutVisible = true;
184194
});
185195
} on UserCancelledException {
186-
print("User cancelled.");
196+
log("User cancelled.");
187197
} on UnKnownException {
188-
print("Unknown exception occurred");
198+
log("Unknown exception occurred");
189199
}
190200
};
191201
}
@@ -199,9 +209,9 @@ class _MyAppState extends State<MyApp> {
199209
logoutVisible = false;
200210
});
201211
} on UserCancelledException {
202-
print("User cancelled.");
212+
log("User cancelled.");
203213
} on UnKnownException {
204-
print("Unknown exception occurred");
214+
log("Unknown exception occurred");
205215
}
206216
};
207217
}
@@ -215,9 +225,9 @@ class _MyAppState extends State<MyApp> {
215225
logoutVisible = true;
216226
});
217227
} on UserCancelledException {
218-
print("User cancelled.");
228+
log("User cancelled.");
219229
} on UnKnownException {
220-
print("Unknown exception occurred");
230+
log("Unknown exception occurred");
221231
}
222232
};
223233
}
@@ -231,26 +241,32 @@ class _MyAppState extends State<MyApp> {
231241
logoutVisible = true;
232242
});
233243
} on UserCancelledException {
234-
print("User cancelled.");
244+
log("User cancelled.");
235245
} on UnKnownException {
236-
print("Unknown exception occurred");
246+
log("Unknown exception occurred");
237247
}
238248
};
239249
}
240250

241251
Future<Web3AuthResponse> _withGoogle() {
242252
return Web3AuthFlutter.login(
243-
LoginParams(loginProvider: Provider.google, mfaLevel: MFALevel.NONE));
253+
LoginParams(loginProvider: Provider.google, mfaLevel: MFALevel.NONE),
254+
);
244255
}
245256

246257
Future<Web3AuthResponse> _withFacebook() {
247258
return Web3AuthFlutter.login(LoginParams(loginProvider: Provider.facebook));
248259
}
249260

250261
Future<Web3AuthResponse> _withEmailPasswordless() {
251-
return Web3AuthFlutter.login(LoginParams(
262+
return Web3AuthFlutter.login(
263+
LoginParams(
252264
loginProvider: Provider.email_passwordless,
253-
extraLoginOptions: ExtraLoginOptions(login_hint: "[email protected]")));
265+
extraLoginOptions: ExtraLoginOptions(
266+
login_hint: "[email protected]",
267+
),
268+
),
269+
);
254270
}
255271

256272
Future<Web3AuthResponse> _withDiscord() {

ios/web3auth_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Flutter SDK for Torus Web3Auth (OpenLogin)
1515
s.source = { :path => '.' }
1616
s.source_files = 'Classes/**/*'
1717
s.dependency 'Flutter'
18-
s.dependency 'Web3Auth', '~> 7.4.1'
18+
s.dependency 'Web3Auth', '~> 7.5.0'
1919
s.platform = :ios, '14.0'
2020

2121
# Flutter.framework does not contain a i386 slice.

0 commit comments

Comments
 (0)