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
2024-04-03 17:36:08 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6686970acae3f33ba7fe59307e13af2b19a24e56
6686970a
1 parent
0df4a070
new login implementation with JWT, new logout, optimizations
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
4 deletions
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/ApiClient.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/ApiService.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
app/src/main/java/warp/ly/android_sdk/activities/SplashActivity.java
View file @
6686970
...
...
@@ -36,9 +36,10 @@ public class SplashActivity extends BaseActivity {
@Override
public
void
onWarplyReady
()
{
if
(!
WarplyDBHelper
.
getInstance
(
SplashActivity
.
this
).
isTableNotEmpty
(
"auth"
))
{
WarplyManager
.
getCosmoteUser
(
new
WarplyCosmoteUserRequest
()
.
setGuid
(
"7000023717"
),
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons, prod 6006552990, prod 6005892749, live 3000184910,prod 7000070282
mLoginReceiver
);
//6012049321, 6012049322, 6012049323, 7000000831 history, 7000000826, 7000000831 shared coupons
//prod 6006552990, prod 6005892749, live 3000184910,prod 7000070282
WarplyManager
.
getCosmoteUser
(
"7000000833"
,
mLoginReceiver
);
// WarplyManager.verifyTicket("", "7000000833", mLoginReceiver);
}
else
{
startNextActivity
();
}
...
...
warply_android_sdk/build.gradle
View file @
6686970
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.5.4r1
8
'
PUBLISH_VERSION
=
'4.5.5.4r1
9
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
@@ -112,6 +112,9 @@ dependencies {
//------------------------------ Lifecycle -----------------------------//
implementation
"androidx.lifecycle:lifecycle-extensions:2.2.0"
//------------------------------ Retrofit Logs -----------------------------//
// implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
}
// In every export please update the version number
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/fragments/HomeFragment.java
View file @
6686970
...
...
@@ -18,6 +18,8 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
;
import
org.json.JSONObject
;
import
java.util.ArrayList
;
import
ly.warp.sdk.R
;
...
...
@@ -120,6 +122,10 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip
if
(
view
.
getId
()
==
R
.
id
.
rl_driving_history
)
{
Intent
intent
=
new
Intent
(
getContext
(),
TelematicsHistoryActivity
.
class
);
startActivity
(
intent
);
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
iv_settings
)
{
WarplyManager
.
logout
(
mLogoutReceiver
);
}
}
...
...
@@ -152,4 +158,16 @@ public class HomeFragment extends Fragment implements View.OnClickListener, Swip
Toast
.
makeText
(
getActivity
(),
"Coupons Error"
,
Toast
.
LENGTH_SHORT
).
show
();
}
};
private
final
CallbackReceiver
<
JSONObject
>
mLogoutReceiver
=
new
CallbackReceiver
<
JSONObject
>()
{
@Override
public
void
onSuccess
(
JSONObject
result
)
{
Toast
.
makeText
(
getActivity
(),
"LOGOUT SUCCESS"
,
Toast
.
LENGTH_SHORT
).
show
();
}
@Override
public
void
onFailure
(
int
errorCode
)
{
Toast
.
makeText
(
getActivity
(),
"LOGOUT ERROR"
,
Toast
.
LENGTH_SHORT
).
show
();
}
};
}
\ No newline at end of file
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/ApiClient.java
View file @
6686970
...
...
@@ -47,7 +47,12 @@ public class ApiClient {
}
private
static
OkHttpClient
getClient
()
{
/* Logs Enabled */
// HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
// interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
return
new
OkHttpClient
.
Builder
()
// .addInterceptor(interceptor) // Logs Enabled
.
connectTimeout
(
30
,
TimeUnit
.
SECONDS
)
.
writeTimeout
(
30
,
TimeUnit
.
SECONDS
)
.
readTimeout
(
30
,
TimeUnit
.
SECONDS
)
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/ApiService.java
View file @
6686970
...
...
@@ -44,6 +44,39 @@ public interface ApiService {
@Header
(
WarpConstants
.
HEADER_SIGNATURE
)
String
signature
);
@Headers
(
"Content-Type: application/json"
)
@POST
(
"/partners/oauth/{appUuid}/token"
)
Call
<
ResponseBody
>
cosmoteUser
(
@Path
(
"appUuid"
)
String
appUuid
,
@Body
RequestBody
request
,
@Header
(
WarpConstants
.
HEADER_DATE
)
String
timeStamp
,
@Header
(
WarpConstants
.
HEADER_LOYALTY_BUNDLE_ID
)
String
bundleId
,
@Header
(
WarpConstants
.
HEADER_UNIQUE_DEVICE_ID
)
String
deviceId
,
@Header
(
WarpConstants
.
HEADER_CHANNEL
)
String
channel
,
@Header
(
WarpConstants
.
HEADER_WEB_ID
)
String
webId
,
@Header
(
WarpConstants
.
HEADER_SIGNATURE
)
String
signature
,
@Header
(
WarpConstants
.
HEADER_AUTHORIZATION
)
String
basic
);
@Headers
(
"Content-Type: application/json"
)
@POST
(
"/partners/cosmote/verify"
)
Call
<
ResponseBody
>
verifyUser
(
@Body
RequestBody
request
,
@Header
(
WarpConstants
.
HEADER_DATE
)
String
timeStamp
,
@Header
(
WarpConstants
.
HEADER_LOYALTY_BUNDLE_ID
)
String
bundleId
,
@Header
(
WarpConstants
.
HEADER_UNIQUE_DEVICE_ID
)
String
deviceId
,
@Header
(
WarpConstants
.
HEADER_CHANNEL
)
String
channel
,
@Header
(
WarpConstants
.
HEADER_WEB_ID
)
String
webId
,
@Header
(
WarpConstants
.
HEADER_SIGNATURE
)
String
signature
);
@Headers
(
"Content-Type: application/json"
)
@POST
(
"/oauth/{appUuid}/logout"
)
Call
<
ResponseBody
>
logoutUser
(
@Path
(
"appUuid"
)
String
appUuid
,
@Body
RequestBody
request
,
@Header
(
WarpConstants
.
HEADER_DATE
)
String
timeStamp
,
@Header
(
WarpConstants
.
HEADER_LOYALTY_BUNDLE_ID
)
String
bundleId
,
@Header
(
WarpConstants
.
HEADER_UNIQUE_DEVICE_ID
)
String
deviceId
,
@Header
(
WarpConstants
.
HEADER_CHANNEL
)
String
channel
,
@Header
(
WarpConstants
.
HEADER_WEB_ID
)
String
webId
,
@Header
(
WarpConstants
.
HEADER_SIGNATURE
)
String
signature
);
@Headers
(
"Content-Type: application/json"
)
@POST
(
"/oauth/{appUuid}/context"
)
Call
<
ResponseBody
>
getCouponsets
(
@Path
(
"appUuid"
)
String
appUuid
,
@Body
RequestBody
request
,
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
6686970
This diff is collapsed. Click to expand it.
Please
register
or
login
to post a comment