Migration Guides
Migrating to Rover 4 from Rover Campaigns 3.x - Android
Welcome to Rover 4.
The purpose of this guide is to aid you in adopting Rover 4 from your existing Rover (sometimes referred to as Rover Campaigns) 3.x setup. The Rover 4 SDK supersedes that one and this guide will walk you through the necessary changes.
We'll begin by replacing Judo's Maven repository with the new Rover maven repository and removing the old SDK dependencies.
Replace SDK Installation
First, begin by replacing Judo maven repo declaration in your top-level build.gradle or settings.gradle. Note this repo was used even for Rover-only customers:
Remove:
maven {
url 'https://judoapp.github.io/judo-maven/maven'
}
Then, ensure the new Rover Maven repository is present:
maven {
url "https://roverplatform.github.io/rover-maven/maven"
}
No other Rover or Judo repositories are needed. If any other previously used Rover or Judo Maven repositories are present, they can be safely cleaned up.
Then, update the Rover SDK dependency in your app's build.gradle.
You'll have multiple Rover Campaigns modules listed in your app's build.gradle. You should update all of these
Remove:
// Rover Experiences standalone renderer:
implementation "io.rover:sdk:3.8.2"
// Rover Campaigns modules:
implementation "io.rover.campaigns:core:3.11.0"
implementation "io.rover.campaigns:notifications:3.11.0"
implementation "io.rover.campaigns:experiences:3.11.0"
implementation "io.rover.campaigns:location:3.11.0"
implementation "io.rover.campaigns:debug:3.11.0"
Note the io.rover:sdk
dependency on the first line. It is possible you have also this in your build.gradle. This was actually the standalone version of what we now call Classic Experiences, and has been entirely integrated into Rover 4 SDK's experiences module. You can now safely remove this dependency entirely.
Replace with:
implementation "io.rover.sdk:core:4.0.0"
implementation "io.rover.sdk:notifications:4.0.0"
implementation "io.rover.sdk:experiences:4.0.0"
implementation "io.rover.sdk:location:4.0.0"
implementation "io.rover.sdk:debug:4.0.0"
Note that this should apply to all Rover modules you have installed. If you had any other Rover Campaigns modules installed, such as io.rover.campaigns:ticketmaster
, you should update those as well to the new naming and version number.
See Android - Installation for more information.
Update Package Imports and Rover Singleton API Calls
Any imports you had of io.rover.campaigns
should be replaced with io.rover.sdk
. These may occur in your source files and in your manifest entry for TransientLinkLaunchActivity
.
Thus, in your code files:
import io.rover.campaigns.core
import io.rover.campaigns.experiences
// etc.
These should be replaced with:
import io.rover.sdk.core
import io.rover.sdk.experiences
// etc.
And, the same for TransientLinkLaunchActivity
:
<activity android:name="io.rover.campaigns.core.routing.TransientLinkLaunchActivity" android:exported="true">
...
</activity>
Becomes:
<activity android:name="io.rover.sdk.core.routing.TransientLinkLaunchActivity" android:exported="true">
...
</activity>
The singleton API for Rover has also been renamed in Rover 4, and additionally the optionality of the shared
accessor has been removed.
Replace your initialize call with the new singleton name, Rover
:
RoverCampaigns.initialize(
...
)
and replace it with:
Rover.initialize(
...
)
Now we'll replace any usages of the Rover shared singleton object. Note that the accessor is now non-optional.
So, replace any previous calls to:
RoverCampaigns.sharedInstance // (or .shared, which did previously exist but was optional)
with:
Rover.shared
If you still require a failable accessor (that returns null instead of failing in the event of the SDK not yet being intialized), use Rover.failableShared
.
Set up Experience Activity Color Theming
Previous versions of Rover relied on the Material theme set on the ExperienceActivity in the manifest to determine the color for auto-styled app bars.
However, to make this behaviour more explicit and allow for smoother integrations with Jetpack Compose-based apps, this is now done programmatically.
ExperienceAssembler
now takes a new parameter, appThemeDescription
, where colours are provided explicitly.
See Android Installation - ExperienceActivity Color Theming for details.
Event Handling Changes
If you are subscribing to Experience screen views using the Notification Center event, you should replace it with usage of the new API for receiving screen views. This will receive screen views for both experiences and classic experiences:
The following code for the old Rover experiences renderer for registering for screen viewed events will need to be replaced:
Rover.shared?.eventEmitter?.addEventListener(object : RoverEventListener {
override fun onExperienceScreenPresented(event: RoverEvent.ExperiencePresented) {
// custom handler code here
}
})
Note that if you were using other events than "Experience Screen Presented", you will need to continue using the previously available event listener API. However, to indicate that it is only available for Classic Experiences, it has been renamed.
RoverEventListener
has been renamed ClassicExperienceEventListener
, and the methods have had "Classic" added, eg. onScreenPresented()
has been renamed to onClassicScreenPresented()
.
Replace usages of Rover.shared.eventEmitter.addEventListener
with Rover.shared.classicEventEmitter.addClassicExperienceEventListener
.
This can now be replaced by registering a screen viewed callback:
Rover.shared.registerScreenViewedCallback { screenViewed ->
// custom handler code here
}
See Third-party Analytics for more information.
Notification Center renamed to Inbox
The Rover Notification Center UI has been renamed to Rover Inbox. If you used or customized the integrated Notification Center, there are a few renamed types to take into account:
NotificationCenterActivity
class ->InboxActivity
NotificationCenterListView
class ->InboxListView
notificationCenterIntent
parameter toNotificationAssembler()
->inboxIntent
Additionally, the NotificationsRepository
has been renamed to NotificationStore
. Additionally, the updates
publisher property has been renamed notifications
, to better reflect that that is how to you subscribe to the list of properties. A wrapping object has been removed as well, and it now directly yields a List<Notification>.
See Inbox for more information.
Summing Up
Please follow up with your account representative for next steps on User Acceptance Testing.