Connect SDK 7.4 migration guide for the Android platform
Several changes were introduced in Pega ® Mobile SDK 7.4, which includes the Connect SDK for the Android platform. This article will help you migrate your application from an earlier version of the Connect SDK to the current version.
API and class name changes
The following API names have changed:
- The
com.pega.connectsdk.pegaapi.api.*
package is now calledcom.pega.connectsdk.pegaapi.*
. - The
com.pega.connectsdk.pegaapi.api.PegaNotification.*
package is now calledcom.pega.connectsdk.pegaapi.Notification.*
. - The
com.pega.connectsdk.pegaapi.api.error.*
package is now calledcom.pega.connectsdk.pegaapi.error.*
.
The following class names have changed:
PegaApi
is now calledPega
.PegaConfig
is now calledConfiguration
.api.PegaAuthentication
is now calledAuthentication
.api.PegaNotification
is now calledNotification
.api.PegaNotification.NotificationEnableCallback
is now calledNotification.NotificationRegisterCallback
(for more information, see Notifications).api.PegaNotification.NotificationClickedReceiver
is now calledNotification.ClickedReceiver
.api.PegaNotification.NotificationReceivedReceiver
is now calledNotification.ReceivedReceiver
.com.pega.connectsdk.pegaapi.model.NotificationPayload
was renamed tocom.pega.connectsdk.pegaapi.notification.NotificationData
com.pega.connectsdk.pegaapi.model.NotificationData
was renamed tocom.pega.connectsdk.pegaapi.notification.NotificationDetails
The following classes were removed and their functionality should be implemented in the Notification.NoticationHandler
class. For more details, see Enabling Push Notifications.
api.PegaNotification.NotificationClickedReceiver
api.PegaNotification.NotificationReceivedReceiver
Configuration
The following method of is deprecated:
PegaConfig config = new PegaConfig(); config.setPegaUrl("http://sample.pega.com/prweb"); PegaApi pega = PegaComponent.Initializer.init(config);
Instead, you should use the methods presented in the following two examples:
Pega pega = Pega.create(); pega.configuration().setServerUrl("http://sample.pega.com/prweb");
pega.configuration().setServerAndRestApiUrls("http://sample.pega.com/prweb/<custom_authentication_service>", "http://sample.pega.com/prweb/api/v1");
Notifications
The implementation of api.PegaNotification.NotificationReceivedReceiver.onReceive()
should be moved to the definition of Notification.NotificationHandler.onNotificationReceived()
.
The implementation of api.PegaNotification.NotificationClickedReceiver
should be replaced by creating a new PendingIntent
that is returned in the Notification.NotificationHandler.createNotificationContentIntent()
method.
For more details, see Enabling Push Notifications.