Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
b05727d
sets custom sound at notification channel
evantk91 Jan 9, 2023
8a2a950
updates notification channel builder to set sound
evantk91 Jan 10, 2023
1492d03
minor edits
evantk91 Jan 10, 2023
ea5f307
sets sound at notification channel
evantk91 Jan 11, 2023
3153bec
minor edits
evantk91 Jan 11, 2023
ce6481b
sets up channel id and channel name for each unique sound
evantk91 Jan 15, 2023
2b46fce
adds conditionals for default channel creation
evantk91 Jan 15, 2023
a82463a
investigating edge cases
evantk91 Jan 15, 2023
0050972
debugging
evantk91 Jan 15, 2023
9d7afa1
adds default sounds for edge cases
evantk91 Jan 15, 2023
ddcc311
adds default channel id and channel name for edge cases
evantk91 Jan 16, 2023
4e46650
minor edits
evantk91 Jan 16, 2023
ba4355b
minor edits
evantk91 Jan 16, 2023
bfc2e78
cleans up conditionals
evantk91 Jan 16, 2023
0cc6c66
adds import for IterableNotificationTest
evantk91 Jan 16, 2023
75c201e
reorganizes and checks resources folder for matching sound file
evantk91 Jan 17, 2023
54d29b4
minor edits
evantk91 Jan 17, 2023
9b34e26
minor edits
evantk91 Jan 17, 2023
a272eae
minor edits
evantk91 Jan 17, 2023
20ea6c3
updates channel names to sound names
evantk91 Jan 17, 2023
7f9ac07
resolves null pointer exception for soundName
evantk91 Jan 20, 2023
f4138b7
removes unneccessary package from build.gradle
evantk91 Jan 20, 2023
32197ae
Merge pull request #487 from Iterable/evan/MOB-5365-update-notificati…
evangreer91 Jan 30, 2023
e651120
Merge pull request #488 from Iterable/evan/MOB-5406-create-notificati…
evangreer91 Jan 30, 2023
9c3bec7
README updates
Feb 2, 2023
b0dc39d
Merge pull request #495 from Iterable/brad/README-updates
Feb 2, 2023
bed400a
Merge pull request #487 from Iterable/evan/MOB-5365-update-notificati…
evangreer91 Jan 30, 2023
0825443
Merge pull request #488 from Iterable/evan/MOB-5406-create-notificati…
evangreer91 Jan 30, 2023
86bd53f
[MOB-5532] - Adding remote notification sound
Jan 31, 2023
d54854e
ChannelId was getting set to null when no sound
Jan 31, 2023
ab25ff3
Remove all other channels which are not active
Jan 31, 2023
807ccc4
Checkstyle fix
Jan 31, 2023
04f9c5b
adds resource check for existing local sound and updates soundName ch…
evantk91 Jan 31, 2023
4cdb871
adds soundId and soundUrl checks for channel id and channel name
evantk91 Jan 31, 2023
eb4f735
passes soundId down to getSoundUri
evantk91 Jan 31, 2023
128ca21
Revert "passes soundId down to getSoundUri"
evantk91 Jan 31, 2023
6dd3930
adds null check to getSoundUri
evantk91 Jan 31, 2023
83f6fc4
checkstyle fix
evantk91 Jan 31, 2023
45f51b4
puts sound uri check in createNotificationChannel
evantk91 Jan 31, 2023
be5ebb3
reorganizes to do the Uri logic in getSoundUri
evantk91 Jan 31, 2023
029b495
checkstyle fixes
evantk91 Feb 1, 2023
d89ac84
addresses comments
evantk91 Feb 1, 2023
ba89114
reverts back to not deleting inactive channels
evantk91 Feb 2, 2023
768da6e
Merge branch 'custom-sound' into MOB-5532-Notificationw-the-remote-sound
evangreer91 Feb 13, 2023
7df5f7c
Merge pull request #491 from Iterable/MOB-5532-Notificationw-the-remo…
evangreer91 Feb 13, 2023
37ff2f8
Update iterableapi/src/main/java/com/iterable/iterableapi/IterableNot…
evangreer91 Feb 16, 2023
c029ce5
addresses code climate fixes
evantk91 Feb 16, 2023
f785400
Merge pull request #500 from Iterable/custom-sound
evangreer91 Feb 16, 2023
bcd3bb1
[MOB-5664] - Revert channel name implementation
Ayyanchira Feb 21, 2023
1e5f02c
Merge pull request #505 from Iterable/MOB-5664-Revert-Channel-Name-Im…
Ayyanchira Feb 21, 2023
d0e9d39
[MOB - 5694] - Add try catch around animation
Feb 26, 2023
c463f63
Log warn instead of error
Ayyanchira Feb 26, 2023
6ef8a31
Merge pull request #523 from Iterable/MOB-5695]---Warn-instead-of-err…
Ayyanchira Feb 27, 2023
03d8a69
Merge pull request #522 from Iterable/MOB-5694-Try-Catch-around-webvi…
Ayyanchira Feb 27, 2023
124c04e
Add firetv/ott support to getmessages call
amanforindia Mar 15, 2023
898f9e9
For firetv call update user with device details upon initialization
amanforindia Mar 16, 2023
e3a277f
Set DEVICE_NOTIFICATIONS_ENABLED key only when registering for push
amanforindia Mar 16, 2023
6f55d7f
Fix firetv object structure
amanforindia Mar 20, 2023
f0f1efb
Review fixes
amanforindia Mar 21, 2023
fb38707
[MOB - 5873] - Public getters for Email UserID and Auth
Mar 22, 2023
cb0e4c3
[MOB - 5874] - Schedule auth refresh when auth null
Mar 22, 2023
ecaf2bd
Merge pull request #533 from Iterable/MOB-5873-Email-UserID-AuthToken…
Ayyanchira Mar 22, 2023
4aea9b2
Merge pull request #534 from Iterable/MOB-5874-authToken-refresh-when…
Ayyanchira Mar 22, 2023
6c0a9a2
Merge branch 'master' into firetv-updateuser-fix
Ayyanchira Apr 3, 2023
4574557
create issue in jira when github issue opened
Apr 13, 2023
b6779ba
update secret names
Apr 13, 2023
0236ee2
add private constructor to prevent instance creation
devcsomnicg Apr 14, 2023
90902c2
update unit test
devcsomnicg Apr 14, 2023
1c60ba4
Merge pull request #551 from Iterable/add-jira-integration
dontgitit Apr 17, 2023
a287522
Added import for DeviceInfoUtils
devcsomnicg Apr 18, 2023
37f07c4
Merge pull request #474 from Iterable/jay/MOB-4666-in-apps-config-memory
May 2, 2023
dc124e0
CI fix
May 2, 2023
650679e
Merge pull request #561 from Iterable/CherryPick-InMemoryStorage-on-M…
Ayyanchira May 2, 2023
e232049
Merge branch 'master' into firetv-updateuser-fix
Ayyanchira May 11, 2023
fa121af
Merge pull request #532 from amanjayshahomnicg/firetv-updateuser-fix
Ayyanchira May 16, 2023
62ac73e
[MOB-6055] - [OMNI CG] - Add callbacks to setting email/user id (#570)
Ayyanchira May 17, 2023
b374b12
[MOB 5730] Add callbacks to reading/removing in-app messages (#557) (…
Ayyanchira Jun 14, 2023
efa8d3a
[MOB - 6493] - Message read and remove bug fix (#592)
Ayyanchira Jul 12, 2023
b780ec4
MOB-5132: Fix deep link issue after app is opened from notification (…
Ayyanchira Jul 12, 2023
6f5a805
[MOB-6309] prepares EUDC updates for release (#572)
evantk91 Jul 17, 2023
e8b6532
removes extra dependency (#609)
evantk91 Jul 28, 2023
f479175
MOB-5132 (#613)
devcsomnicg Aug 29, 2023
1ed0c34
Ensure IterableTrampolineActivity always launched (#553) (#618)
Ayyanchira Aug 31, 2023
6ba53db
Merge branch 'embedded' into master
evantk91 Sep 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/jira.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
issues:
types: [opened]

name: Create Jira Issue

jobs:
build:
runs-on: ubuntu-latest
name: Create Jira Issue
steps:
- name: Login
uses: atlassian/gajira-login@v3
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_ILYA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_ILYA_API_TOKEN }}

- name: Create
id: create
uses: atlassian/gajira-create@v3
with:
project: MOB
issuetype: Bug
summary: "${{ github.repository }}: #${{ github.event.issue.number }} by ${{ github.event.issue.user.login }}: ${{ github.event.issue.title }}"
description: ${{ github.event.issue.body }}
fields: '{"customfield_11268": {"id": "10668"} }'
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,30 @@ For sample code, take a look at:

Release notes:

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

Support policies:

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

Troubleshooting:

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

Please contact your customer success manager with any questions.
Questions? Contact your Iterable customer success manager.

## License

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

## Want to contribute?

This library is open source, and we will look at issue reports and pull requests.
See [CONTRIBUTING](CONTRIBUTING.md) for more information.
For more information, read [CONTRIBUTING](CONTRIBUTING.md).
4 changes: 4 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'jacoco'

repositories {
mavenCentral()
}

android {
compileSdkVersion 29
buildToolsVersion '29.0.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public void onInboxUpdated() {

@Override
public void onListItemTapped(@NonNull IterableInAppMessage message) {
IterableApi.getInstance().getInAppManager().setRead(message, true);
IterableApi.getInstance().getInAppManager().setRead(message, true, null, null);

if (inboxMode == InboxMode.ACTIVITY) {
startActivity(new Intent(getContext(), IterableInboxMessageActivity.class).putExtra(IterableInboxMessageActivity.ARG_MESSAGE_ID, message.getMessageId()));
Expand Down
2 changes: 1 addition & 1 deletion iterableapi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ dependencies {
testImplementation 'org.khronos:opengl-api:gl1.1-android-2.1_r1'
testImplementation 'com.squareup.okhttp3:mockwebserver:4.2.2'
testImplementation 'org.skyscreamer:jsonassert:1.5.0'
testImplementation project(path: ':iterableapi')

androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
Expand Down
3 changes: 2 additions & 1 deletion iterableapi/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
<activity
android:name=".IterableTrampolineActivity"
android:exported="false"
android:launchMode="singleTop"
android:launchMode="singleInstance"
android:excludeFromRecents="true"
android:theme="@style/TrampolineActivity.Transparent"/>
</application>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.iterable.iterableapi.util.DeviceInfoUtils;

import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Iterator;
Expand Down Expand Up @@ -57,10 +58,8 @@ public void onActivityStarted(Activity activity) {
@Override
public void onActivityResumed(Activity activity) {
currentActivity = new WeakReference<>(activity);
String amazonFireTvHardware = "amazon.hardware.fire_tv";
String amazonModel = Build.MODEL;

if (!inForeground || amazonModel.matches("AFTN") || activity.getPackageManager().hasSystemFeature(amazonFireTvHardware)) {
if (!inForeground || DeviceInfoUtils.isFireTV(activity.getPackageManager())) {
inForeground = true;
for (WeakReference<AppStateCallback> callback : callbacks) {
if (callback.get() != null) {
Expand Down
107 changes: 94 additions & 13 deletions iterableapi/src/main/java/com/iterable/iterableapi/IterableApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import androidx.annotation.RestrictTo;
import androidx.annotation.VisibleForTesting;

import com.iterable.iterableapi.util.DeviceInfoUtils;

import org.json.JSONException;
import org.json.JSONObject;

Expand Down Expand Up @@ -38,6 +40,8 @@ public class IterableApi {
private IterableNotificationData _notificationData;
private String _deviceId;
private boolean _firstForegroundHandled;
private IterableHelper.SuccessHandler _setUserSuccessCallbackHandler;
private IterableHelper.FailureHandler _setUserFailureCallbackHandler;

IterableApiClient apiClient = new IterableApiClient(new IterableApiAuthProvider());
private @Nullable IterableInAppManager inAppManager;
Expand Down Expand Up @@ -69,15 +73,15 @@ public void execute(@Nullable String data) {
});
}

String getEmail() {
public String getEmail() {
return _email;
}

String getUserId() {
public String getUserId() {
return _userId;
}

String getAuthToken() {
public String getAuthToken() {
return _authToken;
}

Expand Down Expand Up @@ -315,6 +319,8 @@ private void completeUserLogin() {

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

getInAppManager().syncInApp();
Expand Down Expand Up @@ -347,7 +353,7 @@ private boolean isInitialized() {

private boolean checkSDKInitialization() {
if (!isInitialized()) {
IterableLogger.e(TAG, "Iterable SDK must be initialized with an API key and user email/userId before calling SDK methods");
IterableLogger.w(TAG, "Iterable SDK must be initialized with an API key and user email/userId before calling SDK methods");
return false;
}
return true;
Expand Down Expand Up @@ -386,8 +392,13 @@ private void retrieveEmailAndUserId() {
_email = prefs.getString(IterableConstants.SHARED_PREFS_EMAIL_KEY, null);
_userId = prefs.getString(IterableConstants.SHARED_PREFS_USERID_KEY, null);
_authToken = prefs.getString(IterableConstants.SHARED_PREFS_AUTH_TOKEN_KEY, null);
if (_authToken != null) {
getAuthManager().queueExpirationRefresh(_authToken);
if (config.authHandler != null) {
if (_authToken != null) {
getAuthManager().queueExpirationRefresh(_authToken);
} else {
IterableLogger.d(TAG, "Auth token found as null. Scheduling token refresh in 10 seconds...");
getAuthManager().scheduleAuthTokenRefresh(10000);
}
}
} catch (Exception e) {
IterableLogger.e(TAG, "Error while retrieving email/userId/authToken", e);
Expand Down Expand Up @@ -503,7 +514,7 @@ protected void registerDeviceToken(@Nullable String email, @Nullable String user
IterableLogger.e(TAG, "registerDeviceToken: applicationName is null, check that pushIntegrationName is set in IterableConfig");
}

apiClient.registerDeviceToken(email, userId, authToken, applicationName, deviceToken, dataFields, deviceAttributes);
apiClient.registerDeviceToken(email, userId, authToken, applicationName, deviceToken, dataFields, deviceAttributes, _setUserSuccessCallbackHandler, _setUserFailureCallbackHandler);
}
//endregion

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

if (sharedInstance.inAppManager == null) {
sharedInstance.inAppManager = new IterableInAppManager(sharedInstance, sharedInstance.config.inAppHandler,
sharedInstance.config.inAppDisplayInterval);
sharedInstance.inAppManager = new IterableInAppManager(
sharedInstance,
sharedInstance.config.inAppHandler,
sharedInstance.config.inAppDisplayInterval,
sharedInstance.config.useInMemoryStorageForInApps);
}

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

loadLastSavedConfiguration(context);
IterablePushNotificationUtil.processPendingAction(context);
if (DeviceInfoUtils.isFireTV(context.getPackageManager())) {
try {
JSONObject dataFields = new JSONObject();
JSONObject deviceDetails = new JSONObject();
DeviceInfoUtils.populateDeviceDetails(deviceDetails, context, sharedInstance.getDeviceId());
dataFields.put(IterableConstants.KEY_FIRETV, deviceDetails);
sharedInstance.apiClient.updateUser(dataFields, false);
} catch (JSONException e) {
IterableLogger.e(TAG, "initialize: exception", e);
}
}
}

public static void setContext(Context context) {
Expand Down Expand Up @@ -612,10 +637,18 @@ public IterableAttributionInfo getAttributionInfo() {
}

public void setEmail(@Nullable String email) {
setEmail(email, null);
setEmail(email, null, null, null);
}

public void setEmail(@Nullable String email, @Nullable IterableHelper.SuccessHandler successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {
setEmail(email, null, successHandler, failureHandler);
}

public void setEmail(@Nullable String email, @Nullable String authToken) {
setEmail(email, authToken, null, null);
}

public void setEmail(@Nullable String email, @Nullable String authToken, @Nullable IterableHelper.SuccessHandler successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {
//Only if passed in same non-null email
if (_email != null && _email.equals(email)) {
checkAndUpdateAuthToken(authToken);
Expand All @@ -630,16 +663,26 @@ public void setEmail(@Nullable String email, @Nullable String authToken) {

_email = email;
_userId = null;
_setUserSuccessCallbackHandler = successHandler;
_setUserFailureCallbackHandler = failureHandler;
storeAuthData();

onLogin(authToken);
}

public void setUserId(@Nullable String userId) {
setUserId(userId, null);
setUserId(userId, null, null, null);
}

public void setUserId(@Nullable String userId, @Nullable IterableHelper.SuccessHandler successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {
setUserId(userId, null, successHandler, failureHandler);
}

public void setUserId(@Nullable String userId, @Nullable String authToken) {
setUserId(userId, authToken, null, null);
}

public void setUserId(@Nullable String userId, @Nullable String authToken, @Nullable IterableHelper.SuccessHandler successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {
//If same non null userId is passed
if (_userId != null && _userId.equals(userId)) {
checkAndUpdateAuthToken(authToken);
Expand All @@ -654,6 +697,8 @@ public void setUserId(@Nullable String userId, @Nullable String authToken) {

_email = null;
_userId = userId;
_setUserSuccessCallbackHandler = successHandler;
_setUserFailureCallbackHandler = failureHandler;
storeAuthData();

onLogin(authToken);
Expand Down Expand Up @@ -740,7 +785,26 @@ public void inAppConsume(@NonNull String messageId) {
IterableLogger.e(TAG, "inAppConsume: message is null");
return;
}
inAppConsume(message, null, null);
inAppConsume(message, null, null, null, null);
IterableLogger.printInfo();
}

/**
* Consumes an InApp message.
* @param messageId
* @param successHandler The callback which returns `success`.
* @param failureHandler The callback which returns `failure`.
*/
public void inAppConsume(@NonNull String messageId, @Nullable IterableHelper.SuccessHandler successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {
IterableInAppMessage message = getInAppManager().getMessageById(messageId);
if (message == null) {
IterableLogger.e(TAG, "inAppConsume: message is null");
if (failureHandler != null) {
failureHandler.onFailure("inAppConsume: message is null", null);
}
return;
}
inAppConsume(message, null, null, successHandler, failureHandler);
IterableLogger.printInfo();
}

Expand All @@ -757,8 +821,25 @@ public void inAppConsume(@NonNull IterableInAppMessage message, @Nullable Iterab
if (!checkSDKInitialization()) {
return;
}
apiClient.inAppConsume(message, source, clickLocation, inboxSessionId, null, null);
}

apiClient.inAppConsume(message, source, clickLocation, inboxSessionId);
/**
* Tracks InApp delete.
* This method from informs Iterable about inApp messages deleted with additional paramters.
* 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.
*
* @param message message object
* @param source An enum describing how the in App delete was triggered
* @param clickLocation The module in which the action happened
* @param successHandler The callback which returns `success`.
* @param failureHandler The callback which returns `failure`.
*/
public void inAppConsume(@NonNull IterableInAppMessage message, @Nullable IterableInAppDeleteActionType source, @Nullable IterableInAppLocation clickLocation, @Nullable IterableHelper.SuccessHandler successHandler, @Nullable IterableHelper.FailureHandler failureHandler) {
if (!checkSDKInitialization()) {
return;
}
apiClient.inAppConsume(message, source, clickLocation, inboxSessionId, successHandler, failureHandler);
}

/**
Expand Down
Loading