Panagiotis Triantafyllou

minor fixes

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta89'
PUBLISH_VERSION = '4.5.4-cosbeta90'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......@@ -76,9 +76,9 @@ dependencies {
//------------------------------ Huawei -----------------------------//
implementation 'com.huawei.agconnect:agconnect-core:1.6.5.300'
implementation 'com.huawei.hms:base:6.4.0.302'
implementation 'com.huawei.hms:push:6.3.0.304'
implementation 'com.huawei.hms:ads-identifier:3.4.39.302'
implementation 'com.huawei.hms:base:6.6.0.300'
implementation 'com.huawei.hms:push:6.7.0.300'
implementation 'com.huawei.hms:ads-identifier:3.4.56.300'
//------------------------------ SQLCipher -----------------------------//
api "net.zetetic:android-database-sqlcipher:4.5.0"
......
......@@ -26,14 +26,18 @@
package ly.warp.sdk.utils.managers;
import android.app.ActivityManager;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.SystemClock;
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkManager;
import org.greenrobot.eventbus.EventBus;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
......@@ -74,6 +78,7 @@ import ly.warp.sdk.io.models.Coupon;
import ly.warp.sdk.io.models.CouponList;
import ly.warp.sdk.io.models.Couponset;
import ly.warp.sdk.io.models.CouponsetsList;
import ly.warp.sdk.io.models.LoyaltyContextualOfferModel;
import ly.warp.sdk.io.models.MerchantCategoriesList;
import ly.warp.sdk.io.models.MerchantList;
import ly.warp.sdk.io.models.PacingDetails;
......@@ -832,7 +837,11 @@ public class WarplyManager {
if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) {
if (!isMyServiceRunning(WarplyHealthService.class)) {
Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
AlarmManager mgr = (AlarmManager) Warply.getWarplyContext().getSystemService(Context.ALARM_SERVICE);
PendingIntent pi = PendingIntent.getService(Warply.getWarplyContext(), 2002, stepsServiceIntent, PendingIntent.FLAG_ONE_SHOT);
mgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 1000, pi);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Warply.getWarplyContext().startForegroundService(stepsServiceIntent);
} else {
Warply.getWarplyContext().startService(stepsServiceIntent);
......@@ -1455,7 +1464,7 @@ public class WarplyManager {
}
WarplyManagerHelper.setCarouselList(campaignCarouselList);
// ArrayList<LoyaltyContextualOfferModel> list = new ArrayList<>();
// ArrayList<LoyaltyContextualOfferModel> list = new ArrayList<>();
// JSONArray jArray = null;
// try {
// jArray = new JSONArray("[\n" +
......@@ -2418,7 +2427,11 @@ public class WarplyManager {
if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) {
if (!isMyServiceRunning(WarplyHealthService.class)) {
Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
AlarmManager mgr = (AlarmManager) Warply.getWarplyContext().getSystemService(Context.ALARM_SERVICE);
PendingIntent pi = PendingIntent.getService(Warply.getWarplyContext(), 2002, stepsServiceIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_MUTABLE);
mgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 1000, pi);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
Warply.getWarplyContext().startForegroundService(stepsServiceIntent);
} else {
Warply.getWarplyContext().startService(stepsServiceIntent);
......