Skip to content

Commit 89cce71

Browse files
Merge pull request #16 from Mobile-Telematics/update
Flutter plugin v0.2.0
2 parents be0d7f8 + f8dc0eb commit 89cce71

31 files changed

+1624
-277
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.2.0
4+
5+
* Migrate to dart 3+
6+
* Updated Android sdk version to 2.2.260
7+
* Updated iOS sdk version to 6.6.0
8+
39
## 0.1.1
410

511
* Updated Android sdk version to 2.2.253

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ add network permissions
8080
```groovy
8181
dependencies {
8282
//...
83-
implementation "com.telematicssdk:tracking: 2.2.253"
83+
implementation "com.telematicssdk:tracking:2.2.260"
8484
}
8585
```
8686

android/build.gradle

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
group 'com.telematicssdk'
2-
version '1.0-SNAPSHOT'
2+
version '2.0-SNAPSHOT'
33

44
buildscript {
5-
ext.kotlin_version = '1.4.31'
6-
ext.raxel_tracking = '2.2.253'
5+
ext.kotlin_version = '1.9.0'
6+
ext.raxel_tracking = '2.2.260'
77
repositories {
88
google()
99
jcenter()
1010
}
1111

1212
dependencies {
1313
//noinspection GradleDependency
14-
classpath 'com.android.tools.build:gradle:3.5.0'
14+
classpath 'com.android.tools.build:gradle:8.2.2'
1515
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1616
}
1717
}
@@ -30,18 +30,23 @@ apply plugin: 'com.android.library'
3030
apply plugin: 'kotlin-android'
3131

3232
android {
33-
compileSdkVersion 30
34-
33+
compileSdkVersion 34
34+
namespace "com.telematicssdk"
3535
sourceSets {
3636
main.java.srcDirs += 'src/main/kotlin'
3737
}
3838
defaultConfig {
39-
minSdkVersion 18
39+
minSdkVersion 24
4040
// javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true
4141
}
4242
lintOptions {
4343
disable 'InvalidPackage'
4444
}
45+
46+
compileOptions {
47+
sourceCompatibility JavaVersion.VERSION_17
48+
targetCompatibility JavaVersion.VERSION_17
49+
}
4550
}
4651

