Skip to content

Commit

Permalink
Updated iOS SDK to v6.0.5 and Android SDK to v2.2.263. Added startMan…
Browse files Browse the repository at this point in the history
…ualPersistentTracking method.
  • Loading branch information
sgusakovsky committed Oct 25, 2024
1 parent b111739 commit 96e79ef
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 37 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.2.5

* Updated iOS sdk version to 6.0.5
* Updated Android sdk version to 2.2.263
*
## 0.2.4

* Updated iOS sdk version to 6.0.4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ add to file (module)/build.gradle props:
```groovy
dependencies {
//...
implementation "com.telematicssdk:tracking:2.2.262"
implementation "com.telematicssdk:tracking:2.2.263"
}
```

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version '2.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.9.0'
ext.raxel_tracking = '2.2.262'
ext.raxel_tracking = '2.2.263'
repositories {
google()
jcenter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class TelematicsSDKPlugin : ActivityAware, ActivityResultListener, FlutterPlugin
"setEnableSdk" -> setEnableSdk(call, result)
"setDisableWithUpload" -> setDisableWithUpload(result)
"startManualTracking" -> startManualTracking(result)
"startManualPersistentTracking" -> startManualPersistentTracking(result)
"stopManualTracking" -> stopManualTracking(result)
"enableHF" -> enableHF(call, result)
"showPermissionWizard" -> showPermissionWizard(call, result)
Expand Down Expand Up @@ -178,6 +179,12 @@ class TelematicsSDKPlugin : ActivityAware, ActivityResultListener, FlutterPlugin
result.success(startResult)
}

private fun startManualPersistentTracking(result: Result) {
val startResult = api.startPersistentTracking()

result.success(startResult)
}

