Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, S
}

IterableApi.initialize(reactContext, apiKey, configBuilder.build());
IterableApi.getInstance().setDeviceAttribute("reactNativeSDKVersion",version);
IterableApi.getInstance().setDeviceAttribute("reactNativeSDKVersion", version);
}

@ReactMethod
Expand Down Expand Up @@ -163,12 +163,20 @@ public void trackPushOpenWithCampaignId(Integer campaignId, Integer templateId,
@ReactMethod
public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, Integer campaignId, Integer templateId) {
IterableLogger.v(TAG, "updateSubscriptions");
Integer finalCampaignId = null, finalTemplateId = null;
if (campaignId > 0) {
finalCampaignId = campaignId;
}
if (templateId > 0) {
finalTemplateId = templateId;
}
IterableApi.getInstance().updateSubscriptions(readableArrayToIntegerArray(emailListIds),
readableArrayToIntegerArray(unsubscribedChannelIds),
readableArrayToIntegerArray(unsubscribedMessageTypeIds),
readableArrayToIntegerArray(subscribedMessageTypeIds),
campaignId,
templateId);
finalCampaignId,
finalTemplateId
);
}

@ReactMethod
Expand Down Expand Up @@ -312,6 +320,9 @@ public void setInAppShowResponse(Integer number) {
// endregion

private static Integer[] readableArrayToIntegerArray(ReadableArray array) {
if (array == null) {
return null;
}
Integer[] integers = new Integer[array.size()];
for (int i = 0; i < array.size(); i++) {
integers[i] = array.getInt(i);
Expand Down