Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
32c7eb8
refactor: update ios interfaces to enforce non-nullable parameters fo…
lposen Aug 22, 2025
5d8c543
refactor: update parameter types in RNIterableAPI to use Double to ma…
lposen Aug 22, 2025
b6e4488
refactor: update parameter types in RNIterableAPI to reflect automati…
lposen Aug 27, 2025
3e252ee
Update ios/RNIterableAPI/ReactIterableAPI.swift
lposen Aug 27, 2025
e0d026e
refactor: simplify attribution info handling and improve error report…
lposen Aug 27, 2025
dfb4934
refactor: update templateId parameter type to Double in RNIterableAPI…
lposen Aug 27, 2025
5a946b2
refactor: remove redundant error handling in RNIterableAPI to streaml…
lposen Aug 27, 2025
c009a1e
refactor: update templateId type to double in trackPushOpenWithCampai…
lposen Aug 28, 2025
f9aa273
refactor: update templateId parameter type to nullable in trackPushOp…
lposen Aug 28, 2025
560a8c5
refactor: update parameter types to nullable in RNIterableAPI for con…
lposen Aug 28, 2025
91062db
Merge branch 'new-arch/master' into new-arch/MOB-11957-ios-crashes-wh…
lposen Aug 28, 2025
5b7870a
Merge branch 'new-arch/MOB-11955-configure-new-architecture' into new…
lposen Aug 28, 2025
4cc665f
refactor: add wakeApp placeholder method
lposen Aug 28, 2025
7664ace
Merge branch 'new-arch/master' into new-arch/MOB-11957-ios-crashes-wh…
lposen Sep 5, 2025
18bd0af
refactor: update initialize2WithApiKey so that parameters are always …
lposen Sep 5, 2025
26fa44b
fix: update clickedUrl parameter type to allow null values in trackIn…
lposen Sep 11, 2025
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 @@ -187,8 +187,8 @@ public void trackPurchase(double total, ReadableArray items, ReadableMap dataFie
IterableApi.getInstance().trackPurchase(total, Serialization.commerceItemsFromReadableArray(items), optSerializedDataFields(dataFields));
}

public void trackPushOpenWithCampaignId(double campaignId, Double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) {
RNIterableInternal.trackPushOpenWithCampaignId((int) campaignId, templateId != null ? templateId.intValue() : null, messageId, optSerializedDataFields(dataFields));
public void trackPushOpenWithCampaignId(double campaignId, double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 5): trackPushOpenWithCampaignId [qlty:function-parameters]

RNIterableInternal.trackPushOpenWithCampaignId((int) campaignId, (int) templateId, messageId, optSerializedDataFields(dataFields));
}

public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, double campaignId, double templateId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void trackPurchase(double total, ReadableArray items, ReadableMap dataFie
}

@Override
public void trackPushOpenWithCampaignId(double campaignId, Double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) {
public void trackPushOpenWithCampaignId(double campaignId, double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 5): trackPushOpenWithCampaignId [qlty:function-parameters]

moduleImpl.trackPushOpenWithCampaignId(campaignId, templateId, messageId, appAlreadyRunning, dataFields);
}

Expand Down Expand Up @@ -191,7 +191,6 @@ public void setAutoDisplayPaused(final boolean paused) {
moduleImpl.setAutoDisplayPaused(paused);
}

@Override
public void wakeApp() {
moduleImpl.wakeApp();
}
Expand All @@ -206,7 +205,6 @@ public void endSession() {
moduleImpl.endSession();
}

@Override
public void updateVisibleRows(ReadableArray visibleRows) {
moduleImpl.updateVisibleRows(visibleRows);
}
Expand All @@ -221,7 +219,6 @@ public void removeListeners(double count) {
moduleImpl.removeListeners(count);
}

