Migration From v1.0.12 To v1.1.1
The changes required to migrate to v1.1.1 are minimal. Certain structural changes involve removing or updating a few lines of code. This has to be done in order to facilitate the migration and simplify the integration process.
User Data & Campaign Screen
Change the following: -
Old declaration
InviteReferralsApi.getInstance(activityContext).userDetails((String)name, (String)email, (String)mobile, (int)campaignID, (String)subscriptionID, (String)customValues);
InviteReferralsApi.getInstance(activityContext).inline_btn((int)CampaignID);
And following are the callbacks related to campaign screen,
InviteReferralsApi.getInstance(activityContext).userDetailListener(new UserDetailsCallback() {
@Override
public void userDetails(JSONObject res) {
//do your task here
}
});
InviteReferralsApi.getInstance(activityContext).closeButtonListener(new IRCloseButtonCallbackInterface() {
@Override
public void HandleDoneButtonAction() {
//do your task here
}
});
InviteReferralsApi.getInstance(activityContext).setOnShareIconClickListener(new OnShareClickListener() {
@Override
public void onCLick(JSONObject data) {
//do your task here
}
});
Change to new declaration
InviteReferralsApi.getInstance(activityContext).campaign(userInfo, campaignInfo, new OnUIBuild() {
@Override
public void onCampaignScreen(JSONObject response) {
//do your task here
}
@Override
public void onShareIconClick(JSONObject data) {
//do your task here
}
@Override
public void onCloseButtonClick() {
//do your task here
}
@Override
public void onCaptureLeadFormSubmission(JSONObject response) {
//do your task here
}
});
});
Refer to Campaign Screen for detailed information.
Get Sharing Details
Change the following: -
Old declaration
InviteReferralsApi.getInstance(activityContext).getSharingDetails(new InviteReferralsSharingInterface() {
@Override
public void getShareData(JSONObject sharingDetails) {
//do your task here
}
}, (String) name, (String) email,(String) mobile, (int) campaignID);
Change to new declaration
IRUserData.Builder userInfo = new IRUserData.Builder();
userInfo.setUserName(name);
userInfo.setUserEmail(email);
userInfo.setUserMobile(mobile);
userInfo.setCustomValueOne(null);
userInfo.setCustomValueTwo(null);
userInfo.build();
IRCampaignData.Builder campaignInfo = new IRCampaignData.Builder();
campaignInfo.setCampaignID(campaignID);
campaignInfo.setTemplateID(0);
campaignInfo.build();
InviteReferralsApi.getInstance(activityContext).getSharingDetails(new InviteReferralsSharingInterface() {
@Override
public void getShareData(JSONObject sharingDetails) {
//do your task here
}
}, userInfo, campaignInfo);
Refer to Campaign Screen for detailed information.
Show Refer A Friend Widget
Change the following: -
Old declaration
InviteReferralsApi.getInstance(activityContext).invite((String)ruleName);
Change to new declaration
IRUserData.Builder userInfo = new IRUserData.Builder();
userInfo.setUserName(“abc”);
userInfo.setUserEmail(“[email protected]”);
userInfo.setUserMobile(“9090909090”);
userInfo.setCustomValueOne(null);
userInfo.setCustomValueTwo(null);
userInfo.build();
IRCampaignData.Builder campaignInfo = new IRCampaignData.Builder();
campaignInfo.setCampaignID(123);
campaignInfo.setTemplateID(1);
campaignInfo.build();
InviteReferralsApi.getInstance(activityContext).campaignPopup("home", userInfo, campaignInfo);
Refer to Campaign Screen for detailed information.
Tracking Events
Change the following: -
Old declaration
InviteReferralsApi.getInstance(activityContext).tracking((String) eventName, String orderID, (int) purchaseValue, (String) referCode, (String) uniqueCode, (String) customValue, (JSONObject) userDataJson);
And its callback will be called as
InviteReferralsApi.getInstance(this).ir_TrackingCallbackListener(new IRTrackingCallback() {
@Override
public void ir_trackingCallbackForEventName(JSONObject tracking_response) {
//do your work here
}
});
Change to new declaration
InviteReferralsApi.getInstance(activityContext).tracking(IREventData.Builder eventInfo, IRUserData.Builder userInfo);
And its callback will be called as
InviteReferralsApi.getInstance(activityContext).onEventTrack(new IRTrackingCallback() {
@Override
public void onEventHit(JSONObject response) {
//do your task here
}
});
Refer to Event Tracking for detailed information.
Updated almost 2 years ago