Skip to content

Commit

Permalink
Update demo app to use container name
Browse files Browse the repository at this point in the history
  • Loading branch information
louischan-oursky committed Sep 23, 2024
1 parent db61da8 commit 4d1d1b0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions XamarinFormSample/Sample.Shared/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ public async Task ConfigureAsync()
authgear = authgearFactory.CreateAuthgear(
new AuthgearOptions(ClientId, AuthgearEndpoint)
{
Name = "BIOMETRIC",
TokenStorage = tokenStorage,
IsSsoEnabled = IsSsoEnabled,
}
Expand Down
8 changes: 6 additions & 2 deletions flutter-example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ var wechatRedirectURI = "";

const _nativeMethodChannel = MethodChannel("example");

const containerName = "BIOMETRIC";

ColorScheme colorSchemeFromContext(BuildContext context) {
final brightness = MediaQuery.of(context).platformBrightness;
switch (brightness) {
Expand Down Expand Up @@ -240,7 +242,8 @@ class SessionStateButton extends StatelessWidget {
}

class _MyAppState extends State<MyApp> {
Authgear _authgear = Authgear(endpoint: "", clientID: "");
Authgear _authgear =
Authgear(name: containerName, endpoint: "", clientID: "");
late SharedPreferences _sharedPreferences;
final TextEditingController _endpointController = TextEditingController();
final TextEditingController _clientIDController = TextEditingController();
Expand Down Expand Up @@ -842,7 +845,7 @@ class _MyAppState extends State<MyApp> {
Future<void> _onPressConfigure() async {
final packageName = (await PackageInfo.fromPlatform()).packageName;
try {
final result = await migrate(packageName);
final result = await migrate(packageName, containerName);
if (kDebugMode) {
print(result);
}
Expand All @@ -856,6 +859,7 @@ class _MyAppState extends State<MyApp> {
final clientID = _clientIDController.text;

final authgear = Authgear(
name: containerName,
endpoint: endpoint,
clientID: clientID,
isSsoEnabled: _isSsoEnabled,
Expand Down

0 comments on commit 4d1d1b0

Please sign in to comment.