4752
dependencies {

android/gradle/wrapper/gradle-wrapper.properties

+1-1
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-5.6.2-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip

android/src/main/AndroidManifest.xml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools"
3-
package="com.telematicssdk">
2+
xmlns:tools="http://schemas.android.com/tools">
43

54
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
65
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

android/src/main/kotlin/com/telematicssdk/TelematicsSDKPlugin.kt

+16-10
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,10 @@ class TelematicsSDKPlugin : ActivityAware, ActivityResultListener, FlutterPlugin
8282
"isTracking" -> isTracking(result)
8383
"setDeviceID" -> setDeviceID(call, result)
8484
"setEnableSdk" -> setEnableSdk(call, result)
85-
"startTracking" -> startTracking(result)
86-
"stopTracking" -> stopTracking(result)
85+
"setDisableWithUpload" -> setDisableWithUpload(result)
86+
"startManualTracking" -> startManualTracking(result)
87+
"stopManualTracking" -> stopManualTracking(result)
88+
"enableHF" -> enableHF(call, result)
8789
"showPermissionWizard" -> showPermissionWizard(call, result)
8890
"getTrackTags" -> getTrackTags(call, result)
8991
"addTrackTags" -> addTrackTags(call, result)
@@ -156,23 +158,27 @@ class TelematicsSDKPlugin : ActivityAware, ActivityResultListener, FlutterPlugin
156158

157159
private fun setEnableSdk(call: MethodCall, result: Result) {
158160
val enable = call.argument<Boolean?>("enable") as Boolean
159-
val uploadBeforeDisabling = call.argument<Boolean?>("uploadBeforeDisabling") as Boolean
161+
api.setEnableSdk(enable)
162+
result.success(null)
163+
}
164+
private fun enableHF(call: MethodCall, result: Result) {
165+
val enable = call.argument<Boolean?>("enableHF") as Boolean
166+
api.setHfRecordingEnabled(enable)
167+
result.success(null)
168+
}
160169

161-
if (!enable && uploadBeforeDisabling) {
162-
api.setDisableWithUpload()
163-
} else {
164-
api.setEnableSdk(enable)
165-
}
170+
private fun setDisableWithUpload(result: Result) {
171+
api.setDisableWithUpload()
166172
result.success(null)
167173
}
168174

169-
private fun startTracking(result: Result) {
175+
private fun startManualTracking(result: Result) {
170176
val startResult = api.startTracking()
171177

172178
result.success(startResult)
173179
}
174180

175-
private fun stopTracking(result: Result) {
181+
private fun stopManualTracking(result: Result) {
176182
val stopResult = api.stopTracking()
177183

178184
result.success(stopResult)

example/android/app/build.gradle

+10-5
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ apply plugin: 'kotlin-android'
2626
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
2727

2828
android {
29-
compileSdkVersion 30
30-
29+
compileSdkVersion 34
30+
namespace "com.telematicssdk.example"
3131
sourceSets {
3232
main.java.srcDirs += 'src/main/kotlin'
3333
}
@@ -39,12 +39,17 @@ android {
3939
defaultConfig {
4040
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4141
applicationId "com.telematicssdk.example"
42-
minSdkVersion 18
43-
targetSdkVersion 30
42+
minSdkVersion 24
43+
targetSdkVersion 34
4444
versionCode flutterVersionCode.toInteger()
4545
versionName flutterVersionName
4646
}
4747

48+
compileOptions {
49+
sourceCompatibility JavaVersion.VERSION_17
50+
targetCompatibility JavaVersion.VERSION_17
51+
}
52+
4853
buildTypes {
4954
release {
5055
// TODO: Add your own signing config for the release build.
@@ -63,5 +68,5 @@ flutter {
6368

6469
dependencies {
6570
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
66-
implementation "com.telematicssdk:tracking:2.2.231"
71+
implementation "com.telematicssdk:tracking:2.2.260"
6772
}

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
xmlns:tools="http://schemas.android.com/tools"
3-
package="com.telematicssdk.example">
2+
xmlns:tools="http://schemas.android.com/tools">
43
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
54
calls FlutterMain.startInitialization(this); in its onCreate method.
65
In most cases you can leave this as-is, but you if you want to provide
@@ -21,7 +20,8 @@
2120
android:hardwareAccelerated="true"
2221
android:launchMode="singleTop"
2322
android:theme="@style/LaunchTheme"
24-
android:windowSoftInputMode="adjustResize">
23+
android:windowSoftInputMode="adjustResize"
24+
android:exported="true">
2525
<!-- Specifies an Android theme to apply to this Activity as soon as
2626
the Android process has started. This theme is visible to the user
2727
while the Flutter UI initializes. After that, this theme continues

example/android/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
buildscript {
2-
ext.kotlin_version = '1.4.31'
2+
ext.kotlin_version = '1.9.0'
33
repositories {
44
google()
55
jcenter()
66
}
77

88
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.1.1'
9+
classpath 'com.android.tools.build:gradle:8.2.2'
1010
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1111
}
1212
}
@@ -26,6 +26,6 @@ subprojects {
2626
project.evaluationDependsOn(':app')
2727
}
2828

29-
task clean(type: Delete) {
29+
tasks.register("clean", Delete) {
3030
delete rootProject.buildDir
3131
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu Jan 14 12:59:58 MSK 2021
1+
#Thu Oct 26 11:15:05 MSK 2023
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

example/ios/Flutter/AppFrameworkInfo.plist

+1-1
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>10.3</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

example/ios/Podfile

+4-1
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, '10.0'
2+
platform :ios, '12.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -37,5 +37,8 @@ end
3737
post_install do |installer|
3838
installer.pods_project.targets.each do |target|
3939
flutter_additional_ios_build_settings(target)
40+
target.build_configurations.each do |config|
41+
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
42+
end
4043
end
4144
end

0 commit comments

Comments
 (0)