Skip to content

[MOB-11833] format-files #686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: new-arch/MOB-11826-make-frontend-api-and-codegen
Choose a base branch
from
Open
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
30 changes: 30 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
BasedOnStyle: LLVM
Language: Cpp
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
ColumnLimit: 80
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentWidth: 2
IndentWrappedFunctionNames: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
ObjCBinPackProtocolList: Never
ReflowComments: true
SortIncludes: false
SpaceBeforeParens: Never
SpaceInEmptyParentheses: false
UseTab: Never

...
79 changes: 79 additions & 0 deletions .swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"fileScopedDeclarationPrivacy" : {
"accessLevel" : "private"
},
"indentConditionalCompilationBlocks" : true,
"indentSwitchCaseLabels" : false,
"indentation" : {
"spaces" : 2
},
"lineBreakAroundMultilineExpressionChainComponents" : false,
"lineBreakBeforeControlFlowKeywords" : false,
"lineBreakBeforeEachArgument" : false,
"lineBreakBeforeEachGenericRequirement" : false,
"lineBreakBetweenDeclarationAttributes" : false,
"lineLength" : 100,
"maximumBlankLines" : 1,
"multiElementCollectionTrailingCommas" : true,
"noAssignmentInExpressions" : {
"allowedFunctions" : [
"XCTAssertNoThrow"
]
},
"prioritizeKeepingFunctionOutputTogether" : false,
"reflowMultilineStringLiterals" : {
"never" : {

}
},
"respectsExistingLineBreaks" : true,
"rules" : {
"AllPublicDeclarationsHaveDocumentation" : false,
"AlwaysUseLiteralForEmptyCollectionInit" : false,
"AlwaysUseLowerCamelCase" : true,
"AmbiguousTrailingClosureOverload" : true,
"AvoidRetroactiveConformances" : true,
"BeginDocumentationCommentWithOneLineSummary" : false,
"DoNotUseSemicolons" : true,
"DontRepeatTypeInStaticProperties" : true,
"FileScopedDeclarationPrivacy" : true,
"FullyIndirectEnum" : true,
"GroupNumericLiterals" : true,
"IdentifiersMustBeASCII" : true,
"NeverForceUnwrap" : false,
"NeverUseForceTry" : false,
"NeverUseImplicitlyUnwrappedOptionals" : false,
"NoAccessLevelOnExtensionDeclaration" : true,
"NoAssignmentInExpressions" : true,
"NoBlockComments" : true,
"NoCasesWithOnlyFallthrough" : true,
"NoEmptyLinesOpeningClosingBraces" : false,
"NoEmptyTrailingClosureParentheses" : true,
"NoLabelsInCasePatterns" : true,
"NoLeadingUnderscores" : false,
"NoParensAroundConditions" : true,
"NoPlaygroundLiterals" : true,
"NoVoidReturnOnFunctionSignature" : true,
"OmitExplicitReturns" : false,
"OneCasePerLine" : true,
"OneVariableDeclarationPerLine" : true,
"OnlyOneTrailingClosureArgument" : true,
"OrderedImports" : true,
"ReplaceForEachWithForLoop" : true,
"ReturnVoidInsteadOfEmptyTuple" : true,
"TypeNamesShouldBeCapitalized" : true,
"UseEarlyExits" : false,
"UseExplicitNilCheckInConditions" : true,
"UseLetInEveryBoundCaseVariable" : true,
"UseShorthandTypeNames" : true,
"UseSingleLinePropertyGetter" : true,
"UseSynthesizedInitializer" : true,
"UseTripleSlashForDocumentationComments" : true,
"UseWhereClausesInForLoops" : false,
"ValidateDocumentationComments" : false
},
"spacesAroundRangeFormationOperators" : false,
"spacesBeforeEndOfLineComments" : 2,
"tabWidth" : 8,
"version" : 1
}
3 changes: 2 additions & 1 deletion example/ios/ReactNativeSdkExample-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
// Use this file to import your target's public headers that you would like to
// expose to Swift.
//
15 changes: 7 additions & 8 deletions example/ios/ReactNativeSdkExample/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
// Created by Loren Posen on 6/11/25.
//