@Override
public void passAlongAuthToken(String authToken) {
moduleImpl.passAlongAuthToken(authToken);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void trackPurchase(double total, ReadableArray items, ReadableMap dataFie
}

@ReactMethod
public void trackPushOpenWithCampaignId(double campaignId, Double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) {
public void trackPushOpenWithCampaignId(double campaignId, double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function with many parameters (count = 5): trackPushOpenWithCampaignId [qlty:function-parameters]

moduleImpl.trackPushOpenWithCampaignId(campaignId, templateId, messageId, appAlreadyRunning, dataFields);
}

Expand Down
78 changes: 39 additions & 39 deletions ios/RNIterableAPI/RNIterableAPI.mm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ - (void)getUserId:(RCTPromiseResolveBlock)resolve
[_swiftAPI getUserId:resolve rejecter:reject];
}

- (void)setInAppShowResponse:(NSNumber *)inAppShowResponse {
- (void)setInAppShowResponse:(double)inAppShowResponse {
[_swiftAPI setInAppShowResponse:inAppShowResponse];
}

Expand Down Expand Up @@ -137,8 +137,8 @@ - (void)showMessage:(NSString *)messageId
}

- (void)removeMessage:(NSString *)messageId
location:(NSNumber *)location
source:(NSNumber *)source {
location:(double)location
source:(double)source {
[_swiftAPI removeMessage:messageId location:location source:source];
}

Expand All @@ -154,8 +154,8 @@ - (void)trackEvent:(NSString *)name dataFields:(NSDictionary *)dataFields {
[_swiftAPI trackEvent:name dataFields:dataFields];
}

- (void)trackPushOpenWithCampaignId:(NSNumber *)campaignId
templateId:(NSNumber *)templateId
- (void)trackPushOpenWithCampaignId:(double)campaignId
templateId:(double)templateId
messageId:(NSString *)messageId
appAlreadyRunning:(BOOL)appAlreadyRunning
dataFields:(NSDictionary *)dataFields {
Expand All @@ -166,19 +166,19 @@ - (void)trackPushOpenWithCampaignId:(NSNumber *)campaignId
dataFields:dataFields];
}

- (void)trackInAppOpen:(NSString *)messageId location:(NSNumber *)location {
- (void)trackInAppOpen:(NSString *)messageId location:(double)location {
[_swiftAPI trackInAppOpen:messageId location:location];
}

- (void)trackInAppClick:(NSString *)messageId
location:(NSNumber *)location
location:(double)location
clickedUrl:(NSString *)clickedUrl {
[_swiftAPI trackInAppClick:messageId location:location clickedUrl:clickedUrl];
}

- (void)trackInAppClose:(NSString *)messageId
location:(NSNumber *)location
source:(NSNumber *)source
location:(double)location
source:(double)source
clickedUrl:(NSString *)clickedUrl {
[_swiftAPI trackInAppClose:messageId
location:location
Expand All @@ -187,16 +187,16 @@ - (void)trackInAppClose:(NSString *)messageId
}

- (void)inAppConsume:(NSString *)messageId
location:(NSNumber *)location
source:(NSNumber *)source {
location:(double)location
source:(double)source {
[_swiftAPI inAppConsume:messageId location:location source:source];
}

- (void)updateCart:(NSArray *)items {
[_swiftAPI updateCart:items];
}

- (void)trackPurchase:(NSNumber *)total
- (void)trackPurchase:(double)total
items:(NSArray *)items
dataFields:(NSDictionary *)dataFields {
[_swiftAPI trackPurchase:total items:items dataFields:dataFields];
Expand All @@ -216,7 +216,7 @@ - (void)getAttributionInfo:(RCTPromiseResolveBlock)resolve
[_swiftAPI getAttributionInfo:resolve rejecter:reject];
}

- (void)setAttributionInfo:(NSDictionary *)attributionInfo {
- (void)setAttributionInfo:(NSDictionary *_Nullable)attributionInfo {
[_swiftAPI setAttributionInfo:attributionInfo];
}

Expand All @@ -243,12 +243,12 @@ - (void)handleAppLink:(NSString *)appLink
[_swiftAPI handleAppLink:appLink resolver:resolve rejecter:reject];
}

- (void)updateSubscriptions:(NSArray *)emailListIds
unsubscribedChannelIds:(NSArray *)unsubscribedChannelIds
unsubscribedMessageTypeIds:(NSArray *)unsubscribedMessageTypeIds
subscribedMessageTypeIds:(NSArray *)subscribedMessageTypeIds
campaignId:(NSNumber *)campaignId
templateId:(NSNumber *)templateId {
- (void)updateSubscriptions:(NSArray *_Nullable)emailListIds
unsubscribedChannelIds:(NSArray *_Nullable)unsubscribedChannelIds
unsubscribedMessageTypeIds:(NSArray *_Nullable)unsubscribedMessageTypeIds
subscribedMessageTypeIds:(NSArray *_Nullable)subscribedMessageTypeIds
campaignId:(double)campaignId
templateId:(double)templateId {
[_swiftAPI updateSubscriptions:emailListIds
unsubscribedChannelIds:unsubscribedChannelIds
unsubscribedMessageTypeIds:unsubscribedMessageTypeIds
Expand All @@ -269,7 +269,7 @@ - (void)updateVisibleRows:(NSArray *)visibleRows {
[_swiftAPI updateVisibleRows:visibleRows];
}

- (void)passAlongAuthToken:(NSString *)authToken {
- (void)passAlongAuthToken:(NSString *_Nullable)authToken {
[_swiftAPI passAlongAuthToken:authToken];
}

Expand Down Expand Up @@ -335,7 +335,7 @@ - (void)passAlongAuthToken:(NSString *)authToken {
[_swiftAPI getUserId:resolve rejecter:reject];
}

RCT_EXPORT_METHOD(setInAppShowResponse : (NSNumber *)inAppShowResponse) {
RCT_EXPORT_METHOD(setInAppShowResponse : (double)inAppShowResponse) {
[_swiftAPI setInAppShowResponse:inAppShowResponse];
}

Expand Down Expand Up @@ -363,8 +363,8 @@ - (void)passAlongAuthToken:(NSString *)authToken {
rejecter:reject];
}

RCT_EXPORT_METHOD(removeMessage : (NSString *)messageId location : (NSNumber *)
location source : (NSNumber *)source) {
RCT_EXPORT_METHOD(removeMessage : (NSString *)messageId location : (double)
location source : (double)source) {
[_swiftAPI removeMessage:messageId location:location source:source];
}

Expand All @@ -382,46 +382,45 @@ - (void)passAlongAuthToken:(NSString *)authToken {
}

RCT_EXPORT_METHOD(
trackPushOpenWithCampaignId : (NSNumber *)
campaignId templateId : (NSNumber *)templateId messageId : (NSString *)
messageId appAlreadyRunning : (BOOL)
appAlreadyRunning dataFields : (NSDictionary *)dataFields) {
trackPushOpenWithCampaignId : (double)campaignId templateId : (double)
templateId messageId : (double)messageId appAlreadyRunning : (BOOL)
Copy link
Preview

Copilot AI Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The messageId parameter is incorrectly declared as double but should be NSString* since it's a string identifier, not a numeric value.

Suggested change
templateId messageId : (double)messageId appAlreadyRunning : (BOOL)
templateId messageId : (NSString *)messageId appAlreadyRunning : (BOOL)

Copilot uses AI. Check for mistakes.

appAlreadyRunning dataFields : (NSDictionary *)dataFields) {
[_swiftAPI trackPushOpenWithCampaignId:campaignId
templateId:templateId
messageId:messageId
appAlreadyRunning:appAlreadyRunning
dataFields:dataFields];
}

RCT_EXPORT_METHOD(trackInAppOpen : (NSString *)messageId location : (NSNumber *)
RCT_EXPORT_METHOD(trackInAppOpen : (NSString *)messageId location : (double)
location) {
[_swiftAPI trackInAppOpen:messageId location:location];
}

RCT_EXPORT_METHOD(trackInAppClick : (NSString *)messageId location : (
NSNumber *)location clickedUrl : (NSString *)clickedUrl) {
RCT_EXPORT_METHOD(trackInAppClick : (NSString *)messageId location : (double)
location clickedUrl : (NSString *)clickedUrl) {
[_swiftAPI trackInAppClick:messageId location:location clickedUrl:clickedUrl];
}

RCT_EXPORT_METHOD(trackInAppClose : (NSString *)messageId location : (
NSNumber *)location source : (NSNumber *)source clickedUrl : (NSString *)
clickedUrl) {
RCT_EXPORT_METHOD(trackInAppClose : (NSString *)messageId location : (double)
location source : (double)source clickedUrl : (NSString *)
clickedUrl) {
[_swiftAPI trackInAppClose:messageId
location:location
source:source
clickedUrl:clickedUrl];
}

RCT_EXPORT_METHOD(inAppConsume : (NSString *)messageId location : (NSNumber *)
location source : (NSNumber *)source) {
RCT_EXPORT_METHOD(inAppConsume : (NSString *)messageId location : (double)
location source : (double)source) {
[_swiftAPI inAppConsume:messageId location:location source:source];
}

RCT_EXPORT_METHOD(updateCart : (NSArray *)items) {
[_swiftAPI updateCart:items];
}

RCT_EXPORT_METHOD(trackPurchase : (NSNumber *)total items : (NSArray *)
RCT_EXPORT_METHOD(trackPurchase : (double)total items : (NSArray *)
items dataFields : (NSDictionary *)dataFields) {
[_swiftAPI trackPurchase:total items:items dataFields:dataFields];
}
Expand All @@ -430,6 +429,7 @@ - (void)passAlongAuthToken:(NSString *)authToken {
BOOL)mergeNestedObjects) {
[_swiftAPI updateUser:dataFields mergeNestedObjects:mergeNestedObjects];
}

RCT_EXPORT_METHOD(updateEmail : (NSString *)email authToken : (NSString *)
authToken) {
[_swiftAPI updateEmail:email authToken:authToken];
Expand Down Expand Up @@ -471,8 +471,8 @@ - (void)passAlongAuthToken:(NSString *)authToken {
NSArray *)
unsubscribedChannelIds unsubscribedMessageTypeIds : (NSArray *)
unsubscribedMessageTypeIds subscribedMessageTypeIds : (NSArray *)
subscribedMessageTypeIds campaignId : (NSNumber *)
campaignId templateId : (NSNumber *)templateId) {
subscribedMessageTypeIds campaignId : (double)
campaignId templateId : (double)templateId) {
[_swiftAPI updateSubscriptions:emailListIds
unsubscribedChannelIds:unsubscribedChannelIds
unsubscribedMessageTypeIds:unsubscribedMessageTypeIds
Expand All @@ -491,7 +491,7 @@ - (void)passAlongAuthToken:(NSString *)authToken {
[_swiftAPI updateVisibleRows:visibleRows];
}

RCT_EXPORT_METHOD(passAlongAuthToken : (NSString *)authToken) {
RCT_EXPORT_METHOD(passAlongAuthToken : (NSString *_Nullable)authToken) {
[_swiftAPI passAlongAuthToken:authToken];
}

Expand Down
Loading