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
2023-12-05 11:54:05 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
822cef73e63867bb4575394b9182697cae7e2816
822cef73
1 parent
52cbbc8a
crash fixes
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
12 deletions
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
warply_android_sdk/src/main/java/ly/warp/sdk/Warply.java
View file @
822cef7
...
...
@@ -1586,8 +1586,8 @@ public enum Warply {
}
}
if
(
INSTANCE
.
mRequestQueue
==
null
)
INSTANCE
.
mRequestQueue
=
Volley
.
newRequestQueue
(
mContext
);
if
(
INSTANCE
.
mRequestQueue
==
null
&&
INSTANCE
.
mContext
!=
null
)
INSTANCE
.
mRequestQueue
=
Volley
.
newRequestQueue
(
INSTANCE
.
mContext
);
if
(
tempAnalytics
!=
null
&&
tempAnalytics
.
length
()
>
0
)
{
String
urlAnalytics
=
WarplyProperty
.
getBaseUrl
(
mContext
)
+
WarpConstants
.
WARPLY_ASYNC
+
WarpConstants
.
WARPLY_ANALYTICS
+
WarplyProperty
.
getAppUuid
(
mContext
)
+
"/"
;
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/WarplyManagerHelper.java
View file @
822cef7
...
...
@@ -247,7 +247,7 @@ public class WarplyManagerHelper {
/**
* Handle sharing flow
*/
public
static
void
handleSharing
(
Context
context
,
String
sharingId
)
{
public
static
void
handleSharing
(
Activity
context
,
String
sharingId
)
{
WarpUtils
.
log
(
"SHARING_ID: "
+
sharingId
);
WarplyManager
.
cosmoteSharing
(
new
CosmoteSharingRequest
().
setSharingId
(
sharingId
),
new
CallbackReceiver
<
JSONObject
>()
{
@Override
...
...
@@ -292,7 +292,8 @@ public class WarplyManagerHelper {
/**
* First dialog when we handle the deeplink
*/
private
static
void
initialSharingDialog
(
Context
context
,
String
alertTitle
,
String
sharingId
,
boolean
isSupermarket
)
{
private
static
void
initialSharingDialog
(
Activity
context
,
String
alertTitle
,
String
sharingId
,
boolean
isSupermarket
)
{
if
(!
context
.
isFinishing
())
{
mAlertDialogSharing
=
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
cos_dlg_success_title
)
.
setMessage
(
alertTitle
)
...
...
@@ -334,11 +335,13 @@ public class WarplyManagerHelper {
})
.
show
();
}
}
/**
* Dialog when we success get the sharing gift
*/
private
static
void
acceptSharingDialog
(
Context
context
,
boolean
isSupermarket
)
{
private
static
void
acceptSharingDialog
(
Activity
context
,
boolean
isSupermarket
)
{
if
(!
context
.
isFinishing
())
{
mAlertDialogAcceptSharing
=
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
cos_dlg_success_title
)
.
setMessage
(
isSupermarket
?
R
.
string
.
cos_dlg_positive_button_text2
:
R
.
string
.
cos_dlg_positive_button_text
)
...
...
@@ -347,11 +350,13 @@ public class WarplyManagerHelper {
})
.
show
();
}
}
/**
* Dialog when we reject the sharing gift
*/
private
static
void
rejectSharingDialog
(
Context
context
,
String
sharingId
)
{
private
static
void
rejectSharingDialog
(
Activity
context
,
String
sharingId
)
{
if
(!
context
.
isFinishing
())
{
mAlertDialogRejectSharing
=
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
cos_dlg_reject_title
)
.
setMessage
(
R
.
string
.
cos_dlg_reject_text
)
...
...
@@ -380,11 +385,13 @@ public class WarplyManagerHelper {
})
.
show
();
}
}
/**
* Dialog when the gift gets returned
*/
private
static
void
returnSharingDialog
(
Context
context
,
String
alertTitle
)
{
private
static
void
returnSharingDialog
(
Activity
context
,
String
alertTitle
)
{
if
(!
context
.
isFinishing
())
{
mAlertDialogReturnSharing
=
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
cod_dlg_return_title
)
.
setMessage
(
alertTitle
)
...
...
@@ -393,11 +400,13 @@ public class WarplyManagerHelper {
})
.
show
();
}
}
/**
* Dialog when the gift gets successfully returned
*/
private
static
void
returnSharingSuccessDialog
(
Context
context
)
{
private
static
void
returnSharingSuccessDialog
(
Activity
context
)
{
if
(!
context
.
isFinishing
())
{
mAlertDialogReturnSharing
=
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
cod_dlg_reject_title
)
.
setMessage
(
R
.
string
.
cod_dlg_reject_subtitle
)
...
...
@@ -406,11 +415,13 @@ public class WarplyManagerHelper {
})
.
show
();
}
}
/**
* Error dialog
*/
private
static
void
errorSharingDialog
(
Context
context
)
{
private
static
void
errorSharingDialog
(
Activity
context
)
{
if
(!
context
.
isFinishing
())
{
mAlertDialogErrorSharing
=
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
cos_dlg_error_title
)
.
setMessage
(
R
.
string
.
cos_dlg_error_subtitle
)
...
...
@@ -419,11 +430,13 @@ public class WarplyManagerHelper {
})
.
show
();
}
}
/**
* Return dialog
*/
private
static
void
returnDialog
(
Context
context
,
String
message
,
String
sharingId
)
{
private
static
void
returnDialog
(
Activity
context
,
String
message
,
String
sharingId
)
{
if
(!
context
.
isFinishing
())
{
mAlertDialogErrorSharing
=
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
cos_dlg_return_title
)
.
setMessage
(
message
)
...
...
@@ -466,11 +479,13 @@ public class WarplyManagerHelper {
})
.
show
();
}
}
/**
* Expired dialog
*/
private
static
void
errorExpiredDialog
(
Context
context
,
String
message
)
{
private
static
void
errorExpiredDialog
(
Activity
context
,
String
message
)
{
if
(!
context
.
isFinishing
())
{
mAlertDialogErrorExpiredSharing
=
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
cos_dlg_error_title
)
.
setMessage
(
message
)
...
...
@@ -479,11 +494,13 @@ public class WarplyManagerHelper {
})
.
show
();
}
}
/**
* Used dialog
*/
private
static
void
errorUsedDialog
(
Context
context
,
String
message
)
{
private
static
void
errorUsedDialog
(
Activity
context
,
String
message
)
{
if
(!
context
.
isFinishing
())
{
mAlertDialogErrorUsedSharing
=
new
AlertDialog
.
Builder
(
context
)
.
setTitle
(
R
.
string
.
cos_dlg_error_title
)
.
setMessage
(
message
)
...
...
@@ -492,6 +509,7 @@ public class WarplyManagerHelper {
})
.
show
();
}
}
/**
* No Internet Connection Dialog
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/views/WarpView.java
View file @
822cef7
...
...
@@ -659,6 +659,7 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
private
void
checkForPermissions
(
String
origin
,
Callback
callback
)
{
String
perm
=
Manifest
.
permission
.
ACCESS_FINE_LOCATION
;
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
M
||
getContext
().
checkSelfPermission
(
perm
)
==
PackageManager
.
PERMISSION_GRANTED
)
{
geolocationCallback
=
callback
;
if
(
isGPSEnabled
())
{
callback
.
invoke
(
origin
,
true
,
false
);
}
else
{
...
...
@@ -678,6 +679,8 @@ public class WarpView extends WebView implements DefaultLifecycleObserver {
}
private
void
enableLocationSettings
()
{
if
(
geolocationCallback
==
null
)
return
;
GoogleApiClient
googleApiClient
=
new
GoogleApiClient
.
Builder
(
WarpActivity
)
.
addApi
(
LocationServices
.
API
)
.
build
();
...
...
Please
register
or
login
to post a comment