import UIKit
import React
import React_RCTAppDelegate
import ReactAppDependencyProvider
import React_RCTAppDelegate
import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand Down Expand Up @@ -46,11 +46,10 @@ class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
}

override func bundleURL() -> URL? {
#if DEBUG
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
#if DEBUG
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
#else
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
#endif
}
}

4 changes: 2 additions & 2 deletions example/ios/ReactNativeSdkExampleTests-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
// Use this file to import your target's public headers that you would like to
// expose to Swift.
//

3 changes: 2 additions & 1 deletion ios/RNIterableAPI/RNIterable-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
// Use this file to import your target's public headers that you would like to
// expose to Swift.
//

#import <React/RCTBridge.h>
Expand Down
1 change: 0 additions & 1 deletion ios/RNIterableAPI/RNIterableAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
// Copyright © 2025 Iterable. All rights reserved.
//
#import <React/RCTBridgeModule.h>

160 changes: 76 additions & 84 deletions ios/RNIterableAPI/RNIterableAPI.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4,136 +4,128 @@
//
#import "RNIterableAPI.h"

@interface RCT_EXTERN_REMAP_MODULE(RNIterableAPI, ReactIterableAPI, NSObject)
@interface RCT_EXTERN_REMAP_MODULE (RNIterableAPI, ReactIterableAPI, NSObject)

// MARK: - Native SDK Functions

