Showing
6 changed files
with
59 additions
and
30 deletions
| ... | @@ -16,6 +16,7 @@ import ly.warp.sdk.io.callbacks.SimpleCallbackReceiver; | ... | @@ -16,6 +16,7 @@ import ly.warp.sdk.io.callbacks.SimpleCallbackReceiver; |
| 16 | import ly.warp.sdk.io.callbacks.WarplyReadyCallback; | 16 | import ly.warp.sdk.io.callbacks.WarplyReadyCallback; |
| 17 | import ly.warp.sdk.io.request.WarplyConsumerRequest; | 17 | import ly.warp.sdk.io.request.WarplyConsumerRequest; |
| 18 | import ly.warp.sdk.io.request.WarplyLoginRequest; | 18 | import ly.warp.sdk.io.request.WarplyLoginRequest; |
| 19 | +import ly.warp.sdk.io.request.WarplyVerifyTicketRequest; | ||
| 19 | import ly.warp.sdk.utils.WarplyInitializer; | 20 | import ly.warp.sdk.utils.WarplyInitializer; |
| 20 | import ly.warp.sdk.utils.managers.WarplyManager; | 21 | import ly.warp.sdk.utils.managers.WarplyManager; |
| 21 | import warp.ly.android_sdk.R; | 22 | import warp.ly.android_sdk.R; |
| ... | @@ -38,6 +39,12 @@ public class SplashActivity extends BaseActivity { | ... | @@ -38,6 +39,12 @@ public class SplashActivity extends BaseActivity { |
| 38 | .setPassword("123456"), | 39 | .setPassword("123456"), |
| 39 | mLoginReceiver | 40 | mLoginReceiver |
| 40 | ); | 41 | ); |
| 42 | + | ||
| 43 | +// WarplyManager.verifyTicket(new WarplyVerifyTicketRequest() | ||
| 44 | +// .setGuid("6012139059") | ||
| 45 | +// .setTicket("eyJraWQiOiIxMjc3IiwidHlwIjoiSldUIiwiYWxnIjoiUlM1MTIifQ.eyJhdWQiOiJsb3lhbHR5Iiwic3ViIjoiNjAxMjEzOTA1OSIsIm5iZiI6MTY1NTgwMjE4Miwic2NvcGUiOltdLCJraWQiOjEyNzcsImlzcyI6IlBVQkxJQ19DQUxMRVIiLCJleHAiOjE2NTU4MDM5ODIsImlhdCI6MTY1NTgwMjE4Mn0.T5F7QoGd0PFwW4hQ7FhSqxjK0V8RKUmuu7PgXAbfTnpeHuR1Jj8BT3vDNGsVjoF6ZXR3wIouxCnpJroUn0o6bMROk0YI_zFkpinoYF9ByxI2ErJqCAruhpcsNQvbONQaUk9oMTPRI1-B8iYJkofThAKvs98wjqWRDlM30KDTpXI7A3yxY56gVHYzZvfe2uSuNeniw60X5XowZyFrLvzwkdAeIuafQhfGZCvFSP2tTz1apVKh3rv8erLI92MA6xu66bc3MFpTOrKQklQDqmRYL6xcbFNtOk1D_Tb84KjHj7C8Ufg1wWIYkSTi4TtfneSkYkcjZfI2Anbmqm-0mCRKRA"), | ||
| 46 | +// mLoginReceiver | ||
| 47 | +// ); | ||
| 41 | } else { | 48 | } else { |
| 42 | startNextActivity(); | 49 | startNextActivity(); |
| 43 | } | 50 | } | ... | ... |
| ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' | ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' |
| 2 | 2 | ||
| 3 | ext { | 3 | ext { |
| 4 | PUBLISH_GROUP_ID = 'ly.warp' | 4 | PUBLISH_GROUP_ID = 'ly.warp' |
| 5 | - PUBLISH_VERSION = '4.5.4-cosbeta13' | 5 | + PUBLISH_VERSION = '4.5.4-cosbeta14' |
| 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
| 7 | } | 7 | } |
| 8 | 8 | ... | ... |
| ... | @@ -194,7 +194,7 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation | ... | @@ -194,7 +194,7 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation |
| 194 | } | 194 | } |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | - WarplyManagerHelper.setUniqueCampaignList(mUniqueCampaignList); | 197 | + WarplyManagerHelper.setUniqueCampaignList(result); |
| 198 | 198 | ||
| 199 | // Thread.currentThread().interrupt(); | 199 | // Thread.currentThread().interrupt(); |
| 200 | 200 | ... | ... |
| ... | @@ -26,7 +26,6 @@ import ly.warp.sdk.io.models.Couponset; | ... | @@ -26,7 +26,6 @@ import ly.warp.sdk.io.models.Couponset; |
| 26 | import ly.warp.sdk.io.models.CouponsetsList; | 26 | import ly.warp.sdk.io.models.CouponsetsList; |
| 27 | import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; | 27 | import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; |
| 28 | import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent; | 28 | import ly.warp.sdk.io.models.LoyaltyGiftsForYouOfferClickEvent; |
| 29 | -import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; | ||
| 30 | import ly.warp.sdk.io.models.MergedGifts; | 29 | import ly.warp.sdk.io.models.MergedGifts; |
| 31 | import ly.warp.sdk.utils.WarpUtils; | 30 | import ly.warp.sdk.utils.WarpUtils; |
| 32 | import ly.warp.sdk.utils.WarplyManagerHelper; | 31 | import ly.warp.sdk.utils.WarplyManagerHelper; | ... | ... |
| ... | @@ -153,10 +153,7 @@ public class WarpViewActivity extends WarpBaseActivity { | ... | @@ -153,10 +153,7 @@ public class WarpViewActivity extends WarpBaseActivity { |
| 153 | RelativeLayout.LayoutParams warpViewParams = new RelativeLayout.LayoutParams( | 153 | RelativeLayout.LayoutParams warpViewParams = new RelativeLayout.LayoutParams( |
| 154 | RelativeLayout.LayoutParams.MATCH_PARENT, | 154 | RelativeLayout.LayoutParams.MATCH_PARENT, |
| 155 | RelativeLayout.LayoutParams.MATCH_PARENT); | 155 | RelativeLayout.LayoutParams.MATCH_PARENT); |
| 156 | -// warpViewParams.addRule( | 156 | + root.setFitsSystemWindows(true); |
| 157 | -// RelativeLayout.SYSTEM_UI_FLAG_LAYOUT_STABLE | ||
| 158 | -// | RelativeLayout.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | ||
| 159 | -// | RelativeLayout.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); | ||
| 160 | root.addView(mWarpView, warpViewParams); | 157 | root.addView(mWarpView, warpViewParams); |
| 161 | 158 | ||
| 162 | 159 | ... | ... |
| ... | @@ -57,6 +57,7 @@ public class WarplyManagerHelper { | ... | @@ -57,6 +57,7 @@ public class WarplyManagerHelper { |
| 57 | private static CouponList mCouponList = new CouponList(); | 57 | private static CouponList mCouponList = new CouponList(); |
| 58 | private static CouponsetsList mCouponsetsList = new CouponsetsList(); | 58 | private static CouponsetsList mCouponsetsList = new CouponsetsList(); |
| 59 | private static CustomerStateModel mCustomerStateModel; | 59 | private static CustomerStateModel mCustomerStateModel; |
| 60 | + private static CampaignList mCampaignList; | ||
| 60 | 61 | ||
| 61 | // =========================================================== | 62 | // =========================================================== |
| 62 | // Methods for/from SuperClass/Interfaces | 63 | // Methods for/from SuperClass/Interfaces |
| ... | @@ -81,10 +82,10 @@ public class WarplyManagerHelper { | ... | @@ -81,10 +82,10 @@ public class WarplyManagerHelper { |
| 81 | + "&client_id=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id") | 82 | + "&client_id=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id") |
| 82 | + "&client_secret=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret"); | 83 | + "&client_secret=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret"); |
| 83 | 84 | ||
| 84 | - if (mConsumer != null) | 85 | +// if (mConsumer != null) |
| 85 | - url = url + "&auth_token=" + (mConsumer.getUuid()); | 86 | +// url = url + "&auth_token=" + (mConsumer.getUuid()); |
| 86 | - else | 87 | +// else |
| 87 | - url = url + "&auth_token="; | 88 | +// url = url + "&auth_token="; |
| 88 | 89 | ||
| 89 | return url; | 90 | return url; |
| 90 | } | 91 | } |
| ... | @@ -92,24 +93,26 @@ public class WarplyManagerHelper { | ... | @@ -92,24 +93,26 @@ public class WarplyManagerHelper { |
| 92 | /** | 93 | /** |
| 93 | * Open Warply campaign with sharing id | 94 | * Open Warply campaign with sharing id |
| 94 | */ | 95 | */ |
| 95 | - public static String constructCampaignUrlForShare(Campaign item, String deeplink) { | 96 | + public static String constructCampaignUrlForShare(String sessionUuid, String sharingId) { |
| 96 | - String url = item.getIndexUrl() | 97 | + if (getCampaignList() != null) { |
| 97 | - + "?web_id=" + WarpUtils.getWebId(Warply.getWarplyContext()) | 98 | + for (Campaign item : getCampaignList()) { |
| 98 | - + "&app_uuid=" + WarplyProperty.getAppUuid(Warply.getWarplyContext()) | 99 | + if (item.getSessionUUID().equals(sessionUuid)) { |
| 99 | - + "&api_key=" + WarpUtils.getApiKey(Warply.getWarplyContext()) | 100 | + String url = item.getIndexUrl() |
| 100 | - + "&session_uuid=" + item.getSessionUUID() | 101 | + + "?web_id=" + WarpUtils.getWebId(Warply.getWarplyContext()) |
| 101 | - + "&access_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token") | 102 | + + "&app_uuid=" + WarplyProperty.getAppUuid(Warply.getWarplyContext()) |
| 102 | - + "&refresh_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token") | 103 | + + "&api_key=" + WarpUtils.getApiKey(Warply.getWarplyContext()) |
| 103 | - + "&client_id=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id") | 104 | + + "&session_uuid=" + item.getSessionUUID() |
| 104 | - + "&client_secret=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret"); | 105 | + + "&access_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token") |
| 105 | - /*+ "&sharing_id=" + sharingId;*/ | 106 | + + "&refresh_token=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("refresh_token") |
| 106 | - | 107 | + + "&client_id=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_id") |
| 107 | - if (mConsumer != null) | 108 | + + "&client_secret=" + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getClientValue("client_secret") |
| 108 | - url = url + "&auth_token=" + (mConsumer.getUuid()); | 109 | + + "&sharing_id=" + sharingId; |
| 109 | - else | 110 | + return url; |
| 110 | - url = url + "&auth_token="; | 111 | + } |
| 112 | + } | ||
| 113 | + } | ||
| 111 | 114 | ||
| 112 | - return url; | 115 | + return ""; |
| 113 | } | 116 | } |
| 114 | 117 | ||
| 115 | /** | 118 | /** |
| ... | @@ -203,8 +206,31 @@ public class WarplyManagerHelper { | ... | @@ -203,8 +206,31 @@ public class WarplyManagerHelper { |
| 203 | mConsumer = consumer; | 206 | mConsumer = consumer; |
| 204 | } | 207 | } |
| 205 | 208 | ||
| 206 | - public static void setUniqueCampaignList(HashMap<String, CampaignList> uniqueCouponList) { | 209 | + public static void setUniqueCampaignList(HashMap<String, CampaignList> uniqueCampaignList) { |
| 207 | - mUniqueCampaignList = uniqueCouponList; | 210 | + mUniqueCampaignList = uniqueCampaignList; |
| 211 | + } | ||
| 212 | + | ||
| 213 | + public static void setUniqueCampaignList(CampaignList campaignList) { | ||
| 214 | + mCampaignList = campaignList; | ||
| 215 | + for (Campaign campaign : campaignList) { | ||
| 216 | + if (mUniqueCampaignList.containsKey(campaign.getOfferCategory().trim())) { | ||
| 217 | + CampaignList tempCampaignList = (CampaignList) mUniqueCampaignList.get(campaign.getOfferCategory().trim()); | ||
| 218 | + tempCampaignList.add(campaign); | ||
| 219 | + mUniqueCampaignList.put(campaign.getOfferCategory().trim(), tempCampaignList); | ||
| 220 | + } else { | ||
| 221 | + CampaignList tempCampaignList = new CampaignList(); | ||
| 222 | + tempCampaignList.add(campaign); | ||
| 223 | + mUniqueCampaignList.put(campaign.getOfferCategory().trim(), tempCampaignList); | ||
| 224 | + } | ||
| 225 | + } | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + public static void setCampaignList(CampaignList campaignList) { | ||
| 229 | + mCampaignList = campaignList; | ||
| 230 | + } | ||
| 231 | + | ||
| 232 | + public static CampaignList getCampaignList() { | ||
| 233 | + return mCampaignList; | ||
| 208 | } | 234 | } |
| 209 | 235 | ||
| 210 | public static void setCouponList(CouponList couponList) { | 236 | public static void setCouponList(CouponList couponList) { | ... | ... |
-
Please register or login to post a comment