Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
api "com.iterable:iterableapi:3.5.2"
// api project(":iterableapi") // links to local android SDK repo rather than by release
api "com.iterable:iterableapi:3.5.10"
// api project(":iterableapi") // links to local android SDK repo rather than by release
}

4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.facebook.react.modules.core.RCTNativeAppEventEmitter;
import com.iterable.iterableapi.AuthFailure;
import com.iterable.iterableapi.InboxSessionManager;
import com.iterable.iterableapi.IterableAction;
import com.iterable.iterableapi.IterableActionContext;
Expand Down Expand Up @@ -109,7 +110,7 @@ public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, S
@ReactMethod
public void setEmail(@Nullable String email) {
IterableLogger.d(TAG, "setEmail: " + email);

IterableApi.getInstance().setEmail(email);
}

Expand Down Expand Up @@ -154,7 +155,7 @@ public void setUserId(@Nullable String userId) {
@ReactMethod
public void setUserId(@Nullable String userId, @Nullable String authToken) {
IterableLogger.d(TAG, "setUserId: " + userId + " authToken: " + authToken);

IterableApi.getInstance().setUserId(userId, authToken);
}

Expand Down Expand Up @@ -595,13 +596,27 @@ public void onTokenRegistrationSuccessful(String authToken) {
// MOB-10422: Pass successhandler to event listener
sendEvent(EventName.handleAuthSuccessCalled.name(), null);
}

@Override
public void onAuthFailure(AuthFailure authFailure) {

@Override
public void onTokenRegistrationFailed(Throwable object) {
IterableLogger.v(TAG, "Failed to set authToken");
sendEvent(EventName.handleAuthFailureCalled.name(), null);
//Create a JSON object for the authFailure object
JSONObject messageJson = new JSONObject();
try {
messageJson.put("userKey", authFailure.userKey);
messageJson.put("failedAuthToken", authFailure.failedAuthToken);
messageJson.put("failedRequestTime", authFailure.failedRequestTime);
messageJson.put("failureReason", authFailure.failureReason.name());
WritableMap eventData = Serialization.convertJsonToMap(messageJson);
sendEvent(EventName.handleUrlCalled.name(), eventData);
} catch (JSONException e) {
IterableLogger.v(TAG, "Failed to set authToken");
}



}

@ReactMethod
public void addListener(String eventName) {
// Keep: Required for RN built in Event Emitter Calls.
Expand Down