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-11-03 17:46:39 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
53bacb172adfa19c3cf2f796633de5089e17aa36
53bacb17
1 parent
0305e420
new keys
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
2 deletions
app/src/main/assets/warply.properties
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/io/callbacks/RetrofitInterface.java
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/toolbox/HurlStack.java
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
app/src/main/assets/warply.properties
View file @
53bacb1
...
...
@@ -11,7 +11,7 @@ Debug=true
# Production or Development environment of the engage server
# Production: https://engage.warp.ly
# Development: https://engage-stage.warp.ly
BaseURL
=
https://engage.warp.ly
BaseURL
=
https://engage
-stage
.warp.ly
# For Verify Ticket request
VerifyURL
=
/partners/cosmote/verify
...
...
warply_android_sdk/build.gradle
View file @
53bacb1
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4.6rc
2
'
PUBLISH_VERSION
=
'4.5.4.6rc
3
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/io/callbacks/RetrofitInterface.java
0 → 100644
View file @
53bacb1
/*
* Copyright 2010-2013 Warply Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
* EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package
ly
.
warp
.
sdk
.
io
.
callbacks
;
public
interface
RetrofitInterface
{
// @GET("/api/session/{sessionUuid}")
// Call<ResponseBody> getSingleCampaign(@Path("sessionUuid") String sessionUuid);
}
warply_android_sdk/src/main/java/ly/warp/sdk/io/volley/toolbox/HurlStack.java
View file @
53bacb1
...
...
@@ -115,6 +115,7 @@ public class HurlStack implements HttpStack {
}
URL
parsedUrl
=
new
URL
(
url
);
HttpURLConnection
connection
=
openConnection
(
parsedUrl
,
request
);
connection
.
setInstanceFollowRedirects
(
false
);
for
(
String
headerName
:
map
.
keySet
())
{
connection
.
addRequestProperty
(
headerName
,
map
.
get
(
headerName
));
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/utils/managers/WarplyManager.java
View file @
53bacb1
...
...
@@ -25,6 +25,8 @@
package
ly
.
warp
.
sdk
.
utils
.
managers
;
import
static
java
.
lang
.
Boolean
.
FALSE
;
import
android.app.ActivityManager
;
import
android.app.AlarmManager
;
import
android.app.PendingIntent
;
...
...
@@ -64,6 +66,7 @@ import ly.warp.sdk.io.callbacks.NewCampaignsHook;
import
ly.warp.sdk.io.callbacks.PacingDetailsHook
;
import
ly.warp.sdk.io.callbacks.PointsHook
;
import
ly.warp.sdk.io.callbacks.ProductsHook
;
import
ly.warp.sdk.io.callbacks.RetrofitInterface
;
import
ly.warp.sdk.io.callbacks.SharingHook
;
import
ly.warp.sdk.io.callbacks.TagsCategoriesHook
;
import
ly.warp.sdk.io.callbacks.TagsHook
;
...
...
@@ -2860,6 +2863,72 @@ public class WarplyManager {
},
null
);
}
public
static
void
makeGetRequest
(
String
url
)
{
// Always run it in a new Thread, not in the main
// new Thread(() -> {
// makeGetRequest(session_uuid);
// }).start();
// Also add those two dependencies
// api 'com.squareup.retrofit2:retrofit:2.9.0'
// api 'com.squareup.okhttp3:okhttp:4.10.0'
// And uncomment the code inside RetrofitInterface.java
// OkHttpClient.Builder httpClient = new OkHttpClient.Builder();
// httpClient.followRedirects(FALSE)
// .followSslRedirects(FALSE);
//
// Retrofit retrofit = new Retrofit.Builder()
// .baseUrl(WarplyProperty.getBaseUrl(Warply.getWarplyContext()))
// .client(httpClient.build())
// .build();
//
// RetrofitInterface service = retrofit.create(RetrofitInterface.class);
// Call<ResponseBody> respo = service.getSingleCampaign(url);
// respo.enqueue(new Callback<ResponseBody>() {
// @Override
// public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
// LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
// dynatraceEvent.setEventName("custom_success_read_campaign_loyalty");
// EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
//
// getCampaigns(new WarplyGetCampaignsRequest().setLanguage("en"), new CallbackReceiver<ArrayList<Campaign>>() {
// @Override
// public void onSuccess(ArrayList<Campaign> result) {
// OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCampaignService.class).build();
// WorkManager.getInstance(Warply.getWarplyContext()).enqueue(mywork);
// }
//
// @Override
// public void onFailure(int errorCode) {
//
// }
// });
// }
//
// @Override
// public void onFailure(Call<ResponseBody> call, Throwable t) {
// LoyaltySDKDynatraceEventModel dynatraceEvent = new LoyaltySDKDynatraceEventModel();
// dynatraceEvent.setEventName("custom_success_read_campaign_loyalty");
// EventBus.getDefault().post(new WarplyEventBusManager(dynatraceEvent));
//
// getCampaigns(new WarplyGetCampaignsRequest().setLanguage("en"), new CallbackReceiver<ArrayList<Campaign>>() {
// @Override
// public void onSuccess(ArrayList<Campaign> result) {
// OneTimeWorkRequest mywork = new OneTimeWorkRequest.Builder(EventCampaignService.class).build();
// WorkManager.getInstance(Warply.getWarplyContext()).enqueue(mywork);
// }
//
// @Override
// public void onFailure(int errorCode) {
//
// }
// });
// }
// });
}
private
static
boolean
isMyServiceRunning
(
Class
<?>
serviceClass
)
{
ActivityManager
manager
=
(
ActivityManager
)
Warply
.
getWarplyContext
().
getSystemService
(
Context
.
ACTIVITY_SERVICE
);
for
(
ActivityManager
.
RunningServiceInfo
service
:
manager
.
getRunningServices
(
Integer
.
MAX_VALUE
))
{
...
...
Please
register
or
login
to post a comment