Releases: predict-legacy/PredictIO-iOS
Release 5.6.0
- Updates to support Xcode 10
Release 5.5.0
- Adds full compatibility when used from Objective C
- Improvements to battery and data usages
Steps to Update
To update you will need to modify where you call start()
on the SDK, as the status
parameter of the callback is no longer an Optional
value.
- Remove
?
from each of the case statements - Change
case nil
tocase .success
to handle the success case
Release 5.4.2
- Update for Xcode 9.3 / Swift 4.1
- Update RxSwift dependency
- Remove dependence on UIBackgroundMode in low power
- Enhancements to high power mode settings
Release 5.3.6
- Update RxSwift dependency
- Remove dependence on UIBackgroundMode in low power
- Enhancements to high power mode settings
Release 5.3.5
- Performance improvements to speed up SDK launch time
- Enhancements making battery usage even lower
Includes other great feature of the 5.3 release: https://github.com/predict-io/PredictIO-iOS/releases/tag/5.3.0
Release 5.3.0
- New! Callbacks can be bound to receive events generated by the SDK
- New! Power level can be chosen when launch SDK,
lowPower
&highPower
- High power is typically faster at detecting events but consumes slightly more battery
High Power & Low Power
The predict.io SDK comes in two power levels which cater to different requirements of battery consumption and latency of events being detected.
NOTE: Power level won't take effect properly until a fresh app relaunch, it's not a setting which should be toggled at runtime.
High Power
- 5% typical battery usage in 24 hour period
- Events detected within a few minutes
- Mode of Transport detection (coming soon in future beta)
- Intention detection (coming soon in future beta)
PredictIO.start(apiKey: apiKey, powerLevel: .highPower) {
error in
// Handled as above
}
Low Power
- Less than 1% typical battery usage in 24 hour period
- Events detected with up to 30 min delay
- No Mode of Transport detection
- Intention detection (coming soon in future beta)
NOTE: Low power is the default if no value is set for the
powerLevel
parameter.
PredictIO.start(apiKey: apiKey, powerLevel: .lowPower)
Events
The predict.io SDK can give you callbacks for the events which are detected for you to integrate with your own app's functionality.
PredictIO.notify(on: .any) {
(event: PredictIOTripEvent) in
// Do something with event
}
PredictIO.notify(on: .departure) {
event in
// Do something when user has left a location
}
PredictIO.notify(on: .arrival) {
event in
// Do something when user has arrived at a location
}
PredictIOTripEvent
A PredictIOTripEvent
is the event you will receive that describes attributes of the event which was detected, namely; the location, timestamp and type of the event from the following:
.arrival
.departure
.enroute
(High Power only).still
(High Power only)
public class PredictIOTripEvent: CustomStringConvertible {
public let type: PredictIOTripEventType
public let coordinate: CLLocationCoordinate2D
public let timestamp: Date
}
Release 5.2.4
- Improved logging to SDK startup process
- Enhanced and more efficient location capture
- Fix issue where timestamps wouldn't be converted to Gregorian calendar format
- Fix issue stopping Example apps from building correctly
Release 5.2.2
- Adds custom parameters & webhooks support
Have events generated by the SDK forwarded on to your own API also.
PredictIO.setWebhookURL("https://api.yourapp.com/webhook")
Additionally, you can add custom data, to the payload if you need some additional data, such as an ID or transaction number, so that you can reconcile data on your side. For example:
PredictIO.setCustomParameter(key: "transaction", value: [
"id": 1233445,
"user_id": 99887765,
"status": "paid",
] as Any)
Release 5.2.0
- Improvements to syncing events
- More efficient internal data handling
- Less CPU & battery usage
Required Changes
The PredictIOError
enum has been modified to differently handle how various location permission errors can be represented.
PredictIOError.locationPermission(CLAuthorizationStatus)
has been simplified into four new enum types:
.locationPermissionNotDetermined
.locationPermissionRestricted
.locationPermissionWhenInUse
.locationPermissionDenied
Release 5.1.5
- Improvements to internal event database