This framework combines multipe functionalities provided by PACE i.e. authorizing via PACE ID or requesting and displaying Apps. These functionalities are separated and structured into different Kits by namespaces, i.e. IDKit, AppKit and POIKit.
The full documentation and instructions on how to integrate PACE Cloud SDK can be found here
The complete source code of the SDK can be found on GitHub.
PACECloudSDK
currently supports Android 6.0 (API level 23) and above.
It uses the following dependencies:
In 3.0.0
we’ve introduced a universal setup method: PACECloudSDK.setup(context: Context, configuration: Configuration)
and removed the setup for AppKit
and POIKit
.
The universal Configuration
almost has the same signature as the previous AppKit Configuration
, only the isDarkTheme
parameter has been removed, which is now an enum instead of a Boolean and defaults to Theme.LIGHT
. In case you want to change it, you can set it via AppKit
’s theme
property: AppKit.theme = Theme.LIGHT/Theme.DARK
.
We’ve added two new AppCallback
s: getAccessToken
and logout
. The getAccessToken
method replaces the invalidToken
call. While its callback is equal to the invalidToken
callback, we changed the response to be an object with an accessToken
property and a new isInitialToken
boolean.
The logout
callback is used to handle the logout natively. Please refer to Native login, token renewal and logout for more information.
Also from now on this callback will only be sent if IDKit
is not used/set up. If you’re using IDKit
the SDK will now first try to renew the session automatically. If the renewal fails there is a new fun onSessionRenewalFailed(throwable: Throwable?, onResult: (String?) -> Unit)
AppCallback that you may implement to specify your own behavior to retrieve a new access token. To implement this method pass an AppCallbackImpl
instance to AppKit.openApps(...)
or AppKit.openAppActivity(...)
and override onSessionRenewalFailed
. If either this method is not implemented or you didn’t pass an AppCallbackImpl
instance at all the SDK will automatically perform an authorization hence showing a sign in mask for the user.
We’ve moved everything that belongs to the GeoAPI from AppKit
/API
to POIKit
:
AppKit.isPoiInRange(...)
call is now part of POIKit
, available under POIKit.isPoiInRange(...)
AppKit.requestCofuGasStations(...)
calls are now part of POIKit
, available under POIKit.requestCofuGasStations(...)
cloud.pace.sdk.api.geo
and cloud.pace.sdk.appkit.geo
were moved to package cloud.pace.sdk.poikit.geo
The IDKit
setup has been combined with the general PACECloudSDK
setup:
IDKit.setup(...)
is no longer accessible.OIDConfiguration
has been added to the Configuration
class of the PACECloudSDK
.OIDConfiguration
, the IDKit
can not be used.OIDConfiguration
needs to be initialized with at least the clientId
and the redirectUri
of your identity provider. You can also use the factory methods of the OIDConfiguration
if you want to use another environment than production which is now set by default with the primary constructor.The PACECloudSDK.setup()
has been simplified:
CustomOIDConfiguration
has been added to the Configuration
class of the PACECloudSDK
.CustomOIDConfiguration
, the IDKit
can not be used.CustomOIDConfiguration
needs to be initialized with at least the clientId
and the redirectUri
of your identity provider. All other properties in CustomOIDConfiguration
can be additionally set if e.g. own identity provider endpoints are wanted.The connectedFuelingStatus
property of the CofuGasStation
is now nullable so that the Cofu gas station is not skipped in the cache loading if this property is absent in the API response.
If you use the CofuGasStation
object, keep in mind that the connectedFuelingStatus
property can now be null
.
The GasStations
properties paymentMethods
, amenities
, foods
, loyaltyPrograms
, postalServices
, services
, shopGoods
and fuelType
will now be from type string instead of enums. The client app has to then manage these values itself.
POIKit.getRegionalPrice(...)
function now returns List<RegionalPrices>
instead of the RegionalPrices
typealias, which was List<RegionalPrice>
before. This means that the only difference now is that the RegionalPrice
model is called RegionalPrices
and the RegionalPrices
typealias no longer exists. The properties of the new RegionalPrices
model are the same as those of the old RegionalPrice
model.IDKit.userInfo
method anymore, because it is automatically added to the request by the IDKit.UserInfoResponse
model have changed to subject
, zoneInfo
, emailVerified
, createdAt
, locale
and email
. The old properties are outdated.Environment.STAGE
environment completely. Please use Environment.SANDBOX
during testing and Environment.PRODUCTION
for everything else.NoSupportedBrowser
exception which will now be returned from all IDKit.authorize(...)
and IDKit.endSession(...)
calls instead of crashing the app with an ActivityNotFoundException
if no supported browser is installed and enabled to handle the Custom Tab intent. In this case, we show a Toast prompting the user to enable Google Chrome.IDKit.authorize(...)
and IDKit.endSession(...)
now return the Completion
result instead of invoking a function parameter on result to make the calls synchronous.POIKit.observe(...)
functions to retrieve gas stations:
poikit_database
is deleted. Also, Room has been removed as dependency.POIKit
functions must be replaced with which new POIKit
function:
| Old | New |
| —— | —— |
| POIKit.observe(visibleRegion: VisibleRegion, padding: Double, completion: (Completion<ListPOIKit
database:
POIKit.getGasStationLocal(vararg ids: String, completion: (Completion<List<GasStation>>) -> Unit)
POIKit.getFromBoundingBoxLocal(minLatitude: Double, maxLatitude: Double, minLongitude: Double, maxLongitude: Double, completion: (Completion<List<GasStation>>) -> Unit)
POIKit.insertGasStations(vararg gasStations: GasStation)
CdnAPI
class for retrieving PaymentMethodVendor
s has been renamed to PaymentMethodVendorsAPI
and moved to cloud.pace.sdk.api.vendor
. Change the following imports if you use this API:
| Old | New |
| —— | —— |
| import cloud.pace.sdk.poikit.poi.download.CdnAPI | import cloud.pace.sdk.api.vendor.PaymentMethodVendorsAPI |
| import cloud.pace.sdk.poikit.poi.download.CdnAPI.getPaymentMethodVendors | import cloud.pace.sdk.api.vendor.PaymentMethodVendorsAPI.getPaymentMethodVendors |
| import cloud.pace.sdk.poikit.poi.download.PaymentMethodVendor | import cloud.pace.sdk.api.vendor.PaymentMethodVendor |AppKit.requestLocalApps(...)
for every location update anymore, if you want to use our Plug & Play solution. The AppKit.requestLocalApps(...)
function still exists, if you want to implement a custom AppDrawer behavior.AppDrawerHost
composable function in your app composable function. We recommend placing the AppDrawerHost
so that it is displayed above the rest of your app’s content and aligned from the bottom.AppDrawerHostView
, which is a regular view and internally calls the AppDrawerHost
composable function as content. You can then add this view in your XML layout or programmatically if you do not use Jetpack Compose.onShow(apps: List<App>)
AppCallback that is triggered when a list of AppDrawers is displayed. The apps
parameter contains the currently displayed AppDrawers.AppKit.openApps(...)
and AppKit.closeApps(...)
have been deleted, as this is now done automatically by the AppDrawerHost.LocationRequest
parameter to the POIKit.startLocationListener
function so that you can specify the desired location criteria for the location request.locationFlow(...)
function to the LocationProvider
so that you can fetch location updates using a Kotlin Flow.Configuration
object that is used in the PACECloudSDK.setup(...)
function: We have added clientID
as property to Configuration
and removed it from CustomOIDConfiguration
.AppDrawer
in the AppDrawerHost
, no changes are required.appDrawer
modifier in your custom AppDrawer
UI, you need to move the onClick
function to its content, e.g. to the AppDrawerContent
.AppDrawerColumn
as a wrapper around your content so that the swipe gestures are handled for you.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.getRoute
and searchAddress
were removed from the POIKit. If you used these functionalities, you need to provide your own implementation.