Skip to content

Conversation

@lposen
Copy link
Contributor

@lposen lposen commented Oct 11, 2025

🔹 JIRA Ticket(s) if any

✏️ Description

Adds the property to the config file

lposen and others added 30 commits August 1, 2025 14:05
…ew-arch/MOB-11828-add-backwards-compatibility
…ew-arch/MOB-11828-add-backwards-compatibility
…d-api-and-codegen

[MOB-11826] make-frontend-api-and-codegen
…ew-arch/MOB-11828-add-backwards-compatibility
…ew-arch/MOB-11828-add-backwards-compatibility
…s-compatibility

[MOB-11828] add-backwards-compatibility
Added copilot suggestion

Co-authored-by: Copilot <[email protected]>
…itecture-support

[MOB-11827] add-new-architecture-support
lposen and others added 25 commits October 10, 2025 14:08
…sses' into jwt/MOB-10947-task-3-android-retrypolicy-config-at-android-br
…oid-br' into jwt/MOB-11032-task-4-ios-bridge-retrypolicy-and-authfailure
…lure' into jwt/MOB-12231-create-an-iterableapi-class-for-api-calls
…-app' into loren/embedded/MOB-12261-add-embedded-manager-class
@lposen lposen closed this Oct 11, 2025
@github-actions
Copy link

Lines Statements Branches Functions
Coverage: 52%
52.28% (286/547) 27.14% (57/210) 50.24% (101/201)

@qltysh
Copy link

qltysh bot commented Oct 11, 2025

Diff Coverage: The code coverage on the diff in this pull request is 79.5%.

Total Coverage: This PR will increase coverage by 4.28%.

File Coverage Changes
Path File Coverage Δ Indirect
src/api/NativeRNIterableAPI.ts 100.0
src/api/index.ts 100.0
src/core/classes/Iterable.ts -3.0
src/core/classes/IterableApi.ts 85.5
src/core/classes/IterableAuthManager.ts 100.0
src/core/enums/IterableAuthFailureReason.ts 100.0
src/core/enums/IterableRetryBackoff.ts 100.0
src/core/types/IterableAuthFailure.ts 100.0
src/core/types/IterableRetryPolicy.ts 100.0
src/embedded/classes/IterableEmbeddedManager.ts 100.0
src/embedded/classes/index.ts 100.0
src/embedded/index.ts 100.0
src/inApp/classes/IterableInAppManager.ts -1.9
src/inbox/classes/IterableInboxDataModel.ts -2.0
src/inbox/components/IterableInbox.tsx -1.2
src/inbox/components/IterableInboxMessageList.tsx -1.5
🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

@qltysh
Copy link

qltysh bot commented Oct 11, 2025

21 new issues

Tool Category Rule Count
qlty Structure Function with high complexity (count = 5): initializeWithApiKey 4
qlty Structure Function with many parameters (count = 4): initializeWithApiKey 16
qlty Structure Function with many returns (count = 8): IterableAppProvider 1

This is from Qlty Cloud, the successor to Code Climate Quality. Learn more.

