-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add `deviceID` methods: `setDeviceID`, `getDeviceID`, `clearDeviceID`. * Add permissions check method: `isAllRequiredPermissionsAndSensorsGranted`. * Add SDK status manipulation: `isSdkEnabled`, `setEnableSdk`. * Add tracking manipulation: `isTracking`, `startTracking`, `stopTracking`. * Add tags manipulation: `getTrackTags`, `addTrackTags`, `removeTrackTags`. * Add PermissionWizard methods. * iOS: add `lowerPowerMode`. * iOS: add `setAggressiveHeartbeats` with brief documentation.
- Loading branch information
1 parent
adb8227
commit ccf5238
Showing
28 changed files
with
1,123 additions
and
83 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
# Changelog | ||
|
||
## 0.1.0 | ||
|
||
* Add `deviceID` methods: `setDeviceID`, `getDeviceID`, `clearDeviceID`. | ||
* Add permissions check method: `isAllRequiredPermissionsAndSensorsGranted`. | ||
* Add SDK status manipulation: `isSdkEnabled`, `setEnableSdk`. | ||
* Add tracking manipulation: `isTracking`, `startTracking`, `stopTracking`. | ||
* Add tags manipulation: `getTrackTags`, `addTrackTags`, `removeTrackTags`. | ||
* Add future tag manipulation: `getFutureTrackTags`, `addFutureTrackTag`, `removeFutureTrackTag`, `removeAllFutureTrackTags`. | ||
* Add PermissionWizard methods. | ||
* iOS: add `lowerPowerMode`. | ||
* iOS: add `setAggressiveHeartbeats` with brief documentation. | ||
|
||
## 0.0.1 | ||
|
||
* TODO: Describe initial release. | ||
* Initial version |
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
28 changes: 28 additions & 0 deletions
28
android/src/main/kotlin/com/telematicssdk/TagsExtentions.kt
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,28 @@ | ||
package com.telematicssdk | ||
|
||
import org.json.JSONObject | ||
import com.raxeltelematics.v2.sdk.server.model.sdk.TrackTag | ||
import com.raxeltelematics.v2.sdk.server.model.sdk.raw_tags.Tag | ||
|
||
fun TrackTag.toJsonString(): String { | ||
val json = mapOf<String, Any?>( | ||
"source" to source, | ||
"tag" to tag, | ||
"type" to type, | ||
) | ||
|
||
val jsonObject = JSONObject(json) | ||
|
||
return jsonObject.toString() | ||
} | ||
|
||
fun Tag.toJsonString(): String { | ||
val json = mapOf<String, Any?>( | ||
"source" to source, | ||
"tag" to tag, | ||
) | ||
|
||
val jsonObject = JSONObject(json) | ||
|
||
return jsonObject.toString() | ||
} |
48 changes: 48 additions & 0 deletions
48
android/src/main/kotlin/com/telematicssdk/TagsProcessingListenerImp.kt
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,48 @@ | ||
package com.telematicssdk | ||
|
||
import com.raxeltelematics.v2.sdk.TagsProcessingListener | ||
import com.raxeltelematics.v2.sdk.model.database.models.raw_tags.Status | ||
import com.raxeltelematics.v2.sdk.server.model.sdk.raw_tags.Tag | ||
import io.flutter.plugin.common.MethodChannel | ||
|
||
class TagsProcessingListenerImp(private val channel: MethodChannel) : TagsProcessingListener { | ||
override fun onTagAdd(status: Status, tag: Tag, activationTime: Long) { | ||
val json = mapOf<String, Any>( | ||
"status" to status.name, | ||
"tag" to tag.toJsonString(), | ||
"activationTime" to activationTime | ||
) | ||
|
||
channel.invokeMethod("onTagAdd", json) | ||
} | ||
|
||
override fun onTagRemove(status: Status, tag: Tag, deactivationTime: Long) { | ||
val json = mapOf<String, Any>( | ||
"status" to status.name, | ||
"tag" to tag.toJsonString(), | ||
"deactivationTime" to deactivationTime | ||
) | ||
|
||
channel.invokeMethod("onTagRemove", json) | ||
} | ||
|
||
override fun onAllTagsRemove(status: Status, deactivatedTagsCount: Int, time: Long) { | ||
val json = mapOf<String, Any>( | ||
"status" to status.name, | ||
"deactivatedTagsCount" to deactivatedTagsCount, | ||
"time" to time | ||
) | ||
|
||
channel.invokeMethod("onAllTagsRemove", json) | ||
} | ||
|
||
override fun onGetTags(status: Status, tags: Array<Tag>?, time: Long) { | ||
val json = mapOf<String, Any?>( | ||
"status" to status.name, | ||
"tags" to tags?.map { it.toJsonString() }, | ||
"time" to time | ||
) | ||
|
||
channel.invokeMethod("onGetTags", json) | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
android/src/main/kotlin/com/telematicssdk/TrackTagExtention.kt
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,7 @@ | ||
package com.telematicssdk | ||
|
||
import com.raxeltelematics.v2.sdk.server.model.sdk.TrackTag | ||
|
||
fun TrackTag.toJsonString(): String { | ||
return "{\"source\": \"$source\", \"tag\": \"$tag\", \"type\": \"$type\"}"; | ||
} |
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
Oops, something went wrong.