Skip to content

Commit 06fa47e

Browse files
committed
updating example app to authenticate anonymous users
1 parent 1604428 commit 06fa47e

14 files changed

Lines changed: 317 additions & 105 deletions

File tree

backends/carp_webservices/example/android/app/build.gradle

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ android {
1010
ndkVersion = flutter.ndkVersion
1111

1212
compileOptions {
13-
sourceCompatibility JavaVersion.VERSION_1_8
14-
targetCompatibility JavaVersion.VERSION_1_8
13+
sourceCompatibility JavaVersion.VERSION_17
14+
targetCompatibility JavaVersion.VERSION_17
15+
coreLibraryDesugaringEnabled true
1516
}
1617

1718
kotlinOptions {
18-
jvmTarget = JavaVersion.VERSION_1_8
19+
jvmTarget = JavaVersion.VERSION_17
1920
}
2021

2122
sourceSets {
@@ -52,3 +53,7 @@ android {
5253
flutter {
5354
source '../..'
5455
}
56+
57+
dependencies {
58+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
59+
}

backends/carp_webservices/example/android/app/src/main/AndroidManifest.xml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
xmlns:tools="http://schemas.android.com/tools">
33

4-
<uses-permission android:name="android.permission.INTERNET"/>
4+
<uses-permission android:name="android.permission.INTERNET" />
5+
<uses-permission android:name="android.permission.CAMERA" />
56

6-
<application
7-
android:name="${applicationName}"
8-
android:label="CAWS Example"
9-
android:fullBackupContent="@xml/backup_rules"
10-
android:dataExtractionRules="@xml/data_extraction_rules"
11-
android:icon="@mipmap/ic_launcher">
7+
<application
8+
android:name="${applicationName}"
9+
android:label="CAWS Example"
10+
android:fullBackupContent="@xml/backup_rules"
11+
android:dataExtractionRules="@xml/data_extraction_rules"
12+
android:icon="@mipmap/ic_launcher">
1213

1314
<!-- Used by authentication redirect to/from web view -->
1415
<activity
@@ -63,6 +64,17 @@
6364
</intent-filter>
6465
</activity>
6566

67+
<activity
68+
android:name="com.linusu.flutter_web_auth_2.CallbackActivity"
69+
android:exported="true">
70+
<intent-filter android:label="flutter_web_auth_2">
71+
<action android:name="android.intent.action.VIEW" />
72+
<category android:name="android.intent.category.DEFAULT" />
73+
<category android:name="android.intent.category.BROWSABLE" />
74+
<data android:scheme="caws-example-app" android:pathPrefix="/" />
75+
</intent-filter>
76+
</activity>
77+
6678
<!-- Don't delete the meta-data below.
6779
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
6880
<meta-data

backends/carp_webservices/example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip

backends/carp_webservices/example/android/settings.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ pluginManagement {
1717
}
1818

1919
plugins {
20-
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21-
id "com.android.application" version "8.1.0" apply false
22-
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.2"
21+
id "com.android.application" version "8.9.0" apply false
22+
id "org.jetbrains.kotlin.android" version "2.1.0" apply false
2323
}
2424

2525
include ":app"

backends/carp_webservices/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>12.0</string>
24+
<string>13.0</string>
2525
</dict>
2626
</plist>

backends/carp_webservices/example/ios/Podfile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '12.0'
2+
platform :ios, '14.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -37,6 +37,13 @@ target 'Runner' do
3737
end
3838

3939
post_install do |installer|
40+
installer.generated_projects.each do |project|
41+
project.targets.each do |target|
42+
target.build_configurations.each do |config|
43+
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
44+
end
45+
end
46+
end
4047
installer.pods_project.targets.each do |target|
4148
flutter_additional_ios_build_settings(target)
4249
end

backends/carp_webservices/example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 83 additions & 63 deletions
Large diffs are not rendered by default.

backends/carp_webservices/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
buildConfiguration = "Debug"
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
2930
shouldUseLaunchSchemeArgsEnv = "YES">
3031
<MacroExpansion>
3132
<BuildableReference
@@ -54,11 +55,13 @@
5455
buildConfiguration = "Debug"
5556
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
5657
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
58+
customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit"
5759
launchStyle = "0"
5860
useCustomWorkingDirectory = "NO"
5961
ignoresPersistentStateOnLaunch = "NO"
6062
debugDocumentVersioning = "YES"
6163
debugServiceExtension = "internal"
64+
enableGPUValidationMode = "1"
6265
allowLocationSimulation = "YES">
6366
<BuildableProductRunnable
6467
runnableDebuggingMode = "0">

backends/carp_webservices/example/ios/Runner/AppDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import UIKit
22
import Flutter
33

4-
@UIApplicationMain
4+
@main
55
@objc class AppDelegate: FlutterAppDelegate {
66
override func application(
77
_ application: UIApplication,

backends/carp_webservices/example/ios/Runner/Info.plist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,12 @@
5353
<key>CFBundleURLSchemes</key>
5454
<array>
5555
<string>dk.cachet.example</string>
56+
<string>caws-example-app-auth</string>
57+
<string>caws-example-app</string>
5658
</array>
5759
</dict>
5860
</array>
61+
<key>NSCameraUsageDescription</key>
62+
<string>CARP uses the camera to take pictures and/or videos for some tasks</string>
5963
</dict>
6064
</plist>

0 commit comments

Comments
 (0)