Showing
5 changed files
with
80 additions
and
153 deletions
| ... | @@ -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.5.4r21' | 5 | + PUBLISH_VERSION = '4.5.5.4r22' |
| 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
| 7 | } | 7 | } |
| 8 | 8 | ... | ... |
| ... | @@ -14,8 +14,8 @@ | ... | @@ -14,8 +14,8 @@ |
| 14 | tools:node="remove" /> | 14 | tools:node="remove" /> |
| 15 | <uses-permission android:name="com.huawei.appmarket.service.commondata.permission.GET_COMMON_DATA" /> | 15 | <uses-permission android:name="com.huawei.appmarket.service.commondata.permission.GET_COMMON_DATA" /> |
| 16 | <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> | 16 | <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> |
| 17 | - <uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH" /> | 17 | +<!-- <uses-permission android:name="android.permission.FOREGROUND_SERVICE_HEALTH" />--> |
| 18 | - <uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS" /> | 18 | +<!-- <uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS" />--> |
| 19 | 19 | ||
| 20 | <application android:largeHeap="true"> | 20 | <application android:largeHeap="true"> |
| 21 | <!-- <meta-data--> | 21 | <!-- <meta-data--> |
| ... | @@ -116,12 +116,6 @@ | ... | @@ -116,12 +116,6 @@ |
| 116 | android:screenOrientation="portrait" | 116 | android:screenOrientation="portrait" |
| 117 | android:theme="@style/SDKAppTheme" /> | 117 | android:theme="@style/SDKAppTheme" /> |
| 118 | 118 | ||
| 119 | - <!-- <activity--> | ||
| 120 | - <!-- android:name="ly.warp.sdk.activities.LoyaltyWallet"--> | ||
| 121 | - <!-- android:exported="false"--> | ||
| 122 | - <!-- android:screenOrientation="portrait"--> | ||
| 123 | - <!-- android:theme="@style/SDKAppTheme" />--> | ||
| 124 | - | ||
| 125 | <activity | 119 | <activity |
| 126 | android:name="ly.warp.sdk.activities.ActiveGiftsActivity" | 120 | android:name="ly.warp.sdk.activities.ActiveGiftsActivity" |
| 127 | android:exported="false" | 121 | android:exported="false" |
| ... | @@ -234,11 +228,11 @@ | ... | @@ -234,11 +228,11 @@ |
| 234 | 228 | ||
| 235 | <!-- android:stopWithTask="false"--> | 229 | <!-- android:stopWithTask="false"--> |
| 236 | <!-- android:process=":warplyHealthService"--> | 230 | <!-- android:process=":warplyHealthService"--> |
| 237 | - <service | 231 | +<!-- <service--> |
| 238 | - android:name="ly.warp.sdk.services.WarplyHealthService" | 232 | +<!-- android:name="ly.warp.sdk.services.WarplyHealthService"--> |
| 239 | - android:exported="false" | 233 | +<!-- android:exported="false"--> |
| 240 | - android:foregroundServiceType="health" | 234 | +<!-- android:foregroundServiceType="health"--> |
| 241 | - android:permission="android.permission.BIND_JOB_SERVICE" /> | 235 | +<!-- android:permission="android.permission.BIND_JOB_SERVICE" />--> |
| 242 | 236 | ||
| 243 | <service | 237 | <service |
| 244 | android:name="ly.warp.sdk.services.WarplyBeaconsRangingService" | 238 | android:name="ly.warp.sdk.services.WarplyBeaconsRangingService" | ... | ... |
| ... | @@ -39,18 +39,13 @@ import androidx.work.OneTimeWorkRequest; | ... | @@ -39,18 +39,13 @@ import androidx.work.OneTimeWorkRequest; |
| 39 | import androidx.work.WorkManager; | 39 | import androidx.work.WorkManager; |
| 40 | 40 | ||
| 41 | import org.greenrobot.eventbus.EventBus; | 41 | import org.greenrobot.eventbus.EventBus; |
| 42 | -import org.json.JSONArray; | ||
| 43 | import org.json.JSONException; | 42 | import org.json.JSONException; |
| 44 | import org.json.JSONObject; | 43 | import org.json.JSONObject; |
| 45 | 44 | ||
| 46 | -import java.io.Serializable; | ||
| 47 | import java.util.ArrayList; | 45 | import java.util.ArrayList; |
| 48 | import java.util.Collections; | 46 | import java.util.Collections; |
| 49 | import java.util.HashMap; | 47 | import java.util.HashMap; |
| 50 | -import java.util.HashSet; | ||
| 51 | -import java.util.LinkedHashSet; | ||
| 52 | import java.util.Map; | 48 | import java.util.Map; |
| 53 | -import java.util.Set; | ||
| 54 | import java.util.concurrent.ExecutorService; | 49 | import java.util.concurrent.ExecutorService; |
| 55 | import java.util.concurrent.Executors; | 50 | import java.util.concurrent.Executors; |
| 56 | 51 | ||
| ... | @@ -58,7 +53,6 @@ import ly.warp.sdk.R; | ... | @@ -58,7 +53,6 @@ import ly.warp.sdk.R; |
| 58 | import ly.warp.sdk.Warply; | 53 | import ly.warp.sdk.Warply; |
| 59 | import ly.warp.sdk.activities.ContextualActivity; | 54 | import ly.warp.sdk.activities.ContextualActivity; |
| 60 | import ly.warp.sdk.activities.CouponsetInfoActivity; | 55 | import ly.warp.sdk.activities.CouponsetInfoActivity; |
| 61 | -import ly.warp.sdk.activities.GiftsForYouActivity; | ||
| 62 | import ly.warp.sdk.activities.TelcoActivity; | 56 | import ly.warp.sdk.activities.TelcoActivity; |
| 63 | import ly.warp.sdk.activities.WarpViewActivity; | 57 | import ly.warp.sdk.activities.WarpViewActivity; |
| 64 | import ly.warp.sdk.db.WarplyDBHelper; | 58 | import ly.warp.sdk.db.WarplyDBHelper; |
| ... | @@ -76,22 +70,16 @@ import ly.warp.sdk.io.models.LoyaltyBadgeModel; | ... | @@ -76,22 +70,16 @@ import ly.warp.sdk.io.models.LoyaltyBadgeModel; |
| 76 | import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; | 70 | import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; |
| 77 | import ly.warp.sdk.io.models.LoyaltyGiftsForYouPackage; | 71 | import ly.warp.sdk.io.models.LoyaltyGiftsForYouPackage; |
| 78 | import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; | 72 | import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; |
| 79 | -import ly.warp.sdk.io.models.Merchant; | ||
| 80 | import ly.warp.sdk.io.models.MerchantList; | 73 | import ly.warp.sdk.io.models.MerchantList; |
| 81 | import ly.warp.sdk.io.models.PushCampaign; | 74 | import ly.warp.sdk.io.models.PushCampaign; |
| 82 | import ly.warp.sdk.io.models.UnifiedCoupon; | 75 | import ly.warp.sdk.io.models.UnifiedCoupon; |
| 83 | import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel; | 76 | import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel; |
| 84 | import ly.warp.sdk.io.request.CosmoteRetrieveSharingRequest; | 77 | import ly.warp.sdk.io.request.CosmoteRetrieveSharingRequest; |
| 85 | import ly.warp.sdk.io.request.CosmoteSharingRequest; | 78 | import ly.warp.sdk.io.request.CosmoteSharingRequest; |
| 86 | -import ly.warp.sdk.io.request.WarplyConsumerRequest; | ||
| 87 | -import ly.warp.sdk.io.request.WarplyEditConsumerRequest; | ||
| 88 | import ly.warp.sdk.io.request.WarplyIntegrationRequest; | 79 | import ly.warp.sdk.io.request.WarplyIntegrationRequest; |
| 89 | -import ly.warp.sdk.io.request.WarplyUserCouponsRequest; | ||
| 90 | import ly.warp.sdk.services.EventService; | 80 | import ly.warp.sdk.services.EventService; |
| 91 | -import ly.warp.sdk.services.EventUnifiedCouponsService; | ||
| 92 | import ly.warp.sdk.services.FCMBaseMessagingService; | 81 | import ly.warp.sdk.services.FCMBaseMessagingService; |
| 93 | import ly.warp.sdk.services.VouchersFetchedService; | 82 | import ly.warp.sdk.services.VouchersFetchedService; |
| 94 | -import ly.warp.sdk.services.WarplyHealthService; | ||
| 95 | import ly.warp.sdk.utils.managers.WarplyAnalyticsManager; | 83 | import ly.warp.sdk.utils.managers.WarplyAnalyticsManager; |
| 96 | import ly.warp.sdk.utils.managers.WarplyEventBusManager; | 84 | import ly.warp.sdk.utils.managers.WarplyEventBusManager; |
| 97 | import ly.warp.sdk.utils.managers.WarplyManager; | 85 | import ly.warp.sdk.utils.managers.WarplyManager; |
| ... | @@ -1464,10 +1452,10 @@ public class WarplyManagerHelper { | ... | @@ -1464,10 +1452,10 @@ public class WarplyManagerHelper { |
| 1464 | } | 1452 | } |
| 1465 | 1453 | ||
| 1466 | public static void logoutUser() { | 1454 | public static void logoutUser() { |
| 1467 | - if (isMyServiceRunning(WarplyHealthService.class)) { | 1455 | +// if (isMyServiceRunning(WarplyHealthService.class)) { |
| 1468 | - Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | 1456 | +// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); |
| 1469 | - Warply.getWarplyContext().stopService(stepsServiceIntent); | 1457 | +// Warply.getWarplyContext().stopService(stepsServiceIntent); |
| 1470 | - } | 1458 | +// } |
| 1471 | } | 1459 | } |
| 1472 | 1460 | ||
| 1473 | private static boolean isMyServiceRunning(Class<?> serviceClass) { | 1461 | private static boolean isMyServiceRunning(Class<?> serviceClass) { | ... | ... |
| ... | @@ -26,14 +26,9 @@ | ... | @@ -26,14 +26,9 @@ |
| 26 | package ly.warp.sdk.utils.managers; | 26 | package ly.warp.sdk.utils.managers; |
| 27 | 27 | ||
| 28 | import android.app.ActivityManager; | 28 | import android.app.ActivityManager; |
| 29 | -import android.app.AlarmManager; | ||
| 30 | -import android.app.PendingIntent; | ||
| 31 | import android.content.Context; | 29 | import android.content.Context; |
| 32 | -import android.content.Intent; | ||
| 33 | -import android.os.Build; | ||
| 34 | import android.os.Handler; | 30 | import android.os.Handler; |
| 35 | import android.os.Looper; | 31 | import android.os.Looper; |
| 36 | -import android.os.SystemClock; | ||
| 37 | import android.text.TextUtils; | 32 | import android.text.TextUtils; |
| 38 | import android.text.format.DateFormat; | 33 | import android.text.format.DateFormat; |
| 39 | import android.util.ArrayMap; | 34 | import android.util.ArrayMap; |
| ... | @@ -54,7 +49,6 @@ import org.json.JSONArray; | ... | @@ -54,7 +49,6 @@ import org.json.JSONArray; |
| 54 | import org.json.JSONException; | 49 | import org.json.JSONException; |
| 55 | import org.json.JSONObject; | 50 | import org.json.JSONObject; |
| 56 | 51 | ||
| 57 | -import java.io.Serializable; | ||
| 58 | import java.text.ParseException; | 52 | import java.text.ParseException; |
| 59 | import java.text.SimpleDateFormat; | 53 | import java.text.SimpleDateFormat; |
| 60 | import java.util.ArrayList; | 54 | import java.util.ArrayList; |
| ... | @@ -68,9 +62,6 @@ import java.util.concurrent.ExecutorService; | ... | @@ -68,9 +62,6 @@ import java.util.concurrent.ExecutorService; |
| 68 | import java.util.concurrent.Executors; | 62 | import java.util.concurrent.Executors; |
| 69 | 63 | ||
| 70 | import ly.warp.sdk.Warply; | 64 | import ly.warp.sdk.Warply; |
| 71 | -import ly.warp.sdk.activities.CouponsetInfoActivity; | ||
| 72 | -import ly.warp.sdk.activities.GiftsForYouActivity; | ||
| 73 | -import ly.warp.sdk.activities.WarpViewActivity; | ||
| 74 | import ly.warp.sdk.db.WarplyDBHelper; | 65 | import ly.warp.sdk.db.WarplyDBHelper; |
| 75 | import ly.warp.sdk.io.callbacks.AddressHook; | 66 | import ly.warp.sdk.io.callbacks.AddressHook; |
| 76 | import ly.warp.sdk.io.callbacks.CallbackReceiver; | 67 | import ly.warp.sdk.io.callbacks.CallbackReceiver; |
| ... | @@ -100,7 +91,6 @@ import ly.warp.sdk.io.models.CouponList; | ... | @@ -100,7 +91,6 @@ import ly.warp.sdk.io.models.CouponList; |
| 100 | import ly.warp.sdk.io.models.Couponset; | 91 | import ly.warp.sdk.io.models.Couponset; |
| 101 | import ly.warp.sdk.io.models.CouponsetsList; | 92 | import ly.warp.sdk.io.models.CouponsetsList; |
| 102 | import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel; | 93 | import ly.warp.sdk.io.models.LoyaltySDKDynatraceEventModel; |
| 103 | -import ly.warp.sdk.io.models.LoyaltySDKFirebaseEventModel; | ||
| 104 | import ly.warp.sdk.io.models.Merchant; | 94 | import ly.warp.sdk.io.models.Merchant; |
| 105 | import ly.warp.sdk.io.models.MerchantCategoriesList; | 95 | import ly.warp.sdk.io.models.MerchantCategoriesList; |
| 106 | import ly.warp.sdk.io.models.MerchantList; | 96 | import ly.warp.sdk.io.models.MerchantList; |
| ... | @@ -116,7 +106,6 @@ import ly.warp.sdk.io.models.TransactionsList; | ... | @@ -116,7 +106,6 @@ import ly.warp.sdk.io.models.TransactionsList; |
| 116 | import ly.warp.sdk.io.models.TripMetrics; | 106 | import ly.warp.sdk.io.models.TripMetrics; |
| 117 | import ly.warp.sdk.io.models.UnifiedCampaignModel; | 107 | import ly.warp.sdk.io.models.UnifiedCampaignModel; |
| 118 | import ly.warp.sdk.io.models.UnifiedCoupon; | 108 | import ly.warp.sdk.io.models.UnifiedCoupon; |
| 119 | -import ly.warp.sdk.io.models.WarplyPacingEventModel; | ||
| 120 | import ly.warp.sdk.io.request.CosmoteCouponSharingRequest; | 109 | import ly.warp.sdk.io.request.CosmoteCouponSharingRequest; |
| 121 | import ly.warp.sdk.io.request.CosmotePostEventRequest; | 110 | import ly.warp.sdk.io.request.CosmotePostEventRequest; |
| 122 | import ly.warp.sdk.io.request.CosmoteRetrieveSharingRequest; | 111 | import ly.warp.sdk.io.request.CosmoteRetrieveSharingRequest; |
| ... | @@ -167,7 +156,6 @@ import ly.warp.sdk.io.volley.ApiClient; | ... | @@ -167,7 +156,6 @@ import ly.warp.sdk.io.volley.ApiClient; |
| 167 | import ly.warp.sdk.io.volley.ApiService; | 156 | import ly.warp.sdk.io.volley.ApiService; |
| 168 | import ly.warp.sdk.services.EventCampaignService; | 157 | import ly.warp.sdk.services.EventCampaignService; |
| 169 | import ly.warp.sdk.services.EventUnifiedCouponsService; | 158 | import ly.warp.sdk.services.EventUnifiedCouponsService; |
| 170 | -import ly.warp.sdk.services.WarplyHealthService; | ||
| 171 | import ly.warp.sdk.utils.WarpJSONParser; | 159 | import ly.warp.sdk.utils.WarpJSONParser; |
| 172 | import ly.warp.sdk.utils.WarpUtils; | 160 | import ly.warp.sdk.utils.WarpUtils; |
| 173 | import ly.warp.sdk.utils.WarplyDeviceInfoCollector; | 161 | import ly.warp.sdk.utils.WarplyDeviceInfoCollector; |
| ... | @@ -982,30 +970,20 @@ public class WarplyManager { | ... | @@ -982,30 +970,20 @@ public class WarplyManager { |
| 982 | WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); | 970 | WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); |
| 983 | } | 971 | } |
| 984 | 972 | ||
| 985 | - if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { | 973 | +// if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { |
| 986 | - if (!isMyServiceRunning(WarplyHealthService.class)) { | 974 | +// if (!isMyServiceRunning(WarplyHealthService.class)) { |
| 987 | - Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | 975 | +// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); |
| 988 | -// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { | 976 | +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
| 989 | -// AlarmManager mgr = (AlarmManager) Warply.getWarplyContext().getSystemService(Context.ALARM_SERVICE); | ||
| 990 | -// PendingIntent pi = PendingIntent.getService(Warply.getWarplyContext(), 2002, stepsServiceIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_MUTABLE); | ||
| 991 | -// mgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 1000, pi); | ||
| 992 | -// } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
| 993 | // Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | 977 | // Warply.getWarplyContext().startForegroundService(stepsServiceIntent); |
| 994 | // } else { | 978 | // } else { |
| 995 | // Warply.getWarplyContext().startService(stepsServiceIntent); | 979 | // Warply.getWarplyContext().startService(stepsServiceIntent); |
| 996 | // } | 980 | // } |
| 997 | - | 981 | +// |
| 998 | - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | 982 | +// WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); |
| 999 | - Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | 983 | +// pacingVisible.setVisible(true); |
| 1000 | - } else { | 984 | +// EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); |
| 1001 | - Warply.getWarplyContext().startService(stepsServiceIntent); | 985 | +// } |
| 1002 | - } | 986 | +// } |
| 1003 | - | ||
| 1004 | - WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); | ||
| 1005 | - pacingVisible.setVisible(true); | ||
| 1006 | - EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | ||
| 1007 | - } | ||
| 1008 | - } | ||
| 1009 | } | 987 | } |
| 1010 | } | 988 | } |
| 1011 | } | 989 | } |
| ... | @@ -1126,30 +1104,20 @@ public class WarplyManager { | ... | @@ -1126,30 +1104,20 @@ public class WarplyManager { |
| 1126 | WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); | 1104 | WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); |
| 1127 | } | 1105 | } |
| 1128 | 1106 | ||
| 1129 | - if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { | 1107 | +// if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { |
| 1130 | - if (!isMyServiceRunning(WarplyHealthService.class)) { | 1108 | +// if (!isMyServiceRunning(WarplyHealthService.class)) { |
| 1131 | - Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | 1109 | +// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); |
| 1132 | -// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { | 1110 | +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
| 1133 | -// AlarmManager mgr = (AlarmManager) Warply.getWarplyContext().getSystemService(Context.ALARM_SERVICE); | ||
| 1134 | -// PendingIntent pi = PendingIntent.getService(Warply.getWarplyContext(), 2002, stepsServiceIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); | ||
| 1135 | -// mgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 1000, pi); | ||
| 1136 | -// } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
| 1137 | // Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | 1111 | // Warply.getWarplyContext().startForegroundService(stepsServiceIntent); |
| 1138 | // } else { | 1112 | // } else { |
| 1139 | // Warply.getWarplyContext().startService(stepsServiceIntent); | 1113 | // Warply.getWarplyContext().startService(stepsServiceIntent); |
| 1140 | // } | 1114 | // } |
| 1141 | - | 1115 | +// |
| 1142 | - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | 1116 | +// WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); |
| 1143 | - Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | 1117 | +// pacingVisible.setVisible(true); |
| 1144 | - } else { | 1118 | +// EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); |
| 1145 | - Warply.getWarplyContext().startService(stepsServiceIntent); | 1119 | +// } |
| 1146 | - } | 1120 | +// } |
| 1147 | - | ||
| 1148 | - WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); | ||
| 1149 | - pacingVisible.setVisible(true); | ||
| 1150 | - EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | ||
| 1151 | - } | ||
| 1152 | - } | ||
| 1153 | } | 1121 | } |
| 1154 | } | 1122 | } |
| 1155 | } | 1123 | } |
| ... | @@ -1252,30 +1220,20 @@ public class WarplyManager { | ... | @@ -1252,30 +1220,20 @@ public class WarplyManager { |
| 1252 | WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); | 1220 | WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); |
| 1253 | } | 1221 | } |
| 1254 | 1222 | ||
| 1255 | - if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { | 1223 | +// if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { |
| 1256 | - if (!isMyServiceRunning(WarplyHealthService.class)) { | 1224 | +// if (!isMyServiceRunning(WarplyHealthService.class)) { |
| 1257 | - Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | 1225 | +// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); |
| 1258 | -// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { | 1226 | +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
| 1259 | -// AlarmManager mgr = (AlarmManager) Warply.getWarplyContext().getSystemService(Context.ALARM_SERVICE); | ||
| 1260 | -// PendingIntent pi = PendingIntent.getService(Warply.getWarplyContext(), 2002, stepsServiceIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); | ||
| 1261 | -// mgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 1000, pi); | ||
| 1262 | -// } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
| 1263 | // Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | 1227 | // Warply.getWarplyContext().startForegroundService(stepsServiceIntent); |
| 1264 | // } else { | 1228 | // } else { |
| 1265 | // Warply.getWarplyContext().startService(stepsServiceIntent); | 1229 | // Warply.getWarplyContext().startService(stepsServiceIntent); |
| 1266 | // } | 1230 | // } |
| 1267 | - | 1231 | +// |
| 1268 | - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | 1232 | +// WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); |
| 1269 | - Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | 1233 | +// pacingVisible.setVisible(true); |
| 1270 | - } else { | 1234 | +// EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); |
| 1271 | - Warply.getWarplyContext().startService(stepsServiceIntent); | 1235 | +// } |
| 1272 | - } | 1236 | +// } |
| 1273 | - | ||
| 1274 | - WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); | ||
| 1275 | - pacingVisible.setVisible(true); | ||
| 1276 | - EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | ||
| 1277 | - } | ||
| 1278 | - } | ||
| 1279 | } | 1237 | } |
| 1280 | } | 1238 | } |
| 1281 | } | 1239 | } |
| ... | @@ -4869,30 +4827,20 @@ public class WarplyManager { | ... | @@ -4869,30 +4827,20 @@ public class WarplyManager { |
| 4869 | WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); | 4827 | WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); |
| 4870 | } | 4828 | } |
| 4871 | 4829 | ||
| 4872 | - if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { | 4830 | +// if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { |
| 4873 | - if (!isMyServiceRunning(WarplyHealthService.class)) { | 4831 | +// if (!isMyServiceRunning(WarplyHealthService.class)) { |
| 4874 | - Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | 4832 | +// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); |
| 4875 | -// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { | 4833 | +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
| 4876 | -// AlarmManager mgr = (AlarmManager) Warply.getWarplyContext().getSystemService(Context.ALARM_SERVICE); | ||
| 4877 | -// PendingIntent pi = PendingIntent.getService(Warply.getWarplyContext(), 2002, stepsServiceIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_MUTABLE); | ||
| 4878 | -// mgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 1000, pi); | ||
| 4879 | -// } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
| 4880 | // Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | 4834 | // Warply.getWarplyContext().startForegroundService(stepsServiceIntent); |
| 4881 | // } else { | 4835 | // } else { |
| 4882 | // Warply.getWarplyContext().startService(stepsServiceIntent); | 4836 | // Warply.getWarplyContext().startService(stepsServiceIntent); |
| 4883 | // } | 4837 | // } |
| 4884 | - | 4838 | +// |
| 4885 | - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | 4839 | +// WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); |
| 4886 | - Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | 4840 | +// pacingVisible.setVisible(true); |
| 4887 | - } else { | 4841 | +// EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); |
| 4888 | - Warply.getWarplyContext().startService(stepsServiceIntent); | 4842 | +// } |
| 4889 | - } | 4843 | +// } |
| 4890 | - | ||
| 4891 | - WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); | ||
| 4892 | - pacingVisible.setVisible(true); | ||
| 4893 | - EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | ||
| 4894 | - } | ||
| 4895 | - } | ||
| 4896 | } | 4844 | } |
| 4897 | } | 4845 | } |
| 4898 | } | 4846 | } | ... | ... |
| ... | @@ -104,10 +104,8 @@ import ly.warp.sdk.io.models.UnifiedCoupon; | ... | @@ -104,10 +104,8 @@ import ly.warp.sdk.io.models.UnifiedCoupon; |
| 104 | import ly.warp.sdk.io.models.WarplyCCMSEnabledModel; | 104 | import ly.warp.sdk.io.models.WarplyCCMSEnabledModel; |
| 105 | import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel; | 105 | import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel; |
| 106 | import ly.warp.sdk.io.models.WarplyPacingCardEventModel; | 106 | import ly.warp.sdk.io.models.WarplyPacingCardEventModel; |
| 107 | -import ly.warp.sdk.io.models.WarplyPacingEventModel; | ||
| 108 | import ly.warp.sdk.io.models.WarplyUnifiedActivatedEventModel; | 107 | import ly.warp.sdk.io.models.WarplyUnifiedActivatedEventModel; |
| 109 | import ly.warp.sdk.services.EventCampaignService; | 108 | import ly.warp.sdk.services.EventCampaignService; |
| 110 | -import ly.warp.sdk.services.WarplyHealthService; | ||
| 111 | import ly.warp.sdk.utils.WarpUtils; | 109 | import ly.warp.sdk.utils.WarpUtils; |
| 112 | import ly.warp.sdk.utils.WarplyManagerHelper; | 110 | import ly.warp.sdk.utils.WarplyManagerHelper; |
| 113 | import ly.warp.sdk.utils.WarplyProperty; | 111 | import ly.warp.sdk.utils.WarplyProperty; |
| ... | @@ -126,7 +124,6 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { | ... | @@ -126,7 +124,6 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { |
| 126 | private static final String URL_ACTION_MARKET = "market"; | 124 | private static final String URL_ACTION_MARKET = "market"; |
| 127 | private static final String URL_ACTION_INTENT = "intent"; | 125 | private static final String URL_ACTION_INTENT = "intent"; |
| 128 | private static final String URL_ACTION_MARKET_AUTHORITY = "play.google.com"; | 126 | private static final String URL_ACTION_MARKET_AUTHORITY = "play.google.com"; |
| 129 | - private static final String TAG_STEPS_WORKER = "ly.warp.sdk.services.WarplyHealthService"; | ||
| 130 | 127 | ||
| 131 | // =========================================================== | 128 | // =========================================================== |
| 132 | // Fields | 129 | // Fields |
| ... | @@ -430,12 +427,12 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { | ... | @@ -430,12 +427,12 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { |
| 430 | if (!EventBus.getDefault().isRegistered(this)) | 427 | if (!EventBus.getDefault().isRegistered(this)) |
| 431 | EventBus.getDefault().register(this); | 428 | EventBus.getDefault().register(this); |
| 432 | 429 | ||
| 433 | - if (mWebviewLoaded) { | 430 | +// if (mWebviewLoaded) { |
| 434 | - String scriptSourceInit = "webviewDidFocus(" + String.valueOf(mWebviewLoaded) + "," + String.valueOf(isMyServiceRunning(WarplyHealthService.class)) + ");"; | 431 | +// String scriptSourceInit = "webviewDidFocus(" + String.valueOf(mWebviewLoaded) + "," + String.valueOf(isMyServiceRunning(WarplyHealthService.class)) + ");"; |
| 435 | - WarpView.this.evaluateJavascript(scriptSourceInit, s -> { | 432 | +// WarpView.this.evaluateJavascript(scriptSourceInit, s -> { |
| 436 | - | 433 | +// |
| 437 | - }); | 434 | +// }); |
| 438 | - } | 435 | +// } |
| 439 | } | 436 | } |
| 440 | 437 | ||
| 441 | @Override | 438 | @Override |
| ... | @@ -549,29 +546,29 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { | ... | @@ -549,29 +546,29 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { |
| 549 | pacingWidgetVisible.setVisible(true); | 546 | pacingWidgetVisible.setVisible(true); |
| 550 | EventBus.getDefault().post(new WarplyEventBusManager(pacingWidgetVisible)); | 547 | EventBus.getDefault().post(new WarplyEventBusManager(pacingWidgetVisible)); |
| 551 | } else if (parts[1].equals("steps") && parts[2].equals("shortcutEnabled")) { // This is for the pacing service | 548 | } else if (parts[1].equals("steps") && parts[2].equals("shortcutEnabled")) { // This is for the pacing service |
| 552 | - if (!isMyServiceRunning(WarplyHealthService.class)) { | 549 | +// if (!isMyServiceRunning(WarplyHealthService.class)) { |
| 553 | - LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel(); | 550 | +// LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel(); |
| 554 | - analyticsEvent.setEventName("loyalty_steps_activation"); | 551 | +// analyticsEvent.setEventName("loyalty_steps_activation"); |
| 555 | - EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); | 552 | +// EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); |
| 556 | - | 553 | +// |
| 557 | - Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | 554 | +// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); |
| 558 | - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | 555 | +// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
| 559 | - Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | 556 | +// Warply.getWarplyContext().startForegroundService(stepsServiceIntent); |
| 560 | - } else { | 557 | +// } else { |
| 561 | - Warply.getWarplyContext().startService(stepsServiceIntent); | 558 | +// Warply.getWarplyContext().startService(stepsServiceIntent); |
| 562 | - } | 559 | +// } |
| 563 | - | 560 | +// |
| 564 | - WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); | 561 | +// WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); |
| 565 | - pacingVisible.setVisible(true); | 562 | +// pacingVisible.setVisible(true); |
| 566 | - EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | 563 | +// EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); |
| 567 | - } | 564 | +// } |
| 568 | } else if (parts[1].equals("steps") && parts[2].equals("shortcutDisabled")) { // This is for the pacing service | 565 | } else if (parts[1].equals("steps") && parts[2].equals("shortcutDisabled")) { // This is for the pacing service |
| 569 | - Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | 566 | +// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); |
| 570 | - Warply.getWarplyContext().stopService(stepsServiceIntent); | 567 | +// Warply.getWarplyContext().stopService(stepsServiceIntent); |
| 571 | - | 568 | +// |
| 572 | - WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); | 569 | +// WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); |
| 573 | - pacingVisible.setVisible(false); | 570 | +// pacingVisible.setVisible(false); |
| 574 | - EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); | 571 | +// EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); |
| 575 | } else if (parts[1].equals("request") || parts[1].equals("response")) { | 572 | } else if (parts[1].equals("request") || parts[1].equals("response")) { |
| 576 | WarpUtils.log("**************** WARPLY Webview Log START *****************"); | 573 | WarpUtils.log("**************** WARPLY Webview Log START *****************"); |
| 577 | WarpUtils.log(message); | 574 | WarpUtils.log(message); | ... | ... |
-
Please register or login to post a comment