Skip to content

Commit 750bb8f

Browse files
authored
Revert "Merge master into embedded (#623)"
This reverts commit 85d40a5.
1 parent 85d40a5 commit 750bb8f

23 files changed

+108
-583
lines changed

.github/workflows/jira.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,30 +45,29 @@ For sample code, take a look at:
4545

4646
Release notes:
4747

48-
- [Release Notes - Iterable's Android SDK](https://support.iterable.com/hc/articles/360027543332) -
49-
Release notes for significant updates to the SDK. Also, information about
50-
deprecation dates and support windows.
51-
- [GitHub — Releases](https://github.com/Iterable/iterable-android-sdk/releases) -
52-
This repository's **Releases** page. Release notes for all versions of the SDK.
48+
- [Android SDK Release Notes](https://support.iterable.com/hc/articles/360027543332) (major releases)
49+
- [Releases page](https://github.com/Iterable/iterable-android-sdk/releases) on GitHub (minor releases)
5350

5451
Support policies:
5552

56-
- Iterable's [SDK Support Policy](https://support.iterable.com/hc/articles/360046136171)
57-
- Iterable's [Beta SDK Disclaimer](https://support.iterable.com/hc/articles/360034753412)
53+
- Iterable's [Mobile SDK Support Policy](https://support.iterable.com/hc/articles/360046136171)
54+
- Iterable's [Android SDK Deprecation and End-of-Life Schedule](https://support.iterable.com/hc/articles/360027543332#deprecation-and-end-of-life-schedule)
55+
- Iterable's [Beta Mobile SDK Disclaimer](https://support.iterable.com/hc/articles/360034753412)
5856

5957
Troubleshooting:
6058

6159
- [Testing and Troubleshooting Iterable's Mobile SDKs](https://support.iterable.com/hc/articles/360035392251)
6260
- [Frequently Asked Questions](https://support.iterable.com/hc/articles/360035624191)
6361
for mobile developers integrating with Iterable
6462

65-
Questions? Contact your Iterable customer success manager.
63+
Please contact your customer success manager with any questions.
6664

6765
## License
6866

69-
This SDK is released under the MIT License. For more information, read [LICENSE](LICENSE.md).
67+
This SDK is released under the MIT License. See [LICENSE](https://github.com/Iterable/iterable-android-sdk/blob/master/LICENSE?raw=true)
68+
for more information.
7069

7170
## Want to contribute?
7271

7372
This library is open source, and we will look at issue reports and pull requests.
74-
For more information, read [CONTRIBUTING](CONTRIBUTING.md).
73+
See [CONTRIBUTING](CONTRIBUTING.md) for more information.

app/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-android-extensions'
44
apply plugin: 'jacoco'
55

6-
repositories {
7-
mavenCentral()
8-
}
9-
106
android {
117
compileSdkVersion 29
128
buildToolsVersion '29.0.3'

iterableapi-ui/src/main/java/com/iterable/iterableapi/ui/inbox/IterableInboxFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ public void onInboxUpdated() {
244244

245245
@Override
246246
public void onListItemTapped(@NonNull IterableInAppMessage message) {
247-
IterableApi.getInstance().getInAppManager().setRead(message, true, null, null);
247+
IterableApi.getInstance().getInAppManager().setRead(message, true);
248248

249249
if (inboxMode == InboxMode.ACTIVITY) {
250250
startActivity(new Intent(getContext(), IterableInboxMessageActivity.class).putExtra(IterableInboxMessageActivity.ARG_MESSAGE_ID, message.getMessageId()));

iterableapi/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dependencies {
5252
testImplementation 'org.khronos:opengl-api:gl1.1-android-2.1_r1'
5353
testImplementation 'com.squareup.okhttp3:mockwebserver:4.2.2'
5454
testImplementation 'org.skyscreamer:jsonassert:1.5.0'
55-
55+
testImplementation project(path: ':iterableapi')
5656
androidTestImplementation 'androidx.test:runner:1.3.0'
5757
androidTestImplementation 'androidx.test:rules:1.3.0'
5858
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

iterableapi/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
<activity
2626
android:name=".IterableTrampolineActivity"
2727
android:exported="false"
28-
android:launchMode="singleInstance"
29-
android:excludeFromRecents="true"
28+
android:launchMode="singleTop"
3029
android:theme="@style/TrampolineActivity.Transparent"/>
3130
</application>
3231

iterableapi/src/main/java/com/iterable/iterableapi/IterableActivityMonitor.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
import android.app.Activity;
44
import android.app.Application;
55
import android.content.Context;
6+
import android.os.Build;
67
import android.os.Bundle;
78
import android.os.Handler;
89
import android.os.Looper;
910
import androidx.annotation.NonNull;
1011
import androidx.annotation.Nullable;
1112

12-
import com.iterable.iterableapi.util.DeviceInfoUtils;
13-
1413
import java.lang.ref.WeakReference;
1514
import java.util.ArrayList;
1615
import java.util.Iterator;
@@ -58,8 +57,10 @@ public void onActivityStarted(Activity activity) {
5857
@Override
5958
public void onActivityResumed(Activity activity) {
6059
currentActivity = new WeakReference<>(activity);
60+
String amazonFireTvHardware = "amazon.hardware.fire_tv";
61+
String amazonModel = Build.MODEL;
6162

62-
if (!inForeground || DeviceInfoUtils.isFireTV(activity.getPackageManager())) {
63+
if (!inForeground || amazonModel.matches("AFTN") || activity.getPackageManager().hasSystemFeature(amazonFireTvHardware)) {
6364
inForeground = true;
6465
for (WeakReference<AppStateCallback> callback : callbacks) {
6566
if (callback.get() != null) {

iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java

Lines changed: 13 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
import androidx.annotation.RestrictTo;
1212
import androidx.annotation.VisibleForTesting;
1313

14-
import com.iterable.iterableapi.util.DeviceInfoUtils;
15-
1614
import org.json.JSONException;
1715
import org.json.JSONObject;
1816

@@ -40,8 +38,6 @@ public class IterableApi {
4038
private IterableNotificationData _notificationData;
4139
private String _deviceId;
4240
private boolean _firstForegroundHandled;
43-
private IterableHelper.SuccessHandler _setUserSuccessCallbackHandler;
44-
private IterableHelper.FailureHandler _setUserFailureCallbackHandler;
4541

4642
IterableApiClient apiClient = new IterableApiClient(new IterableApiAuthProvider());
4743
private @Nullable IterableInAppManager inAppManager;
@@ -73,15 +69,15 @@ public void execute(@Nullable String data) {
7369
});
7470
}
7571

76-
public String getEmail() {
72+
String getEmail() {
7773
return _email;
7874
}
7975

80-
public String getUserId() {
76+
String getUserId() {
8177
return _userId;
8278
}
8379

84-
public String getAuthToken() {
80+
String getAuthToken() {
8581
return _authToken;
8682
}
8783

@@ -319,8 +315,6 @@ private void completeUserLogin() {
319315

320316
if (config.autoPushRegistration) {
321317
registerForPush();
322-
} else if (_setUserSuccessCallbackHandler != null) {
323-
_setUserSuccessCallbackHandler.onSuccess(new JSONObject()); // passing blank json object here as onSuccess is @Nonnull
324318
}
325319

326320
getInAppManager().syncInApp();
@@ -353,7 +347,7 @@ private boolean isInitialized() {
353347

354348
private boolean checkSDKInitialization() {
355349
if (!isInitialized()) {
356-
IterableLogger.w(TAG, "Iterable SDK must be initialized with an API key and user email/userId before calling SDK methods");
350+
IterableLogger.e(TAG, "Iterable SDK must be initialized with an API key and user email/userId before calling SDK methods");
357351
return false;
358352
}
359353
return true;
@@ -392,13 +386,8 @@ private void retrieveEmailAndUserId() {
392386
_email = prefs.getString(IterableConstants.SHARED_PREFS_EMAIL_KEY, null);
393387
_userId = prefs.getString(IterableConstants.SHARED_PREFS_USERID_KEY, null);
394388
_authToken = prefs.getString(IterableConstants.SHARED_PREFS_AUTH_TOKEN_KEY, null);
395-
if (config.authHandler != null) {
396-
if (_authToken != null) {
397-
getAuthManager().queueExpirationRefresh(_authToken);
398-
} else {
399-
IterableLogger.d(TAG, "Auth token found as null. Scheduling token refresh in 10 seconds...");
400-
getAuthManager().scheduleAuthTokenRefresh(10000);
401-
}
389+
if (_authToken != null) {
390+
getAuthManager().queueExpirationRefresh(_authToken);
402391
}
403392
} catch (Exception e) {
404393
IterableLogger.e(TAG, "Error while retrieving email/userId/authToken", e);
@@ -514,7 +503,7 @@ protected void registerDeviceToken(@Nullable String email, @Nullable String user
514503
IterableLogger.e(TAG, "registerDeviceToken: applicationName is null, check that pushIntegrationName is set in IterableConfig");
515504
}
516505

517-
apiClient.registerDeviceToken(email, userId, authToken, applicationName, deviceToken, dataFields, deviceAttributes, _setUserSuccessCallbackHandler, _setUserFailureCallbackHandler);
506+
apiClient.registerDeviceToken(email, userId, authToken, applicationName, deviceToken, dataFields, deviceAttributes);
518507
}
519508
//endregion
520509

@@ -544,11 +533,8 @@ public static void initialize(@NonNull Context context, @NonNull String apiKey,
544533
IterableActivityMonitor.getInstance().addCallback(sharedInstance.activityMonitorListener);
545534

546535
if (sharedInstance.inAppManager == null) {
547-
sharedInstance.inAppManager = new IterableInAppManager(
548-
sharedInstance,
549-
sharedInstance.config.inAppHandler,
550-
sharedInstance.config.inAppDisplayInterval,
551-
sharedInstance.config.useInMemoryStorageForInApps);
536+
sharedInstance.inAppManager = new IterableInAppManager(sharedInstance, sharedInstance.config.inAppHandler,
537+
sharedInstance.config.inAppDisplayInterval);
552538
}
553539

554540
if (sharedInstance.embeddedManager == null) {
@@ -557,17 +543,6 @@ public static void initialize(@NonNull Context context, @NonNull String apiKey,
557543

558544
loadLastSavedConfiguration(context);
559545
IterablePushNotificationUtil.processPendingAction(context);
560-
if (DeviceInfoUtils.isFireTV(context.getPackageManager())) {
561-
try {
562-
JSONObject dataFields = new JSONObject();
563-
JSONObject deviceDetails = new JSONObject();
564-
DeviceInfoUtils.populateDeviceDetails(deviceDetails, context, sharedInstance.getDeviceId());
565-
dataFields.put(IterableConstants.KEY_FIRETV, deviceDetails);
566-
sharedInstance.apiClient.updateUser(dataFields, false);
567-
} catch (JSONException e) {
568-
IterableLogger.e(TAG, "initialize: exception", e);
569-
}
570-
}
571546
}
572547

573548
public static void setContext(Context context) {
@@ -637,18 +612,10 @@ public IterableAttributionInfo getAttributionInfo() {
637612
}
638613

639614
public void setEmail(@Nullable String email) {
640-
setEmail(email, null, null, null);
641-
}
642-
643-
public void setEmail(@Nullable String email, @Nullable IterableHelper.SuccessHandler successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {
644-
setEmail(email, null, successHandler, failureHandler);
615+
setEmail(email, null);
645616
}
646617

647618
public void setEmail(@Nullable String email, @Nullable String authToken) {
648-
setEmail(email, authToken, null, null);
649-
}
650-
651-
public void setEmail(@Nullable String email, @Nullable String authToken, @Nullable IterableHelper.SuccessHandler successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {
652619
//Only if passed in same non-null email
653620
if (_email != null && _email.equals(email)) {
654621
checkAndUpdateAuthToken(authToken);
@@ -663,26 +630,16 @@ public void setEmail(@Nullable String email, @Nullable String authToken, @Nullab
663630

664631
_email = email;
665632
_userId = null;
666-
_setUserSuccessCallbackHandler = successHandler;
667-
_setUserFailureCallbackHandler = failureHandler;
668633
storeAuthData();
669634

670635
onLogin(authToken);
671636
}
672637

673638
public void setUserId(@Nullable String userId) {
674-
setUserId(userId, null, null, null);
675-
}
676-
677-
public void setUserId(@Nullable String userId, @Nullable IterableHelper.SuccessHandler successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {
678-
setUserId(userId, null, successHandler, failureHandler);
639+
setUserId(userId, null);
679640
}
680641

681642
public void setUserId(@Nullable String userId, @Nullable String authToken) {
682-
setUserId(userId, authToken, null, null);
683-
}
684-
685-
public void setUserId(@Nullable String userId, @Nullable String authToken, @Nullable IterableHelper.SuccessHandler successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {
686643
//If same non null userId is passed
687644
if (_userId != null && _userId.equals(userId)) {
688645
checkAndUpdateAuthToken(authToken);
@@ -697,8 +654,6 @@ public void setUserId(@Nullable String userId, @Nullable String authToken, @Null
697654

698655
_email = null;
699656
_userId = userId;
700-
_setUserSuccessCallbackHandler = successHandler;
701-
_setUserFailureCallbackHandler = failureHandler;
702657
storeAuthData();
703658

704659
onLogin(authToken);
@@ -785,26 +740,7 @@ public void inAppConsume(@NonNull String messageId) {
785740
IterableLogger.e(TAG, "inAppConsume: message is null");
786741
return;
787742
}
788-
inAppConsume(message, null, null, null, null);
789-
IterableLogger.printInfo();
790-
}
791-
792-
/**
793-
* Consumes an InApp message.
794-
* @param messageId
795-
* @param successHandler The callback which returns `success`.
796-
* @param failureHandler The callback which returns `failure`.
797-
*/
798-
public void inAppConsume(@NonNull String messageId, @Nullable IterableHelper.SuccessHandler successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {
799-
IterableInAppMessage message = getInAppManager().getMessageById(messageId);
800-
if (message == null) {
801-
IterableLogger.e(TAG, "inAppConsume: message is null");
802-
if (failureHandler != null) {
803-
failureHandler.onFailure("inAppConsume: message is null", null);
804-
}
805-
return;
806-
}
807-
inAppConsume(message, null, null, successHandler, failureHandler);
743+
inAppConsume(message, null, null);
808744
IterableLogger.printInfo();
809745
}
810746

@@ -821,25 +757,8 @@ public void inAppConsume(@NonNull IterableInAppMessage message, @Nullable Iterab
821757
if (!checkSDKInitialization()) {
822758
return;
823759
}
824-
apiClient.inAppConsume(message, source, clickLocation, inboxSessionId, null, null);
825-
}
826760

827-
/**
828-
* Tracks InApp delete.
829-
* This method from informs Iterable about inApp messages deleted with additional paramters.
830-
* Call this method from places where inApp deletion are invoked by user. The messages can be swiped to delete or can be deleted using the link to delete button.
831-
*
832-
* @param message message object
833-
* @param source An enum describing how the in App delete was triggered
834-
* @param clickLocation The module in which the action happened
835-
* @param successHandler The callback which returns `success`.
836-
* @param failureHandler The callback which returns `failure`.
837-
*/
838-
public void inAppConsume(@NonNull IterableInAppMessage message, @Nullable IterableInAppDeleteActionType source, @Nullable IterableInAppLocation clickLocation, @Nullable IterableHelper.SuccessHandler successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {
839-
if (!checkSDKInitialization()) {
840-
return;
841-
}
842-
apiClient.inAppConsume(message, source, clickLocation, inboxSessionId, successHandler, failureHandler);
761+
apiClient.inAppConsume(message, source, clickLocation, inboxSessionId);
843762
}
844763

845764
/**

0 commit comments

Comments
 (0)