Panagiotis Triantafyllou

new keys

......@@ -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
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4.6rc2'
PUBLISH_VERSION = '4.5.4.6rc3'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
/*
* 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);
}
......@@ -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));
}
......
......@@ -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)) {
......