New-arch/android-from-test#692
Closed
lposen wants to merge 7 commits into
Closed
Conversation
…r React Native integration
…NIterableAPIModuleImpl for improved modularity and API method handling
… new modular architecture
17 new issues
This is from Qlty Cloud, the successor to Code Climate Quality. Learn more. |
Comment on lines
+75
to
+102
| 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); |
| @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, Double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) { |
|
|
||
| @ReactMethod | ||
| public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, Integer campaignId, Integer templateId) { | ||
| public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, double campaignId, double templateId) { |
|
|
||
| @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) { |
| } | ||
|
|
||
| @Override | ||
| public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, String version, Promise promise) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, String version, Promise promise) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void initialize2WithApiKey(String apiKey, ReadableMap configReadableMap, String apiEndPointOverride, String version, Promise promise) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void trackPushOpenWithCampaignId(double campaignId, Double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, double campaignId, double templateId) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void trackInAppClose(String messageId, double location, double source, @Nullable String clickedUrl) { |
Comment on lines
+75
to
+102
| 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); |
| @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, Double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) { |
|
|
||
| @ReactMethod | ||
| public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, Integer campaignId, Integer templateId) { | ||
| public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, double campaignId, double templateId) { |
|
|
||
| @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) { |
| } | ||
|
|
||
| @Override | ||
| public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, String version, Promise promise) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, String version, Promise promise) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void initialize2WithApiKey(String apiKey, ReadableMap configReadableMap, String apiEndPointOverride, String version, Promise promise) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void trackPushOpenWithCampaignId(double campaignId, Double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, double campaignId, double templateId) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void trackInAppClose(String messageId, double location, double source, @Nullable String clickedUrl) { |
…tance of RNIterableAPIModuleImpl for API method calls
Base automatically changed from
new-arch/MOB-11828-add-backwards-compatibility
to
new-arch/MOB-11827-add-new-architecture-support
August 21, 2025 21:34
Comment on lines
+75
to
+102
| 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); |
| @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, Double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) { |
|
|
||
| @ReactMethod | ||
| public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, Integer campaignId, Integer templateId) { | ||
| public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, double campaignId, double templateId) { |
|
|
||
| @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) { |
| } | ||
|
|
||
| @Override | ||
| public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, String version, Promise promise) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, String version, Promise promise) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void initialize2WithApiKey(String apiKey, ReadableMap configReadableMap, String apiEndPointOverride, String version, Promise promise) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void trackPushOpenWithCampaignId(double campaignId, Double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, double campaignId, double templateId) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void trackInAppClose(String messageId, double location, double source, @Nullable String clickedUrl) { |
Base automatically changed from
new-arch/MOB-11827-add-new-architecture-support
to
new-arch/master
August 21, 2025 21:38
Comment on lines
+75
to
+102
| 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); |
| @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, Double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) { |
|
|
||
| @ReactMethod | ||
| public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, Integer campaignId, Integer templateId) { | ||
| public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, double campaignId, double templateId) { |
|
|
||
| @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) { |
| } | ||
|
|
||
| @Override | ||
| public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, String version, Promise promise) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void initializeWithApiKey(String apiKey, ReadableMap configReadableMap, String version, Promise promise) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void initialize2WithApiKey(String apiKey, ReadableMap configReadableMap, String apiEndPointOverride, String version, Promise promise) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void trackPushOpenWithCampaignId(double campaignId, Double templateId, String messageId, boolean appAlreadyRunning, ReadableMap dataFields) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void updateSubscriptions(ReadableArray emailListIds, ReadableArray unsubscribedChannelIds, ReadableArray unsubscribedMessageTypeIds, ReadableArray subscribedMessageTypeIds, double campaignId, double templateId) { |
| } | ||
|
|
||
| @ReactMethod | ||
| public void trackInAppClose(String messageId, double location, double source, @Nullable String clickedUrl) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔹 JIRA Ticket(s) if any
✏️ Description