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-03-30 18:48:44 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e53acf649391eea4cf8b4e7c28c63f99986c29fc
e53acf64
1 parent
22b320f0
more additions
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
97 additions
and
3 deletions
app/src/main/assets/warply.properties
warply_android_sdk/build.gradle
warply_android_sdk/src/main/AndroidManifest.xml
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BillPaymentActivity.java
warply_android_sdk/src/main/res/drawable-xhdpi/ic_launcher.png
app/src/main/assets/warply.properties
View file @
e53acf6
...
...
@@ -46,4 +46,4 @@ LoginType=msisdn
# The deeplink url scheme for react native campaigns:
# Example visit.greece.gr
#
DL_URL_SCHEME
=
\ No newline at end of file
DL_URL_SCHEME
=
demo
\ No newline at end of file
...
...
warply_android_sdk/build.gradle
View file @
e53acf6
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4-cos
2
'
PUBLISH_VERSION
=
'4.5.4-cos
3
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/AndroidManifest.xml
View file @
e53acf6
...
...
@@ -66,6 +66,11 @@
<data
android:host=
"cosmoteapp.gr"
android:scheme=
"demo"
/>
<data
android:host=
"cosmoteapp.gr"
android:pathPrefix=
"/payment"
android:scheme=
"demo"
/>
</intent-filter>
</activity>
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BaseFragmentActivity.java
View file @
e53acf6
...
...
@@ -126,6 +126,10 @@ public class BaseFragmentActivity extends FragmentActivity implements Navigation
String
parameter
=
String
.
valueOf
(
intent
.
getData
().
getQueryParameter
(
"participations"
));
showDialog
(
parameter
);
}
if
(
data
.
getPath
().
equals
(
"/payment"
))
{
Intent
intentBill
=
new
Intent
(
BaseFragmentActivity
.
this
,
BillPaymentActivity
.
class
);
startActivity
(
intentBill
);
}
}
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/BillPaymentActivity.java
View file @
e53acf6
...
...
@@ -2,8 +2,20 @@ package ly.warp.sdk.activities;
import
android.app.Activity
;
import
android.app.Dialog
;
import
android.app.Notification
;
import
android.app.NotificationChannel
;
import
android.app.NotificationManager
;
import
android.app.PendingIntent
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.pm.PackageManager
;
import
android.graphics.BitmapFactory
;
import
android.graphics.Typeface
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.text.Spannable
;
import
android.text.SpannableString
;
import
android.text.SpannableStringBuilder
;
...
...
@@ -14,6 +26,8 @@ import android.widget.ImageView;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
androidx.core.app.NotificationCompat
;
import
ly.warp.sdk.R
;
import
ly.warp.sdk.db.WarplyDBHelper
;
import
ly.warp.sdk.utils.WarpUtils
;
...
...
@@ -54,14 +68,41 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene
}
@Override
protected
void
onNewIntent
(
Intent
intent
)
{
super
.
onNewIntent
(
intent
);
if
(
intent
.
hasExtra
(
"channel"
))
{
String
tempUrl
=
BaseFragmentActivity
.
getUniqueCampaignList
().
get
(
"lucky_draw"
).
get
(
0
).
getIndexUrl
();
tempUrl
=
tempUrl
+
"?web_id="
+
WarpUtils
.
getWebId
(
this
)
+
"&app_uuid="
+
WarplyProperty
.
getAppUuid
(
this
)
+
"&api_key="
+
WarpUtils
.
getApiKey
(
this
)
+
"&session_uuid="
+
BaseFragmentActivity
.
getUniqueCampaignList
().
get
(
"lucky_draw"
).
get
(
0
).
getSessionUUID
()
+
"&access_token="
+
WarplyDBHelper
.
getInstance
(
this
).
getAuthValue
(
"access_token"
)
+
"&refresh_token="
+
WarplyDBHelper
.
getInstance
(
this
).
getAuthValue
(
"refresh_token"
)
+
"&client_id="
+
WarplyDBHelper
.
getInstance
(
this
).
getClientValue
(
"client_id"
)
+
"&client_secret="
+
WarplyDBHelper
.
getInstance
(
this
).
getClientValue
(
"client_secret"
);
if
(
BaseFragmentActivity
.
getConsumer
()
!=
null
)
tempUrl
=
tempUrl
+
"&auth_token="
+
(
BaseFragmentActivity
.
getConsumer
().
getUuid
());
else
tempUrl
=
tempUrl
+
"&auth_token="
;
startActivity
(
WarpViewActivity
.
createIntentFromURL
(
this
,
tempUrl
));
}
}
@Override
public
void
onClick
(
View
view
)
{
if
(
view
.
getId
()
==
R
.
id
.
iv_bill_payment_close
)
{
onBackPressed
();
return
;
}
if
(
view
.
getId
()
==
R
.
id
.
button_pay
)
{
// open dialog
showDialog
();
new
Handler
(
Looper
.
getMainLooper
()).
postDelayed
(
()
->
createLocalNotification
(
BillPaymentActivity
.
this
),
3000
);
}
}
...
...
@@ -69,6 +110,50 @@ public class BillPaymentActivity extends Activity implements View.OnClickListene
// Methods
// ===========================================================
private
void
createLocalNotification
(
Context
context
)
{
PendingIntent
pendingIntent
;
Intent
notifyIntent
;
notifyIntent
=
new
Intent
(
this
,
BillPaymentActivity
.
class
).
putExtra
(
"channel"
,
"paymentNotify"
);
notifyIntent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_CLEAR_TOP
|
Intent
.
FLAG_ACTIVITY_SINGLE_TOP
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
S
)
{
pendingIntent
=
PendingIntent
.
getActivity
(
context
,
1001
,
notifyIntent
,
PendingIntent
.
FLAG_ONE_SHOT
|
PendingIntent
.
FLAG_MUTABLE
);
}
else
{
pendingIntent
=
PendingIntent
.
getActivity
(
context
,
1001
,
notifyIntent
,
PendingIntent
.
FLAG_ONE_SHOT
);
}
NotificationCompat
.
Builder
b
=
new
NotificationCompat
.
Builder
(
this
,
"paymentNotify"
)
.
setSmallIcon
(
R
.
drawable
.
gift_icon
)
.
setLargeIcon
(
BitmapFactory
.
decodeResource
(
getApplicationContext
().
getResources
(),
R
.
drawable
.
ic_launcher
))
.
setContentTitle
(
"Συγχαρητήρια!"
)
.
setContentText
(
"Ξεκλείδωσες το My Lucky Draw με την πληρωμή του λογαριασμού σου! Πάρε μέρος στις κληρώσεις!"
)
.
setStyle
(
new
NotificationCompat
.
BigTextStyle
()
.
bigText
(
"Ξεκλείδωσες το My Lucky Draw με την πληρωμή του λογαριασμού σου! Πάρε μέρος στις κληρώσεις!"
))
.
setAutoCancel
(
true
)
.
setVibrate
(
new
long
[
0
])
.
setDefaults
(
Notification
.
DEFAULT_ALL
)
.
setChannelId
(
"paymentNotify"
)
.
setPriority
(
Notification
.
PRIORITY_HIGH
)
.
setContentIntent
(
pendingIntent
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
NotificationChannel
notificationChannel
=
new
NotificationChannel
(
"paymentNotify"
,
"paymentNotify"
,
NotificationManager
.
IMPORTANCE_HIGH
);
notificationChannel
.
setLockscreenVisibility
(
Notification
.
VISIBILITY_PUBLIC
);
notificationChannel
.
setDescription
(
"Ξεκλείδωσες το My Lucky Draw με την πληρωμή του λογαριασμού σου! Πάρε μέρος στις κληρώσεις!"
);
notificationChannel
.
setShowBadge
(
true
);
NotificationManager
nm
=
getSystemService
(
NotificationManager
.
class
);
nm
.
createNotificationChannel
(
notificationChannel
);
Notification
notification_build
=
b
.
setChannelId
(
"paymentNotify"
).
build
();
notification_build
.
flags
=
Notification
.
FLAG_AUTO_CANCEL
;
nm
.
notify
(
1001
,
notification_build
);
}
else
{
NotificationManager
nm
=
(
NotificationManager
)
context
.
getSystemService
(
Context
.
NOTIFICATION_SERVICE
);
Notification
notification_build
=
b
.
build
();
notification_build
.
flags
=
Notification
.
FLAG_AUTO_CANCEL
;
nm
.
notify
(
1001
,
notification_build
);
}
}
private
void
initViews
()
{
mIvBack
.
setOnClickListener
(
this
);
mPayBtn
.
setOnClickListener
(
this
);
...
...
warply_android_sdk/src/main/res/drawable-xhdpi/ic_launcher.png
0 → 100644
View file @
e53acf6
6.88 KB
Please
register
or
login
to post a comment