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-09-23 14:28:33 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
51ab242bf94f6d4d3ddb5490674c7d6f2290796b
51ab242b
1 parent
7dbdb264
push fixes
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
2 deletions
app/build.gradle
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/WarpViewActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
warply_android_sdk/src/main/res/drawable-xhdpi/ic_gift_circle.png
app/build.gradle
View file @
51ab242
apply
plugin:
'com.android.application'
apply
plugin:
'com.google.gms.google-services'
android
{
compileSdkVersion
31
...
...
warply_android_sdk/build.gradle
View file @
51ab242
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cosbeta73
a
'
PUBLISH_VERSION
=
'4.5.4-cosbeta73'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/WarpViewActivity.java
View file @
51ab242
...
...
@@ -50,6 +50,7 @@ import androidx.work.WorkManager;
import
org.greenrobot.eventbus.EventBus
;
import
org.greenrobot.eventbus.Subscribe
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
java.security.SecureRandom
;
...
...
@@ -60,6 +61,7 @@ import java.util.concurrent.ThreadLocalRandom;
import
java.util.concurrent.TimeUnit
;
import
ly.warp.sdk.Warply
;
import
ly.warp.sdk.db.WarplyDBHelper
;
import
ly.warp.sdk.io.callbacks.CallbackReceiver
;
import
ly.warp.sdk.io.models.CouponList
;
import
ly.warp.sdk.io.request.PacingCalculateRequest
;
...
...
@@ -86,7 +88,7 @@ public class WarpViewActivity extends WarpBaseActivity {
// ===========================================================
private
WarpView
mWarpView
;
private
static
Handler
metersHandler
=
new
Handler
()
;
private
static
Handler
metersHandler
;
// ===========================================================
// Methods for/from SuperClass/Interfaces
...
...
@@ -95,6 +97,7 @@ public class WarpViewActivity extends WarpBaseActivity {
@Override
public
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
metersHandler
=
new
Handler
();
WarplySessionManager
.
onCreateActivity
(
this
);
initViews
();
Warply
.
getInitializer
(
this
).
init
();
...
...
@@ -223,6 +226,22 @@ public class WarpViewActivity extends WarpBaseActivity {
// user viewed campaign through notification
if
(
intent
.
hasExtra
(
"source"
)
&&
intent
.
getStringExtra
(
"source"
).
equalsIgnoreCase
(
"from_notification_status"
))
{
JSONObject
params
=
new
JSONObject
();
try
{
params
.
putOpt
(
"web_id"
,
WarpUtils
.
getWebId
(
Warply
.
getWarplyContext
()));
params
.
putOpt
(
"app_uuid"
,
WarplyProperty
.
getAppUuid
(
Warply
.
getWarplyContext
()));
params
.
putOpt
(
"api_key"
,
WarpUtils
.
getApiKey
(
Warply
.
getWarplyContext
()));
params
.
putOpt
(
"session_uuid"
,
sessionUUID
);
params
.
putOpt
(
"access_token"
,
WarplyDBHelper
.
getInstance
(
Warply
.
getWarplyContext
()).
getAuthValue
(
"access_token"
));
params
.
putOpt
(
"refresh_token"
,
WarplyDBHelper
.
getInstance
(
Warply
.
getWarplyContext
()).
getAuthValue
(
"refresh_token"
));
params
.
putOpt
(
"client_id"
,
WarplyDBHelper
.
getInstance
(
Warply
.
getWarplyContext
()).
getClientValue
(
"client_id"
));
params
.
putOpt
(
"client_secret"
,
WarplyDBHelper
.
getInstance
(
Warply
.
getWarplyContext
()).
getClientValue
(
"client_secret"
));
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
WarpUtils
.
setWebviewParams
(
Warply
.
getWarplyContext
(),
params
);
setUpPushEvents
(
sessionUUID
);
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
51ab242
...
...
@@ -73,6 +73,7 @@ import ly.warp.sdk.io.models.PushCampaign;
import
ly.warp.sdk.io.models.WarplyCouponsChangedEventModel
;
import
ly.warp.sdk.io.request.CosmoteRetrieveSharingRequest
;
import
ly.warp.sdk.io.request.CosmoteSharingRequest
;
import
ly.warp.sdk.io.request.WarplyConsumerRequest
;
import
ly.warp.sdk.io.request.WarplyEditConsumerRequest
;
import
ly.warp.sdk.io.request.WarplyIntegrationRequest
;
import
ly.warp.sdk.io.request.WarplyUserCouponsRequest
;
...
...
@@ -962,6 +963,35 @@ public class WarplyManagerHelper {
@Override
public
void
onSuccess
(
JSONObject
result
)
{
WarpUtils
.
log
(
"EDIT CONSUMER SUCCESS"
);
WarplyManager
.
getConsumer
(
new
WarplyConsumerRequest
(),
new
CallbackReceiver
<
Consumer
>()
{
@Override
public
void
onSuccess
(
Consumer
result
)
{
WarplyManagerHelper
.
setConsumerInternal
(
result
);
if
(
result
!=
null
)
{
JSONObject
profMetadata
=
WarpJSONParser
.
getJSONFromString
(
result
.
getProfileMetadata
());
if
(
profMetadata
!=
null
&&
profMetadata
.
has
(
"nonTelco"
))
{
WarpUtils
.
setUserNonTelco
(
Warply
.
getWarplyContext
(),
profMetadata
.
optBoolean
(
"nonTelco"
));
}
else
{
WarpUtils
.
setUserNonTelco
(
Warply
.
getWarplyContext
(),
false
);
}
}
if
(
result
!=
null
)
{
JSONObject
profMetadata
=
WarpJSONParser
.
getJSONFromString
(
result
.
getProfileMetadata
());
if
(
profMetadata
!=
null
)
{
if
(
profMetadata
.
has
(
"badge"
))
{
WarpUtils
.
setUserTag
(
Warply
.
getWarplyContext
(),
profMetadata
.
optString
(
"badge"
));
}
}
}
}
@Override
public
void
onFailure
(
int
errorCode
)
{
}
});
}
@Override
...
...
warply_android_sdk/src/main/res/drawable-xhdpi/ic_gift_circle.png
View file @
51ab242
22.6 KB
|
W:
|
H:
21 KB
|
W:
|
H:
2-up
Swipe
Onion skin
Please
register
or
login
to post a comment