RCT_EXTERN_METHOD(initializeWithApiKey: (nonnull NSString *) apiKey
config: (nonnull NSDictionary *) config
version: (nonnull NSString *) version
resolver: (RCTPromiseResolveBlock) resolve
rejecter: (RCTPromiseRejectBlock) reject)
RCT_EXTERN_METHOD(initializeWithApiKey : (nonnull NSString *)apiKey config : (
nonnull NSDictionary *)config version : (nonnull NSString *)
version resolver : (RCTPromiseResolveBlock)
resolve rejecter : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(initialize2WithApiKey: (nonnull NSString *) apiKey
config: (nonnull NSDictionary *) config
apiEndPointOverride: (nonnull NSString *) apiEndPoint
version: (nonnull NSString *) version
resolver: (RCTPromiseResolveBlock) resolve
rejecter: (RCTPromiseRejectBlock) reject)
RCT_EXTERN_METHOD(initialize2WithApiKey : (nonnull NSString *)apiKey config : (
nonnull NSDictionary *)config apiEndPointOverride : (nonnull NSString *)
apiEndPoint version : (nonnull NSString *)
version resolver : (RCTPromiseResolveBlock)
resolve rejecter : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(setEmail: (NSString *) email
authToken: (NSString *) authToken)
RCT_EXTERN_METHOD(setEmail : (NSString *)email authToken : (NSString *)
authToken)

RCT_EXTERN_METHOD(getEmail: (RCTPromiseResolveBlock) resolve
rejecter: (RCTPromiseRejectBlock) reject)
RCT_EXTERN_METHOD(getEmail : (RCTPromiseResolveBlock)
resolve rejecter : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(setUserId: (NSString *) userId
authToken: (NSString *) authToken)
RCT_EXTERN_METHOD(setUserId : (NSString *)userId authToken : (NSString *)
authToken)

RCT_EXTERN_METHOD(getUserId: (RCTPromiseResolveBlock) resolve
rejecter: (RCTPromiseRejectBlock) reject)
RCT_EXTERN_METHOD(getUserId : (RCTPromiseResolveBlock)
resolve rejecter : (RCTPromiseRejectBlock)reject)

// MARK: - Iterable API Request Functions

RCT_EXTERN_METHOD(disableDeviceForCurrentUser)

RCT_EXTERN_METHOD(setInAppShowResponse: (nonnull NSNumber *) inAppShowResponse)
RCT_EXTERN_METHOD(setInAppShowResponse : (nonnull NSNumber *)inAppShowResponse)

RCT_EXTERN_METHOD(getLastPushPayload: (RCTPromiseResolveBlock) resolve
rejecter: (RCTPromiseRejectBlock) reject)
RCT_EXTERN_METHOD(getLastPushPayload : (RCTPromiseResolveBlock)
resolve rejecter : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getAttributionInfo: (RCTPromiseResolveBlock) resolve
rejecter: (RCTPromiseRejectBlock) reject)
RCT_EXTERN_METHOD(getAttributionInfo : (RCTPromiseResolveBlock)
resolve rejecter : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(setAttributionInfo: (NSDictionary *) attributionInfo)
RCT_EXTERN_METHOD(setAttributionInfo : (NSDictionary *)attributionInfo)

RCT_EXTERN_METHOD(trackPushOpenWithCampaignId: (nonnull NSNumber *) campaignId
templateId: (nonnull NSNumber *) templateId
messageId: (nonnull NSString *) messageId
appAlreadyRunning: (BOOL) appAlreadyRunning
dataFields: (NSDictionary *) dataFields)
RCT_EXTERN_METHOD(
trackPushOpenWithCampaignId : (nonnull NSNumber *)campaignId templateId : (
nonnull NSNumber *)templateId messageId : (nonnull NSString *)
messageId appAlreadyRunning : (BOOL)
appAlreadyRunning dataFields : (NSDictionary *)dataFields)

RCT_EXTERN_METHOD(updateCart: (NSArray *) items)
RCT_EXTERN_METHOD(updateCart : (NSArray *)items)

RCT_EXTERN_METHOD(trackPurchase: (nonnull NSNumber *) total
items: (NSArray *) items
dataFields: (NSDictionary *) dataFields)
RCT_EXTERN_METHOD(trackPurchase : (nonnull NSNumber *)total items : (NSArray *)
items dataFields : (NSDictionary *)dataFields)

RCT_EXTERN_METHOD(trackInAppOpen: (NSString *) messageId
location: (nonnull NSNumber *) location)
RCT_EXTERN_METHOD(trackInAppOpen : (NSString *)
messageId location : (nonnull NSNumber *)location)

RCT_EXTERN_METHOD(trackInAppClick: (nonnull NSString *) messageId
location: (nonnull NSNumber *) location
clickedUrl: (nonnull NSString *) clickedUrl)
RCT_EXTERN_METHOD(trackInAppClick : (nonnull NSString *)messageId location : (
nonnull NSNumber *)location clickedUrl : (nonnull NSString *)clickedUrl)

RCT_EXTERN_METHOD(trackInAppClose: (nonnull NSString *) messageId
location: (nonnull NSNumber *) location
source: (nonnull NSNumber *) source
clickedUrl: (NSString *) clickedUrl)
RCT_EXTERN_METHOD(trackInAppClose : (nonnull NSString *)messageId location : (
nonnull NSNumber *)location source : (nonnull NSNumber *)
source clickedUrl : (NSString *)clickedUrl)

RCT_EXTERN_METHOD(inAppConsume: (nonnull NSString *) messageId
location: (nonnull NSNumber *) location
source: (nonnull NSNumber *) source)
RCT_EXTERN_METHOD(inAppConsume : (nonnull NSString *)messageId location : (
nonnull NSNumber *)location source : (nonnull NSNumber *)source)

RCT_EXTERN_METHOD(trackEvent: (nonnull NSString *) name
dataFields: (NSDictionary *) dataFields)
RCT_EXTERN_METHOD(trackEvent : (nonnull NSString *)
name dataFields : (NSDictionary *)dataFields)

RCT_EXTERN_METHOD(updateUser: (nonnull NSDictionary *) dataFields
mergeNestedObjects: (BOOL) mergeNestedObjects)
RCT_EXTERN_METHOD(updateUser : (nonnull NSDictionary *)
dataFields mergeNestedObjects : (BOOL)mergeNestedObjects)

RCT_EXTERN_METHOD(updateEmail: (nonnull NSString *) email
authToken: (NSString *) authToken)
RCT_EXTERN_METHOD(updateEmail : (nonnull NSString *)
email authToken : (NSString *)authToken)

RCT_EXTERN_METHOD(handleAppLink: (nonnull NSString *) appLink
resolver: (RCTPromiseResolveBlock) resolve
rejecter: (RCTPromiseRejectBlock) reject)
RCT_EXTERN_METHOD(handleAppLink : (nonnull NSString *)appLink resolver : (
RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(updateSubscriptions: (NSArray *) emailListIds
unsubscribedChannelIds: (NSArray *) unsubscribedChannelIds
unsubscribedMessageTypeIds: (NSArray *) unsubscribedMessageTypeIds
subscribedMessageTypeIds: (NSArray *) subscribedMessageTypeIds
campaignId: (nonnull NSNumber *) campaignId
templateId: (nonnull NSNumber *) templateId)
RCT_EXTERN_METHOD(
updateSubscriptions : (NSArray *)emailListIds unsubscribedChannelIds : (
NSArray *)
unsubscribedChannelIds unsubscribedMessageTypeIds : (NSArray *)
unsubscribedMessageTypeIds subscribedMessageTypeIds : (NSArray *)
subscribedMessageTypeIds campaignId : (nonnull NSNumber *)
campaignId templateId : (nonnull NSNumber *)templateId)

// MARK: - SDK In-App Manager Functions

RCT_EXTERN_METHOD(getInAppMessages: (RCTPromiseResolveBlock) resolve
rejecter: (RCTPromiseRejectBlock) reject)
RCT_EXTERN_METHOD(getInAppMessages : (RCTPromiseResolveBlock)
resolve rejecter : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getHtmlInAppContentForMessage: (nonnull NSString *) messageId
resolver: (RCTPromiseResolveBlock) resolve
rejecter: (RCTPromiseRejectBlock) reject)
RCT_EXTERN_METHOD(getHtmlInAppContentForMessage : (nonnull NSString *)
messageId resolver : (RCTPromiseResolveBlock)
resolve rejecter : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getInboxMessages: (RCTPromiseResolveBlock) resolve
rejecter: (RCTPromiseRejectBlock) reject)
RCT_EXTERN_METHOD(getInboxMessages : (RCTPromiseResolveBlock)
resolve rejecter : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(getUnreadInboxMessagesCount: (RCTPromiseResolveBlock) resolve
rejecter: (RCTPromiseRejectBlock) reject)
RCT_EXTERN_METHOD(getUnreadInboxMessagesCount : (RCTPromiseResolveBlock)
resolve rejecter : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(showMessage: (nonnull NSString *) messageId
consume: (nonnull BOOL) consume
resolver: (RCTPromiseResolveBlock) resolve
rejecter: (RCTPromiseRejectBlock) reject)
RCT_EXTERN_METHOD(showMessage : (nonnull NSString *)messageId consume : (
nonnull BOOL)consume resolver : (RCTPromiseResolveBlock)
resolve rejecter : (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(removeMessage: (nonnull NSString *) messageId
location: (nonnull NSNumber *) location
source: (nonnull NSNumber *) source)
RCT_EXTERN_METHOD(removeMessage : (nonnull NSString *)messageId location : (
nonnull NSNumber *)location source : (nonnull NSNumber *)source)

RCT_EXTERN_METHOD(setReadForMessage: (nonnull NSString *) messageId
read: (BOOL) read)
RCT_EXTERN_METHOD(setReadForMessage : (nonnull NSString *)
messageId read : (BOOL)read)

RCT_EXTERN_METHOD(setAutoDisplayPaused: (BOOL) paused)
RCT_EXTERN_METHOD(setAutoDisplayPaused : (BOOL)paused)

// MARK: - SDK Inbox Session Tracking Functions

RCT_EXTERN_METHOD(startSession: (nonnull NSArray *) visibleRows)
RCT_EXTERN_METHOD(startSession : (nonnull NSArray *)visibleRows)

RCT_EXTERN_METHOD(endSession)

RCT_EXTERN_METHOD(updateVisibleRows: (nonnull NSArray *) visibleRows)
RCT_EXTERN_METHOD(updateVisibleRows : (nonnull NSArray *)visibleRows)

// MARK: - SDK Auth Manager Functions

RCT_EXTERN_METHOD(passAlongAuthToken: (NSString *) authToken)
RCT_EXTERN_METHOD(passAlongAuthToken : (NSString *)authToken)

@end
Loading