Panagiotis Triantafyllou

ADD STEPS

...@@ -3,20 +3,7 @@ ...@@ -3,20 +3,7 @@
3 <component name="deploymentTargetDropDown"> 3 <component name="deploymentTargetDropDown">
4 <value> 4 <value>
5 <entry key="app"> 5 <entry key="app">
6 - <State> 6 + <State />
7 - <targetSelectedWithDropDown>
8 - <Target>
9 - <type value="QUICK_BOOT_TARGET" />
10 - <deviceKey>
11 - <Key>
12 - <type value="VIRTUAL_DEVICE_PATH" />
13 - <value value="$USER_HOME$/.android/avd/Pixel_7_v14.avd" />
14 - </Key>
15 - </deviceKey>
16 - </Target>
17 - </targetSelectedWithDropDown>
18 - <timeTargetWasSelectedWithDropDown value="2024-04-10T09:29:35.626328Z" />
19 - </State>
20 </entry> 7 </entry>
21 </value> 8 </value>
22 </component> 9 </component>
......
...@@ -38,7 +38,7 @@ public class SplashActivity extends BaseActivity { ...@@ -38,7 +38,7 @@ public class SplashActivity extends BaseActivity {
38 if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) { 38 if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) {
39 //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons 39 //6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons
40 //prod 6006552990, prod 6005892749, live 3000184910,prod 7000070282, live 3000136179 40 //prod 6006552990, prod 6005892749, live 3000184910,prod 7000070282, live 3000136179
41 - WarplyManager.getCosmoteUser("7000023687", mLoginReceiver); 41 + WarplyManager.getCosmoteUser("7000000831", mLoginReceiver);
42 // WarplyManager.verifyTicket("", "7000023699", mLoginReceiver); 42 // WarplyManager.verifyTicket("", "7000023699", mLoginReceiver);
43 } else { 43 } else {
44 startNextActivity(); 44 startNextActivity();
......
...@@ -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-->
...@@ -233,11 +233,11 @@ ...@@ -233,11 +233,11 @@
233 233
234 <!-- android:stopWithTask="false"--> 234 <!-- android:stopWithTask="false"-->
235 <!-- android:process=":warplyHealthService"--> 235 <!-- android:process=":warplyHealthService"-->
236 -<!-- <service--> 236 + <service
237 -<!-- android:name="ly.warp.sdk.services.WarplyHealthService"--> 237 + android:name="ly.warp.sdk.services.WarplyHealthService"
238 -<!-- android:exported="false"--> 238 + android:exported="false"
239 -<!-- android:foregroundServiceType="health"--> 239 + android:foregroundServiceType="health"
240 -<!-- android:permission="android.permission.BIND_JOB_SERVICE" />--> 240 + android:permission="android.permission.BIND_JOB_SERVICE" />
241 241
242 <service 242 <service
243 android:name="ly.warp.sdk.services.WarplyBeaconsRangingService" 243 android:name="ly.warp.sdk.services.WarplyBeaconsRangingService"
......
...@@ -81,6 +81,7 @@ import ly.warp.sdk.io.request.WarplyIntegrationRequest; ...@@ -81,6 +81,7 @@ import ly.warp.sdk.io.request.WarplyIntegrationRequest;
81 import ly.warp.sdk.services.EventService; 81 import ly.warp.sdk.services.EventService;
82 import ly.warp.sdk.services.FCMBaseMessagingService; 82 import ly.warp.sdk.services.FCMBaseMessagingService;
83 import ly.warp.sdk.services.VouchersFetchedService; 83 import ly.warp.sdk.services.VouchersFetchedService;
84 +import ly.warp.sdk.services.WarplyHealthService;
84 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager; 85 import ly.warp.sdk.utils.managers.WarplyAnalyticsManager;
85 import ly.warp.sdk.utils.managers.WarplyEventBusManager; 86 import ly.warp.sdk.utils.managers.WarplyEventBusManager;
86 import ly.warp.sdk.utils.managers.WarplyManager; 87 import ly.warp.sdk.utils.managers.WarplyManager;
...@@ -1477,10 +1478,10 @@ public class WarplyManagerHelper { ...@@ -1477,10 +1478,10 @@ public class WarplyManagerHelper {
1477 } 1478 }
1478 1479
1479 public static void logoutUser() { 1480 public static void logoutUser() {
1480 -// if (isMyServiceRunning(WarplyHealthService.class)) { 1481 + if (isMyServiceRunning(WarplyHealthService.class)) {
1481 -// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); 1482 + Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class);
1482 -// Warply.getWarplyContext().stopService(stepsServiceIntent); 1483 + Warply.getWarplyContext().stopService(stepsServiceIntent);
1483 -// } 1484 + }
1484 } 1485 }
1485 1486
1486 private static boolean isMyServiceRunning(Class<?> serviceClass) { 1487 private static boolean isMyServiceRunning(Class<?> serviceClass) {
......
...@@ -27,6 +27,8 @@ package ly.warp.sdk.utils.managers; ...@@ -27,6 +27,8 @@ package ly.warp.sdk.utils.managers;
27 27
28 import android.app.ActivityManager; 28 import android.app.ActivityManager;
29 import android.content.Context; 29 import android.content.Context;
30 +import android.content.Intent;
31 +import android.os.Build;
30 import android.os.Handler; 32 import android.os.Handler;
31 import android.os.Looper; 33 import android.os.Looper;
32 import android.text.TextUtils; 34 import android.text.TextUtils;
...@@ -106,6 +108,7 @@ import ly.warp.sdk.io.models.TransactionsList; ...@@ -106,6 +108,7 @@ import ly.warp.sdk.io.models.TransactionsList;
106 import ly.warp.sdk.io.models.TripMetrics; 108 import ly.warp.sdk.io.models.TripMetrics;
107 import ly.warp.sdk.io.models.UnifiedCampaignModel; 109 import ly.warp.sdk.io.models.UnifiedCampaignModel;
108 import ly.warp.sdk.io.models.UnifiedCoupon; 110 import ly.warp.sdk.io.models.UnifiedCoupon;
111 +import ly.warp.sdk.io.models.WarplyPacingEventModel;
109 import ly.warp.sdk.io.request.CosmoteCouponSharingRequest; 112 import ly.warp.sdk.io.request.CosmoteCouponSharingRequest;
110 import ly.warp.sdk.io.request.CosmotePostEventRequest; 113 import ly.warp.sdk.io.request.CosmotePostEventRequest;
111 import ly.warp.sdk.io.request.CosmoteRetrieveSharingRequest; 114 import ly.warp.sdk.io.request.CosmoteRetrieveSharingRequest;
...@@ -158,6 +161,7 @@ import ly.warp.sdk.services.EventCampaignService; ...@@ -158,6 +161,7 @@ import ly.warp.sdk.services.EventCampaignService;
158 import ly.warp.sdk.services.EventCouponsService; 161 import ly.warp.sdk.services.EventCouponsService;
159 import ly.warp.sdk.services.EventRewardsCouponsService; 162 import ly.warp.sdk.services.EventRewardsCouponsService;
160 import ly.warp.sdk.services.EventUnifiedCouponsService; 163 import ly.warp.sdk.services.EventUnifiedCouponsService;
164 +import ly.warp.sdk.services.WarplyHealthService;
161 import ly.warp.sdk.utils.WarpJSONParser; 165 import ly.warp.sdk.utils.WarpJSONParser;
162 import ly.warp.sdk.utils.WarpUtils; 166 import ly.warp.sdk.utils.WarpUtils;
163 import ly.warp.sdk.utils.WarplyDeviceInfoCollector; 167 import ly.warp.sdk.utils.WarplyDeviceInfoCollector;
...@@ -972,20 +976,20 @@ public class WarplyManager { ...@@ -972,20 +976,20 @@ public class WarplyManager {
972 WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); 976 WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge"));
973 } 977 }
974 978
975 -// if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { 979 + if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) {
976 -// if (!isMyServiceRunning(WarplyHealthService.class)) { 980 + if (!isMyServiceRunning(WarplyHealthService.class)) {
977 -// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); 981 + Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class);
978 -// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 982 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
979 -// Warply.getWarplyContext().startForegroundService(stepsServiceIntent); 983 + Warply.getWarplyContext().startForegroundService(stepsServiceIntent);
980 -// } else { 984 + } else {
981 -// Warply.getWarplyContext().startService(stepsServiceIntent); 985 + Warply.getWarplyContext().startService(stepsServiceIntent);
982 -// } 986 + }
983 -// 987 +
984 -// WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); 988 + WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel();
985 -// pacingVisible.setVisible(true); 989 + pacingVisible.setVisible(true);
986 -// EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); 990 + EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible));
987 -// } 991 + }
988 -// } 992 + }
989 } 993 }
990 } 994 }
991 } 995 }
...@@ -1106,20 +1110,20 @@ public class WarplyManager { ...@@ -1106,20 +1110,20 @@ public class WarplyManager {
1106 WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); 1110 WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge"));
1107 } 1111 }
1108 1112
1109 -// if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { 1113 + if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) {
1110 -// if (!isMyServiceRunning(WarplyHealthService.class)) { 1114 + if (!isMyServiceRunning(WarplyHealthService.class)) {
1111 -// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); 1115 + Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class);
1112 -// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 1116 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
1113 -// Warply.getWarplyContext().startForegroundService(stepsServiceIntent); 1117 + Warply.getWarplyContext().startForegroundService(stepsServiceIntent);
1114 -// } else { 1118 + } else {
1115 -// Warply.getWarplyContext().startService(stepsServiceIntent); 1119 + Warply.getWarplyContext().startService(stepsServiceIntent);
1116 -// } 1120 + }
1117 -// 1121 +
1118 -// WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); 1122 + WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel();
1119 -// pacingVisible.setVisible(true); 1123 + pacingVisible.setVisible(true);
1120 -// EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); 1124 + EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible));
1121 -// } 1125 + }
1122 -// } 1126 + }
1123 } 1127 }
1124 } 1128 }
1125 } 1129 }
...@@ -4831,20 +4835,20 @@ public class WarplyManager { ...@@ -4831,20 +4835,20 @@ public class WarplyManager {
4831 WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge")); 4835 WarpUtils.setUserTag(Warply.getWarplyContext(), profMetadata.optString("badge"));
4832 } 4836 }
4833 4837
4834 -// if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { 4838 + if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) {
4835 -// if (!isMyServiceRunning(WarplyHealthService.class)) { 4839 + if (!isMyServiceRunning(WarplyHealthService.class)) {
4836 -// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); 4840 + Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class);
4837 -// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 4841 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
4838 -// Warply.getWarplyContext().startForegroundService(stepsServiceIntent); 4842 + Warply.getWarplyContext().startForegroundService(stepsServiceIntent);
4839 -// } else { 4843 + } else {
4840 -// Warply.getWarplyContext().startService(stepsServiceIntent); 4844 + Warply.getWarplyContext().startService(stepsServiceIntent);
4841 -// } 4845 + }
4842 -// 4846 +
4843 -// WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); 4847 + WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel();
4844 -// pacingVisible.setVisible(true); 4848 + pacingVisible.setVisible(true);
4845 -// EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); 4849 + EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible));
4846 -// } 4850 + }
4847 -// } 4851 + }
4848 } 4852 }
4849 } 4853 }
4850 } 4854 }
......
...@@ -104,8 +104,10 @@ import ly.warp.sdk.io.models.UnifiedCoupon; ...@@ -104,8 +104,10 @@ 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;
107 import ly.warp.sdk.io.models.WarplyUnifiedActivatedEventModel; 108 import ly.warp.sdk.io.models.WarplyUnifiedActivatedEventModel;
108 import ly.warp.sdk.services.EventCampaignService; 109 import ly.warp.sdk.services.EventCampaignService;
110 +import ly.warp.sdk.services.WarplyHealthService;
109 import ly.warp.sdk.utils.WarpUtils; 111 import ly.warp.sdk.utils.WarpUtils;
110 import ly.warp.sdk.utils.WarplyManagerHelper; 112 import ly.warp.sdk.utils.WarplyManagerHelper;
111 import ly.warp.sdk.utils.WarplyProperty; 113 import ly.warp.sdk.utils.WarplyProperty;
...@@ -422,12 +424,12 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { ...@@ -422,12 +424,12 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
422 if (!EventBus.getDefault().isRegistered(this)) 424 if (!EventBus.getDefault().isRegistered(this))
423 EventBus.getDefault().register(this); 425 EventBus.getDefault().register(this);
424 426
425 -// if (mWebviewLoaded) { 427 + if (mWebviewLoaded) {
426 -// String scriptSourceInit = "webviewDidFocus(" + String.valueOf(mWebviewLoaded) + "," + String.valueOf(isMyServiceRunning(WarplyHealthService.class)) + ");"; 428 + String scriptSourceInit = "webviewDidFocus(" + String.valueOf(mWebviewLoaded) + "," + String.valueOf(isMyServiceRunning(WarplyHealthService.class)) + ");";
427 -// WarpView.this.evaluateJavascript(scriptSourceInit, s -> { 429 + WarpView.this.evaluateJavascript(scriptSourceInit, s -> {
428 -// 430 +
429 -// }); 431 + });
430 -// } 432 + }
431 } 433 }
432 434
433 @Override 435 @Override
...@@ -541,29 +543,29 @@ public class WarpView extends WebView implements DefaultLifecycleObserver { ...@@ -541,29 +543,29 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
541 pacingWidgetVisible.setVisible(true); 543 pacingWidgetVisible.setVisible(true);
542 EventBus.getDefault().post(new WarplyEventBusManager(pacingWidgetVisible)); 544 EventBus.getDefault().post(new WarplyEventBusManager(pacingWidgetVisible));
543 } else if (parts[1].equals("steps") && parts[2].equals("shortcutEnabled")) { // This is for the pacing service 545 } else if (parts[1].equals("steps") && parts[2].equals("shortcutEnabled")) { // This is for the pacing service
544 -// if (!isMyServiceRunning(WarplyHealthService.class)) { 546 + if (!isMyServiceRunning(WarplyHealthService.class)) {
545 -// LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel(); 547 + LoyaltySDKFirebaseEventModel analyticsEvent = new LoyaltySDKFirebaseEventModel();
546 -// analyticsEvent.setEventName("loyalty_steps_activation"); 548 + analyticsEvent.setEventName("loyalty_steps_activation");
547 -// EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent)); 549 + EventBus.getDefault().post(new WarplyEventBusManager(analyticsEvent));
548 -// 550 +
549 -// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); 551 + Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class);
550 -// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { 552 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
551 -// Warply.getWarplyContext().startForegroundService(stepsServiceIntent); 553 + Warply.getWarplyContext().startForegroundService(stepsServiceIntent);
552 -// } else { 554 + } else {
553 -// Warply.getWarplyContext().startService(stepsServiceIntent); 555 + Warply.getWarplyContext().startService(stepsServiceIntent);
554 -// } 556 + }
555 -// 557 +
556 -// WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); 558 + WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel();
557 -// pacingVisible.setVisible(true); 559 + pacingVisible.setVisible(true);
558 -// EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); 560 + EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible));
559 -// } 561 + }
560 } else if (parts[1].equals("steps") && parts[2].equals("shortcutDisabled")) { // This is for the pacing service 562 } else if (parts[1].equals("steps") && parts[2].equals("shortcutDisabled")) { // This is for the pacing service
561 -// Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); 563 + Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class);
562 -// Warply.getWarplyContext().stopService(stepsServiceIntent); 564 + Warply.getWarplyContext().stopService(stepsServiceIntent);
563 -// 565 +
564 -// WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel(); 566 + WarplyPacingEventModel pacingVisible = new WarplyPacingEventModel();
565 -// pacingVisible.setVisible(false); 567 + pacingVisible.setVisible(false);
566 -// EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible)); 568 + EventBus.getDefault().post(new WarplyEventBusManager(pacingVisible));
567 } else if (parts[1].equals("request") || parts[1].equals("response")) { 569 } else if (parts[1].equals("request") || parts[1].equals("response")) {
568 WarpUtils.log("**************** WARPLY Webview Log START *****************"); 570 WarpUtils.log("**************** WARPLY Webview Log START *****************");
569 WarpUtils.log(message); 571 WarpUtils.log(message);
......