private fun stopManualTracking(result: Result) {
val stopResult = api.stopTracking()

Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ flutter {
}

dependencies {
implementation "com.telematicssdk:tracking:2.2.262"
implementation "com.telematicssdk:tracking:2.2.263"
}
60 changes: 30 additions & 30 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
80BE2091B4442C5D9CA35B5C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7AC33B5F4B0EAD8A084AD788 /* Pods_Runner.framework */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
A06DD3BAF1953AF91F76DA67 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E10A742790FF4590199B352 /* Pods_Runner.framework */; };
E344B0642B500B290059F562 /* London route 2.gpx in Resources */ = {isa = PBXBuildFile; fileRef = E344B0632B500B290059F562 /* London route 2.gpx */; };
E3D122FA2B3C1D7B00E1418C /* London route.gpx in Resources */ = {isa = PBXBuildFile; fileRef = E3D122F92B3C1D7B00E1418C /* London route.gpx */; };
/* End PBXBuildFile section */
Expand All @@ -32,15 +32,16 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0A4D79C403FDD60E2CE0635F /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
153259787F2538FA24D7F8FF /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
446E66ADA996F56B7E535549 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
727EF15E4EC65EA1A7560622 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
4FDCDE6CCBF3806CAC35E693 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AC33B5F4B0EAD8A084AD788 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
7E10A742790FF4590199B352 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
Expand All @@ -50,15 +51,14 @@
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
E344B0632B500B290059F562 /* London route 2.gpx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "London route 2.gpx"; sourceTree = "<group>"; };
E3D122F92B3C1D7B00E1418C /* London route.gpx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = "London route.gpx"; sourceTree = "<group>"; };
F54C5CE286DDF87F1E2E59EF /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
80BE2091B4442C5D9CA35B5C /* Pods_Runner.framework in Frameworks */,
A06DD3BAF1953AF91F76DA67 /* Pods_Runner.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -68,17 +68,17 @@
0B7FBFE0FD17C2EDDCC4D73F /* Pods */ = {
isa = PBXGroup;
children = (
446E66ADA996F56B7E535549 /* Pods-Runner.debug.xcconfig */,
727EF15E4EC65EA1A7560622 /* Pods-Runner.release.xcconfig */,
F54C5CE286DDF87F1E2E59EF /* Pods-Runner.profile.xcconfig */,
153259787F2538FA24D7F8FF /* Pods-Runner.debug.xcconfig */,
0A4D79C403FDD60E2CE0635F /* Pods-Runner.release.xcconfig */,
4FDCDE6CCBF3806CAC35E693 /* Pods-Runner.profile.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
5C7F8FAA9BA9A582BD155767 /* Frameworks */ = {
73A05C8B168838E8C5046A25 /* Frameworks */ = {
isa = PBXGroup;
children = (
7AC33B5F4B0EAD8A084AD788 /* Pods_Runner.framework */,
7E10A742790FF4590199B352 /* Pods_Runner.framework */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -101,7 +101,7 @@
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
0B7FBFE0FD17C2EDDCC4D73F /* Pods */,
5C7F8FAA9BA9A582BD155767 /* Frameworks */,
73A05C8B168838E8C5046A25 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -137,14 +137,14 @@
isa = PBXNativeTarget;
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
buildPhases = (
9E0B7C940A0BD74733354121 /* [CP] Check Pods Manifest.lock */,
5094CFF93ABA989221F16304 /* [CP] Check Pods Manifest.lock */,
9740EEB61CF901F6004384FC /* Run Script */,
97C146EA1CF9000F007C117D /* Sources */,
97C146EB1CF9000F007C117D /* Frameworks */,
97C146EC1CF9000F007C117D /* Resources */,
9705A1C41CF9048500538489 /* Embed Frameworks */,
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
9B44E34DD938C1F5E840AF5F /* [CP] Embed Pods Frameworks */,
56FD4A159A5C50B905BEA8DD /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
Expand Down Expand Up @@ -221,22 +221,29 @@
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
};
9740EEB61CF901F6004384FC /* Run Script */ = {
5094CFF93ABA989221F16304 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
name = "Run Script";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
9B44E34DD938C1F5E840AF5F /* [CP] Embed Pods Frameworks */ = {
56FD4A159A5C50B905BEA8DD /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -253,27 +260,20 @@
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
9E0B7C940A0BD74733354121 /* [CP] Check Pods Manifest.lock */ = {
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
name = "Run Script";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Flutter
import UIKit
import RaxelPulse

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
33 changes: 33 additions & 0 deletions example/lib/title_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ class _TitleScreenState extends State<TitleScreen> {
),
),
),
Expanded(
child: ElevatedButton(
onPressed: !_isManualTracking ? _onStartPersistentManualTracking : null,
child: const Text(
'Start persistent tracking manually',
textAlign: TextAlign.center,
),
),
),
SizedBox(width: 16),
Expanded(
child: ElevatedButton(
Expand Down Expand Up @@ -367,6 +376,30 @@ class _TitleScreenState extends State<TitleScreen> {
});
}

Future<void> _onStartPersistentManualTracking() async {
final isSdkEnabled = await _trackingApi.isSdkEnabled() ?? false;

if (!isSdkEnabled) {
_showSnackBar('Enable SDK first');
return;
}

if (!_isTracking && Platform.isIOS) {
_showSnackBar('Enable tracking first');
return;
}

if (_isManualTracking) {
_showSnackBar('Stop current track first');
return;
}

await _trackingApi.startManualPersistentTracking();
setState(() {
_isManualTracking = true;
});
}

Future<void> _onStopManualTracking() async {
if (!_isManualTracking) {
_showSnackBar('Start tracking first');
Expand Down
7 changes: 7 additions & 0 deletions ios/Classes/SwiftTelematicsSDKPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public class SwiftTelematicsSDKPlugin: NSObject, FlutterPlugin, RPLowPowerModeDe
setDisableTracking(call, result: result)
case "startManualTracking":
startManualTracking(result)
case "startManualPersistentTracking":
startManualPersistentTracking(result)
case "stopManualTracking":
stopManualTracking(result)
case "showPermissionWizard":
Expand Down Expand Up @@ -179,6 +181,11 @@ public class SwiftTelematicsSDKPlugin: NSObject, FlutterPlugin, RPLowPowerModeDe
result(nil)
}

private func startManualPersistentTracking(_ result: @escaping FlutterResult) {
RPTracker.instance().startPersistentTracking()
result(nil)
}

private func stopManualTracking(_ result: @escaping FlutterResult) {
RPTracker.instance().stopTracking()
result(nil)
Expand Down
4 changes: 2 additions & 2 deletions ios/telematics_sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'telematics_sdk'
s.version = '0.2.4 '
s.version = '0.2.5 '
s.summary = 'A new flutter plugin project.'
s.description = <<-DESC
A new flutter plugin project.
Expand All @@ -22,5 +22,5 @@ A new flutter plugin project.
s.swift_version = '5.0'

# Dependency
s.dependency 'RaxelPulse', '~> 6.0.4'
s.dependency 'RaxelPulse', '~> 6.0.5'
end
2 changes: 2 additions & 0 deletions lib/src/tracking_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ class TrackingApi {

Future<bool?> startManualTracking() => _channel.invokeMethod('startManualTracking');

Future<bool?> startManualPersistentTracking() => _channel.invokeMethod('startManualPersistentTracking');

Future<bool?> stopManualTracking() => _channel.invokeMethod('stopManualTracking');

/// `SDK can work in two modes`:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: telematics_sdk
version: 0.2.4
version: 0.2.5
description: A Flutter plugin for integration Telematics SDK in Android and iOS applications.
homepage: https://docs.telematicssdk.com
repository: https://github.com/Mobile-Telematics/telematicsSDK-demoapp-flutter-
Expand Down

0 comments on commit 96e79ef

Please sign in to comment.