Skip to content

Commit 3792961

Browse files
committed
Merge branch '329-remove-photon-api-calls' into 'master'
Resolve "Remove Photon API calls" Closes #329 See merge request pace/mobile/android/pace-cloud-sdk!367
2 parents 855a6c5 + 870f19f commit 3792961

File tree

11 files changed

+9
-1069
lines changed

11 files changed

+9
-1069
lines changed

docs/index.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,5 @@ The `GasStations` properties `paymentMethods`, `amenities`, `foods`, `loyaltyPro
186186
### From 23.x.x to 24.x.x
187187
- The `logEvent` SDK handler now includes an optional `context`. This context is to be used to provide a context in which the event is logged and must not be forwarded to the analytics backend.
188188

189-
## SDK API Docs
190-
191-
Here is a complete list of all our SDK API documentations:
192-
193-
- [latest](/latest/-p-a-c-e-cloud-s-d-k/index.html) – the current `master`
194-
- [3.0.1](/3.0.1/-p-a-c-e-cloud-s-d-k/index.html)
189+
### From 24.x.x to 25.x.x
190+
- The functions `getRoute` and `searchAddress` were removed from the POIKit. If you used these functionalities, you need to provide your own implementation.

library/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ publishing {
238238
description.set(
239239
"PACE Cloud SDK is a client SDK that allows your app to easily connect to PACE\'s Connected Fueling. The SDK consists of the IDKit to manage the OpenID (OID) authorization and " +
240240
"general session flow with its token handling. It also consists of the AppKit, with which you can fetch and display location based apps, apps by URL or ID. Furthermore " +
241-
"it contains the POIKit, which allows you to fetch Point of Interests (e.g. gas stations), request routes and search for locations."
241+
"it contains the POIKit, which allows you to fetch Point of Interests (e.g. gas stations)."
242242
)
243243
url.set("https://github.com/pace/cloud-sdk-android")
244244
licenses {
@@ -290,7 +290,7 @@ publishing {
290290
description.set(
291291
"PACE Cloud SDK is a client SDK that allows your app to easily connect to PACE\'s Connected Fueling. The SDK consists of the IDKit to manage the OpenID (OID) authorization and " +
292292
"general session flow with its token handling. It also consists of the AppKit, with which you can fetch and display location based apps, apps by URL or ID. Furthermore " +
293-
"it contains the POIKit, which allows you to fetch Point of Interests (e.g. gas stations), request routes and search for locations."
293+
"it contains the POIKit, which allows you to fetch Point of Interests (e.g. gas stations)."
294294
)
295295
url.set("https://github.com/pace/cloud-sdk-android")
296296
licenses {

library/src/main/java/cloud/pace/sdk/poikit/POIKit.kt

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,16 @@ import cloud.pace.sdk.poikit.poi.tiles.TilesAPIManager
1313
import cloud.pace.sdk.poikit.pricehistory.PriceHistory
1414
import cloud.pace.sdk.poikit.pricehistory.PriceHistoryClient
1515
import cloud.pace.sdk.poikit.pricehistory.PriceHistoryFuelType
16-
import cloud.pace.sdk.poikit.routing.NavigationApiClient
17-
import cloud.pace.sdk.poikit.routing.NavigationMode
18-
import cloud.pace.sdk.poikit.routing.NavigationRequest
19-
import cloud.pace.sdk.poikit.routing.Route
20-
import cloud.pace.sdk.poikit.search.AddressSearchClient
21-
import cloud.pace.sdk.poikit.search.AddressSearchRequest
22-
import cloud.pace.sdk.poikit.search.PhotonResult
2316
import cloud.pace.sdk.poikit.utils.POIKitConfig
2417
import cloud.pace.sdk.utils.*
2518
import cloud.pace.sdk.utils.LocationProviderImpl.Companion.DEFAULT_LOCATION_REQUEST
2619
import com.google.android.gms.location.LocationRequest
2720
import com.google.android.gms.maps.model.VisibleRegion
28-
import io.reactivex.rxjava3.core.Observable
2921
import org.koin.core.component.inject
3022
import java.util.*
3123

3224
object POIKit : CloudSDKKoinComponent {
3325

34-
private val navigationApi: NavigationApiClient by inject()
35-
private val addressSearchApi: AddressSearchClient by inject()
3626
private val priceHistoryApi: PriceHistoryClient by inject()
3727
private val locationProvider: LocationProvider by inject()
3828
private val geoApiManager: GeoAPIManager by inject()
@@ -132,34 +122,10 @@ object POIKit : CloudSDKKoinComponent {
132122
return tilesApiManager.getTiles(idWithLocation, zoomLevel)
133123
}
134124

135-
fun getRoute(destination: LocationPoint, completion: (Completion<Route?>) -> Unit) {
136-
onBackgroundThread {
137-
when (val location = locationProvider.currentLocation(false)) {
138-
is Success -> {
139-
location.result?.let {
140-
val navigationRequest = NavigationRequest(
141-
UUID.randomUUID().toString(),
142-
listOf(LocationPoint(it.latitude, it.longitude), destination),
143-
alternatives = false,
144-
navigationMode = NavigationMode.CAR
145-
)
146-
navigationApi.getRoute(navigationRequest, completion)
147-
} ?: completion(Failure(Exception("Could not get current location")))
148-
}
149-
150-
is Failure -> completion(Failure(location.throwable))
151-
}
152-
}
153-
}
154-
155125
fun getRegionalPrice(latitude: Double, longitude: Double, completion: (Completion<List<RegionalPrices>>) -> Unit) {
156126
API.prices.getRegionalPrices(latitude.toFloat(), longitude.toFloat()).handleCallback(completion)
157127
}
158128

159-
fun searchAddress(request: AddressSearchRequest): Observable<PhotonResult> {
160-
return addressSearchApi.searchAddress(request)
161-
}
162-
163129
/**
164130
* Returns the price history for the specified [country][countryCode].
165131
*

0 commit comments

Comments
 (0)