Comment on lines +71 to +98
public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, String version, Promise promise) {
IterableLogger.d(TAG, "initializeWithApiKey: " + apiKey);
IterableConfig.Builder configBuilder = Serialization.getConfigFromReadableMap(configReadableMap);

@Override
public String getName() {
return "RNIterableAPI";
if (configReadableMap.hasKey("urlHandlerPresent") && configReadableMap.getBoolean("urlHandlerPresent") == true) {
configBuilder.setUrlHandler(this);
}

if (configReadableMap.hasKey("customActionHandlerPresent") && configReadableMap.getBoolean("customActionHandlerPresent") == true) {
configBuilder.setCustomActionHandler(this);
}

if (configReadableMap.hasKey("inAppHandlerPresent") && configReadableMap.getBoolean("inAppHandlerPresent") == true) {
configBuilder.setInAppHandler(this);
}

if (configReadableMap.hasKey("authHandlerPresent") && configReadableMap.getBoolean("authHandlerPresent") == true) {
configBuilder.setAuthHandler(this);
}

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

IterableApi.getInstance().getInAppManager().addListener(this);

// MOB-10421: Figure out what the error cases are and handle them appropriately
// This is just here to match the TS types and let the JS thread know when we are done initializing
promise.resolve(true);
Copy link

Choose a reason for hiding this comment

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

Found 2 issues:

1. Function with high complexity (count = 5): initializeWithApiKey [qlty:function-complexity]


2. Function with many parameters (count = 4): initializeWithApiKey [qlty:function-parameters]

@ReactMethod
public void trackPushOpenWithCampaignId(Integer campaignId, Integer templateId, String messageId, Boolean appAlreadyRunning, ReadableMap dataFields) {
RNIterableInternal.trackPushOpenWithCampaignId(campaignId, templateId, messageId, optSerializedDataFields(dataFields));
public void trackPushOpenWithCampaignId(double campaignId, @Nullable Double templateId, String messageId, boolean appAlreadyRunning, @Nullable ReadableMap dataFields) {
Copy link

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]


@ReactMethod
public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, Integer campaignId, Integer templateId) {
public void updateSubscriptions(@Nullable ReadableArray emailListIds, @Nullable ReadableArray unsubscribedChannelIds, @Nullable ReadableArray unsubscribedMessageTypeIds, @Nullable ReadableArray subscribedMessageTypeIds, double campaignId, double templateId) {
Copy link

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 = 6): updateSubscriptions [qlty:function-parameters]


@ReactMethod
public void trackInAppClose(String messageId, Integer location, Integer source, @Nullable String clickedUrl) {
public void trackInAppClose(String messageId, double location, double source, @Nullable String clickedUrl) {
Copy link

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 = 4): trackInAppClose [qlty:function-parameters]

}

@Override
public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, String version, Promise promise) {
Copy link

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 = 4): initializeWithApiKey [qlty:function-parameters]

}

@ReactMethod
public void updateSubscriptions(@Nullable ReadableArray emailListIds, @Nullable ReadableArray unsubscribedChannelIds, @Nullable ReadableArray unsubscribedMessageTypeIds, @Nullable ReadableArray subscribedMessageTypeIds, double campaignId, double templateId) {
Copy link

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 = 6): updateSubscriptions [qlty:function-parameters]

}

@ReactMethod
public void trackInAppClose(String messageId, double location, double source, @Nullable String clickedUrl) {
Copy link

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 = 4): trackInAppClose [qlty:function-parameters]

Comment on lines +79 to +101
private func setupUserNotificationCenter() {
UNUserNotificationCenter.current().delegate = self
UNUserNotificationCenter.current().getNotificationSettings { settings in
if settings.authorizationStatus != .authorized {
ITBInfo("Not authorized")
// not authorized, ask for permission
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { success, _ in
ITBInfo("auth: \(success)")
if success {
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
}
// TODO: Handle error etc.
}
} else {
// already authorized
ITBInfo("Already authorized")
DispatchQueue.main.async {
UIApplication.shared.registerForRemoteNotifications()
}
}
}
Copy link

Choose a reason for hiding this comment

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

Function with high complexity (count = 6): setupUserNotificationCenter [qlty:function-complexity]

Comment on lines +14 to +47
const requestNotificationPermission = async () => {
if (Platform.OS === 'android') {
const apiLevel = Platform.Version; // Get the Android API level

if (apiLevel >= 33) {
// Check if Android 13 or higher
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS,
{
title: 'Notification Permission',
message:
'This app needs access to your notifications for push, in-app messages, embedded messages and more.',
buttonNeutral: 'Ask Me Later',
buttonNegative: 'Cancel',
buttonPositive: 'OK',
}
);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
console.log('Notification permission granted');
} else {
console.log('Notification permission denied');
}
} catch (err) {
console.warn(err);
}
} else {
// For Android versions below 13, notification permission is generally not required
// or is automatically granted upon app installation.
console.log(
'Notification permission not required for this Android version.'
);
}
}
Copy link

Choose a reason for hiding this comment

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

Function with high complexity (count = 15): requestNotificationPermission [qlty:function-complexity]

Comment on lines 880 to 886
static updateSubscriptions(
emailListIds: number[] | undefined,
unsubscribedChannelIds: number[] | undefined,
unsubscribedMessageTypeIds: number[] | undefined,
subscribedMessageTypeIds: number[] | undefined,
emailListIds: number[] | null,
unsubscribedChannelIds: number[] | null,
unsubscribedMessageTypeIds: number[] | null,
subscribedMessageTypeIds: number[] | null,
campaignId: number,
templateId: number
Copy link

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 = 6): updateSubscriptions [qlty:function-parameters]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants