-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #258 from humhub/f-internal-63
Add latest userAgent and define applicationNameForUserAgent
- Loading branch information
Showing
12 changed files
with
70 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,8 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_riverpod/flutter_riverpod.dart'; | ||
import 'package:humhub/models/hum_hub.dart'; | ||
import 'package:humhub/util/log.dart'; | ||
import 'package:humhub/util/permission_handler.dart'; | ||
import 'package:humhub/util/storage_service.dart'; | ||
import 'package:loggy/loggy.dart'; | ||
import 'package:package_info_plus/package_info_plus.dart'; | ||
import 'package:permission_handler/permission_handler.dart'; | ||
|
||
main() async { | ||
Loggy.initLoggy( | ||
logPrinter: const GlobalLog(), | ||
); | ||
WidgetsFlutterBinding.ensureInitialized(); | ||
await SecureStorageService.clearSecureStorageOnReinstall(); | ||
PackageInfo packageInfo = await PackageInfo.fromPlatform(); | ||
final app = await HumHub.app(packageInfo.packageName); | ||
await PermissionHandler.requestPermissions( | ||
[ | ||
Permission.notification, | ||
Permission.camera, | ||
Permission.microphone, | ||
Permission.storage, | ||
Permission.photos | ||
], | ||
); | ||
final app = await HumHub.init(); | ||
runApp(ProviderScope(child: app)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import 'package:package_info_plus/package_info_plus.dart'; | ||
|
||
class GlobalPackageInfo { | ||
static late PackageInfo info; | ||
|
||
static Future<void> init() async { | ||
info = await PackageInfo.fromPlatform(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import 'dart:io'; | ||
|
||
class GlobalUserAgent { | ||
static const String _ios = | ||
"Mozilla/5.0 (iPhone; CPU iPhone OS 17_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/131.0.6778.73 Mobile/15E148 Safari/604.1"; | ||
static const String _android = | ||
"Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.6778.81 Mobile Safari/537.36"; | ||
|
||
static String get value { | ||
if (Platform.isIOS) { | ||
return _ios; | ||
} else if (Platform.isAndroid) { | ||
return _android; | ||
} else { | ||
return "Unknown User Agent"; // Fallback for unsupported platforms | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters