Showing
2 changed files
with
20 additions
and
7 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.4-cosbeta89' | 5 | + PUBLISH_VERSION = '4.5.4-cosbeta90' |
6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
7 | } | 7 | } |
8 | 8 | ||
... | @@ -76,9 +76,9 @@ dependencies { | ... | @@ -76,9 +76,9 @@ dependencies { |
76 | 76 | ||
77 | //------------------------------ Huawei -----------------------------// | 77 | //------------------------------ Huawei -----------------------------// |
78 | implementation 'com.huawei.agconnect:agconnect-core:1.6.5.300' | 78 | implementation 'com.huawei.agconnect:agconnect-core:1.6.5.300' |
79 | - implementation 'com.huawei.hms:base:6.4.0.302' | 79 | + implementation 'com.huawei.hms:base:6.6.0.300' |
80 | - implementation 'com.huawei.hms:push:6.3.0.304' | 80 | + implementation 'com.huawei.hms:push:6.7.0.300' |
81 | - implementation 'com.huawei.hms:ads-identifier:3.4.39.302' | 81 | + implementation 'com.huawei.hms:ads-identifier:3.4.56.300' |
82 | 82 | ||
83 | //------------------------------ SQLCipher -----------------------------// | 83 | //------------------------------ SQLCipher -----------------------------// |
84 | api "net.zetetic:android-database-sqlcipher:4.5.0" | 84 | api "net.zetetic:android-database-sqlcipher:4.5.0" | ... | ... |
... | @@ -26,14 +26,18 @@ | ... | @@ -26,14 +26,18 @@ |
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; | ||
29 | import android.content.Context; | 31 | import android.content.Context; |
30 | import android.content.Intent; | 32 | import android.content.Intent; |
31 | import android.os.Build; | 33 | import android.os.Build; |
34 | +import android.os.SystemClock; | ||
32 | 35 | ||
33 | import androidx.work.OneTimeWorkRequest; | 36 | import androidx.work.OneTimeWorkRequest; |
34 | import androidx.work.WorkManager; | 37 | import androidx.work.WorkManager; |
35 | 38 | ||
36 | import org.greenrobot.eventbus.EventBus; | 39 | import org.greenrobot.eventbus.EventBus; |
40 | +import org.json.JSONArray; | ||
37 | import org.json.JSONException; | 41 | import org.json.JSONException; |
38 | import org.json.JSONObject; | 42 | import org.json.JSONObject; |
39 | 43 | ||
... | @@ -74,6 +78,7 @@ import ly.warp.sdk.io.models.Coupon; | ... | @@ -74,6 +78,7 @@ import ly.warp.sdk.io.models.Coupon; |
74 | import ly.warp.sdk.io.models.CouponList; | 78 | import ly.warp.sdk.io.models.CouponList; |
75 | import ly.warp.sdk.io.models.Couponset; | 79 | import ly.warp.sdk.io.models.Couponset; |
76 | import ly.warp.sdk.io.models.CouponsetsList; | 80 | import ly.warp.sdk.io.models.CouponsetsList; |
81 | +import ly.warp.sdk.io.models.LoyaltyContextualOfferModel; | ||
77 | import ly.warp.sdk.io.models.MerchantCategoriesList; | 82 | import ly.warp.sdk.io.models.MerchantCategoriesList; |
78 | import ly.warp.sdk.io.models.MerchantList; | 83 | import ly.warp.sdk.io.models.MerchantList; |
79 | import ly.warp.sdk.io.models.PacingDetails; | 84 | import ly.warp.sdk.io.models.PacingDetails; |
... | @@ -832,7 +837,11 @@ public class WarplyManager { | ... | @@ -832,7 +837,11 @@ public class WarplyManager { |
832 | if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { | 837 | if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { |
833 | if (!isMyServiceRunning(WarplyHealthService.class)) { | 838 | if (!isMyServiceRunning(WarplyHealthService.class)) { |
834 | Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | 839 | Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); |
835 | - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | 840 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { |
841 | + AlarmManager mgr = (AlarmManager) Warply.getWarplyContext().getSystemService(Context.ALARM_SERVICE); | ||
842 | + PendingIntent pi = PendingIntent.getService(Warply.getWarplyContext(), 2002, stepsServiceIntent, PendingIntent.FLAG_ONE_SHOT); | ||
843 | + mgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 1000, pi); | ||
844 | + } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
836 | Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | 845 | Warply.getWarplyContext().startForegroundService(stepsServiceIntent); |
837 | } else { | 846 | } else { |
838 | Warply.getWarplyContext().startService(stepsServiceIntent); | 847 | Warply.getWarplyContext().startService(stepsServiceIntent); |
... | @@ -1455,7 +1464,7 @@ public class WarplyManager { | ... | @@ -1455,7 +1464,7 @@ public class WarplyManager { |
1455 | } | 1464 | } |
1456 | WarplyManagerHelper.setCarouselList(campaignCarouselList); | 1465 | WarplyManagerHelper.setCarouselList(campaignCarouselList); |
1457 | 1466 | ||
1458 | - // ArrayList<LoyaltyContextualOfferModel> list = new ArrayList<>(); | 1467 | +// ArrayList<LoyaltyContextualOfferModel> list = new ArrayList<>(); |
1459 | // JSONArray jArray = null; | 1468 | // JSONArray jArray = null; |
1460 | // try { | 1469 | // try { |
1461 | // jArray = new JSONArray("[\n" + | 1470 | // jArray = new JSONArray("[\n" + |
... | @@ -2418,7 +2427,11 @@ public class WarplyManager { | ... | @@ -2418,7 +2427,11 @@ public class WarplyManager { |
2418 | if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { | 2427 | if (profMetadata.has("steps_enabled") && profMetadata.optBoolean("steps_enabled")) { |
2419 | if (!isMyServiceRunning(WarplyHealthService.class)) { | 2428 | if (!isMyServiceRunning(WarplyHealthService.class)) { |
2420 | Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); | 2429 | Intent stepsServiceIntent = new Intent(Warply.getWarplyContext(), WarplyHealthService.class); |
2421 | - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | 2430 | + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { |
2431 | + AlarmManager mgr = (AlarmManager) Warply.getWarplyContext().getSystemService(Context.ALARM_SERVICE); | ||
2432 | + PendingIntent pi = PendingIntent.getService(Warply.getWarplyContext(), 2002, stepsServiceIntent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_MUTABLE); | ||
2433 | + mgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + 1000, pi); | ||
2434 | + } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { | ||
2422 | Warply.getWarplyContext().startForegroundService(stepsServiceIntent); | 2435 | Warply.getWarplyContext().startForegroundService(stepsServiceIntent); |
2423 | } else { | 2436 | } else { |
2424 | Warply.getWarplyContext().startService(stepsServiceIntent); | 2437 | Warply.getWarplyContext().startService(stepsServiceIntent); | ... | ... |
-
Please register or login to post a comment