Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2022-10-11 18:21:49 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4be1fb723303c1d4caac5773cb9dd14970a43488
4be1fb72
1 parent
7f82f324
minor fixes
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
warply_android_sdk/build.gradle
View file @
4be1fb7
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta
89
'
PUBLISH_VERSION
=
'4.5.4-cosbeta
90
'
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"
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
4be1fb7
...
...
@@ -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
);
...
...
Please
register
or
login
to post a comment