├── .github └── workflows │ ├── build_docs.yml │ ├── build_sample_workflow.yml │ ├── nightly_build_worklow.yml │ ├── on_new_tag_workflow.yml │ └── on_push_workflow.yml ├── .gitignore ├── .reuse └── dep5 ├── Dockerfile.codescan ├── Emarsys Sample ├── .DS_Store ├── Emarsys Sample │ └── .DS_Store ├── Emarsys-Sample.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Emarsys-Sample.xcscheme ├── Emarsys-Sample.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Emarsys-Sample │ ├── AppDelegate.swift │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── 1024.png │ │ │ ├── 114.png │ │ │ ├── 120.png │ │ │ ├── 180.png │ │ │ ├── 29.png │ │ │ ├── 40.png │ │ │ ├── 57.png │ │ │ ├── 58.png │ │ │ ├── 60.png │ │ │ ├── 80.png │ │ │ ├── 87.png │ │ │ └── Contents.json │ │ ├── Contents.json │ │ └── placeholderImage.imageset │ │ │ ├── Contents.json │ │ │ └── placeholderImage.png │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── ConfigUserDefaultsKey.swift │ ├── Emarsys-Sample.entitlements │ ├── Extensions │ │ ├── ShakeGesture.swift │ │ └── UIApplication+Keyboard.swift │ ├── Inbox │ │ ├── MessageManager.swift │ │ └── UserCentricManager.swift │ ├── Info.plist │ ├── Models │ │ ├── LoginData.swift │ │ ├── Message.swift │ │ └── Product.swift │ ├── Preview Content │ │ └── Preview Assets.xcassets │ │ │ └── Contents.json │ ├── SceneDelegate.swift │ ├── SignInWithAppleDelegate.swift │ ├── ViewComponents │ │ ├── FloatingTextField.swift │ │ ├── ImageView.swift │ │ ├── InfoPanelView.swift │ │ ├── InlineInAppView.swift │ │ ├── MessagesView.swift │ │ ├── MultilineTextView.swift │ │ ├── ProductsView.swift │ │ ├── PullToRefreshView.swift │ │ └── SignInWithAppleButton.swift │ ├── Views │ │ ├── ContentView.swift │ │ ├── DashboardView.swift │ │ ├── InAppView.swift │ │ ├── InboxView.swift │ │ ├── MobileEngageView.swift │ │ └── PredictView.swift │ └── Wrappers │ │ └── StoredValue.swift ├── Emarsys-SampleTests │ ├── Emarsys_SampleTests.swift │ └── Info.plist ├── Emarsys-SampleUITests │ ├── Emarsys_SampleUITests.swift │ └── Info.plist ├── NotificationService │ ├── Info.plist │ └── NotificationService.swift ├── Podfile └── README.md ├── EmarsysNotificationService.podspec ├── EmarsysNotificationService.podspec.template ├── EmarsysSDK.podspec ├── EmarsysSDK.podspec.template ├── EmarsysSDK.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ ├── E2ETests.xcscheme │ ├── EmarsysSDK.xcscheme │ ├── PredictTests.xcscheme │ └── Tests.xcscheme ├── Jenkinsfile ├── LICENSE ├── LICENSES └── MPL-2.0.txt ├── Package.resolved ├── Package.swift ├── Podfile ├── README.md ├── SdkHost ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── SdkHost.entitlements ├── ViewController.h ├── ViewController.m └── main.m ├── Sources ├── Core │ ├── Batch │ │ ├── EMSBatchingShardTrigger.m │ │ ├── EMSCountPredicate.m │ │ ├── EMSListChunker.m │ │ └── EMSPredicate.m │ ├── Categories │ │ ├── EMSRequestModel+RequestIds.m │ │ ├── EMSResponseModel+EMSCore.m │ │ ├── NSDate+EMSCore.m │ │ ├── NSDictionary+EMSCore.m │ │ ├── NSError+EMSCore.m │ │ ├── NSHTTPURLResponse+EMSCore.m │ │ ├── NSMutableDictionary+EMSCore.m │ │ ├── NSOperationQueue+EMSCore.m │ │ ├── NSString+EMSCore.m │ │ ├── NSURL+EMSCore.m │ │ └── NSURLRequest+EMSCore.m │ ├── ConnectionWatchdog │ │ └── EMSConnectionWatchdog.m │ ├── Crypto │ │ └── EMSCrypto.m │ ├── Database │ │ ├── EMSCountMapper.m │ │ ├── EMSRequestModelMapper.m │ │ ├── EMSSQLStatementFactory.m │ │ ├── EMSSQLiteHelper.m │ │ ├── EMSShardMapper.m │ │ ├── EMSSqliteSchemaHandler.m │ │ └── Trigger │ │ │ ├── EMSDBTrigger.m │ │ │ └── EMSDBTriggerKey.m │ ├── EMSAuthentication.m │ ├── EMSDeviceInfo.m │ ├── EMSRequestManager.m │ ├── Flipper │ │ └── MEExperimental.m │ ├── Log │ │ ├── EMSLogLevel.m │ │ ├── EMSLogMapper.m │ │ ├── EMSLogger.m │ │ ├── EMSSdkStateLogger.m │ │ └── LogEntry │ │ │ ├── EMSAppEventLog.m │ │ │ ├── EMSCrashLog.m │ │ │ ├── EMSInAppLog.m │ │ │ ├── EMSMethodNotAllowed.m │ │ │ ├── EMSOfflineQueueSize.m │ │ │ ├── EMSRequestLog.m │ │ │ └── EMSStatusLog.m │ ├── Middlewares │ │ └── EMSCompletionMiddleware.m │ ├── Models │ │ ├── EMSCompositeRequestModel.m │ │ ├── EMSRequestModel.m │ │ ├── EMSRequestModelBuilder.m │ │ ├── EMSResponseModel.m │ │ ├── EMSShard.m │ │ └── EMSShardBuilder.m │ ├── Networking │ │ ├── EMSCoreCompletionHandler.m │ │ ├── EMSCoreCompletionHandlerMiddleware.m │ │ ├── EMSRESTClient.m │ │ └── EMSRESTClientCompletionProxyFactory.m │ ├── Operation │ │ ├── EMSOperationQueue.m │ │ └── Proxy │ │ │ ├── EMSDispatchWaiter.m │ │ │ └── EMSQueueDelegator.m │ ├── Providers │ │ ├── EMSCompletionBlockProvider.m │ │ ├── EMSCompletionProvider.m │ │ ├── EMSRandomProvider.m │ │ ├── EMSTimestampProvider.m │ │ └── EMSUUIDProvider.m │ ├── Repository │ │ ├── RequestModel │ │ │ └── EMSRequestModelRepository.m │ │ ├── Shard │ │ │ └── EMSShardRepository.m │ │ └── Specifications │ │ │ ├── EMSCommonSQLSpecification.m │ │ │ ├── EMSFilterByNothingSpecification.m │ │ │ ├── EMSFilterByTypeSpecification.m │ │ │ ├── EMSFilterByValuesSpecification.m │ │ │ └── EMSQueryOldestRowSpecification.m │ ├── ResponseHandlers │ │ └── EMSAbstractResponseHandler.m │ ├── Router │ │ └── EMSInstanceRouter.m │ ├── Schedulers │ │ ├── EMSAgenda.m │ │ └── EMSScheduler.m │ ├── Store │ │ ├── EMSInMemoryStorage.m │ │ └── EMSStorage.m │ ├── Validators │ │ └── EMSDictionaryValidator.m │ └── Worker │ │ └── EMSDefaultWorker.m ├── EmarsysSDK │ ├── AppStart │ │ ├── EMSAppStartBlockProvider.m │ │ └── EMSWrapperChecker.m │ ├── DI │ │ ├── EMSDependencyContainer.m │ │ └── EMSDependencyInjection.m │ ├── DeepLink │ │ └── EMSDeepLinkInternal.m │ ├── EMSAppDelegate.m │ ├── Emarsys.m │ ├── Endpoints │ │ └── EMSEndpoint.m │ ├── EventHandler │ │ ├── EMSEventHandlerProtocolBlockConverter.m │ │ └── EMSEventHandlerProtocolImplementation.m │ ├── FlipperFeatures │ │ └── EMSInnerFeature.m │ ├── Info.plist │ ├── RequestTools │ │ └── EMSEmarsysRequestFactory.m │ └── Setup │ │ ├── EMSConfig.m │ │ ├── EMSConfigBuilder.m │ │ ├── EMSConfigInternal.m │ │ ├── EMSRemoteConfig.m │ │ ├── EMSRemoteConfigResponseMapper.m │ │ └── EMSValueProvider.m ├── MobileEngage │ ├── Actions │ │ ├── EMSAppEventActionModel.m │ │ ├── EMSCustomEventActionModel.m │ │ ├── EMSDismissActionModel.m │ │ └── EMSOpenExternalUrlActionModel.m │ ├── Category │ │ ├── EMSDeviceInfo+MEClientPayload.m │ │ ├── NSData+MobileEngine.m │ │ └── NSDictionary+MobileEngage.m │ ├── Geofence │ │ ├── EMSGeofenceInternal.m │ │ ├── EMSGeofenceResponseMapper.m │ │ ├── EMSLoggingGeofenceInternal.m │ │ └── Models │ │ │ ├── EMSGeofence.m │ │ │ ├── EMSGeofenceGroup.m │ │ │ ├── EMSGeofenceResponse.m │ │ │ └── EMSGeofenceTrigger.m │ ├── IAM │ │ ├── EMSInAppInternal.m │ │ ├── EMSLoggingInApp.m │ │ ├── JSCommands │ │ │ ├── MEIAMButtonClicked.m │ │ │ ├── MEIAMClose.m │ │ │ ├── MEIAMCommandResultUtils.m │ │ │ ├── MEIAMCopyToClipboard.m │ │ │ ├── MEIAMJSCommandFactory.m │ │ │ ├── MEIAMOpenExternalLink.m │ │ │ ├── MEIAMRequestPushPermission.m │ │ │ ├── MEIAMTriggerAppEvent.m │ │ │ └── MEIAMTriggerMEEvent.m │ │ ├── MEInApp.m │ │ ├── MEInAppMessage.m │ │ ├── MEJSBridge.m │ │ ├── Providers │ │ │ ├── EMSIAMViewControllerProvider.m │ │ │ ├── EMSMainWindowProvider.m │ │ │ ├── EMSSceneProvider.m │ │ │ ├── EMSViewControllerProvider.m │ │ │ └── EMSWindowProvider.m │ │ └── UI │ │ │ ├── EMSInlineInAppView.m │ │ │ └── MEIAMViewController.m │ ├── InboxV3 │ │ ├── EMSInboxResult.m │ │ ├── EMSInboxResultParser.m │ │ ├── EMSInboxV3.m │ │ ├── EMSLoggingInboxV3.m │ │ └── EMSMessage.m │ ├── Info.plist │ ├── Internal │ │ ├── EMSDeviceInfoV3ClientInternal.m │ │ ├── EMSLoggingMobileEngageInternal.m │ │ └── EMSMobileEngageV3Internal.m │ ├── Mappers │ │ ├── EMSContactTokenMapper.m │ │ ├── EMSDeviceEventStateRequestMapper.m │ │ ├── EMSMobileEngageMapper.m │ │ └── EMSOpenIdTokenMapper.m │ ├── OnEventAction │ │ ├── EMSLoggingOnEventActionInternal.m │ │ └── EMSOnEventActionInternal.m │ ├── Parser │ │ └── EMSMobileEngageNullSafeBodyParser.m │ ├── Push │ │ ├── Actions │ │ │ ├── EMSActionFactory.m │ │ │ ├── EMSAppEventAction.m │ │ │ ├── EMSBadgeCountAction.m │ │ │ ├── EMSCustomEventAction.m │ │ │ └── EMSOpenExternalUrlAction.m │ │ ├── EMSLoggingPushInternal.m │ │ ├── EMSNotificationInformation.m │ │ └── EMSPushV3Internal.m │ ├── RequestTools │ │ ├── EMSCompletionProxyFactory.m │ │ ├── EMSMobileEngageRefreshTokenCompletionProxy.m │ │ ├── EMSRequestFactory.m │ │ ├── MEDefaultHeaders.m │ │ └── MERequestContext.m │ ├── ResponseHandlers │ │ ├── EMSClientStateResponseHandler.m │ │ ├── EMSContactTokenResponseHandler.m │ │ ├── EMSDeviceEventStateResponseHandler.m │ │ ├── EMSOnEventResponseHandler.m │ │ ├── EMSRefreshTokenResponseHandler.m │ │ └── InappMessage │ │ │ ├── MEIAMCleanupResponseHandlerV3.m │ │ │ ├── MEIAMCleanupResponseHandlerV4.m │ │ │ └── MEIAMResponseHandler.m │ ├── RichNotification │ │ └── EMSNotificationCenterManager.m │ ├── RichNotificationExtension │ │ ├── EMSNotificationService+Actions.m │ │ ├── EMSNotificationService+Attachment.m │ │ ├── EMSNotificationService+PushToInApp.m │ │ ├── EMSNotificationService.m │ │ ├── MEDownloader.m │ │ └── Validators │ │ │ └── EMSServiceDictionaryValidator.m │ ├── Session │ │ ├── EMSSession.m │ │ └── EMSSessionIdHolder.m │ └── Storage │ │ ├── IAM │ │ ├── ButtonClick │ │ │ ├── MEButtonClick.m │ │ │ ├── MEButtonClickMapper.m │ │ │ └── MEButtonClickRepository.m │ │ └── DisplayedIAM │ │ │ ├── MEDisplayedIAM.m │ │ │ ├── MEDisplayedIAMMapper.m │ │ │ └── MEDisplayedIAMRepository.m │ │ ├── MERequestModelRepositoryFactory.m │ │ ├── MERequestRepositoryProxy.m │ │ └── MERequestTools.m ├── Predict │ ├── EMSCartItemUtils.m │ ├── EMSLoggingPredictInternal.m │ ├── EMSPredictInternal.m │ ├── EMSPredictMapper.m │ ├── Mapper │ │ └── EMSProductMapper.m │ ├── Models │ │ ├── EMSCartItem.m │ │ ├── EMSProduct.m │ │ └── EMSProductBuilder.m │ ├── PRERequestContext.m │ ├── Recommendations │ │ ├── EMSLogic.m │ │ └── EMSRecommendationFilter.m │ ├── Requests │ │ ├── EMSPredictRequestModelBuilder.m │ │ └── EMSPredictRequestModelBuilderProvider.m │ └── ResponseHandlers │ │ ├── EMSVisitorIdResponseHandler.m │ │ └── EMSXPResponseHandler.m ├── PrivacyInfo.xcprivacy ├── Private │ ├── EMSAbstractResponseHandler.h │ ├── EMSActionFactory.h │ ├── EMSActionProtocol.h │ ├── EMSAgenda.h │ ├── EMSAppEventAction.h │ ├── EMSAppEventLog.h │ ├── EMSAppStartBlockProvider.h │ ├── EMSAuthentication.h │ ├── EMSBadgeCountAction.h │ ├── EMSBatchingShardTrigger.h │ ├── EMSCartItemUtils.h │ ├── EMSClientStateResponseHandler.h │ ├── EMSCommonSQLSpecification.h │ ├── EMSCompletionBlockProvider.h │ ├── EMSCompletionMiddleware.h │ ├── EMSCompletionProvider.h │ ├── EMSCompletionProxyFactory.h │ ├── EMSCompositeRequestModel.h │ ├── EMSConfigInternal.h │ ├── EMSConnectionWatchdog.h │ ├── EMSContactTokenMapper.h │ ├── EMSContactTokenResponseHandler.h │ ├── EMSCoreCompletion.h │ ├── EMSCoreCompletionHandler.h │ ├── EMSCoreCompletionHandlerMiddleware.h │ ├── EMSCountMapper.h │ ├── EMSCountPredicate.h │ ├── EMSCrashLog.h │ ├── EMSCrypto.h │ ├── EMSCustomEventAction.h │ ├── EMSDBTrigger.h │ ├── EMSDBTriggerKey.h │ ├── EMSDBTriggerProtocol.h │ ├── EMSDeepLinkInternal.h │ ├── EMSDeepLinkProtocol.h │ ├── EMSDefaultWorker.h │ ├── EMSDependencyContainer.h │ ├── EMSDependencyContainerProtocol.h │ ├── EMSDependencyInjection.h │ ├── EMSDeviceEventStateRequestMapper.h │ ├── EMSDeviceEventStateResponseHandler.h │ ├── EMSDeviceInfo+MEClientPayload.h │ ├── EMSDeviceInfo.h │ ├── EMSDeviceInfoClientProtocol.h │ ├── EMSDeviceInfoV3ClientInternal.h │ ├── EMSDictionaryValidator.h │ ├── EMSDispatchWaiter.h │ ├── EMSEmarsysRequestFactory.h │ ├── EMSEndpoint.h │ ├── EMSEventHandlerProtocolBlockConverter.h │ ├── EMSEventHandlerProtocolImplementation.h │ ├── EMSFilterByNothingSpecification.h │ ├── EMSFilterByTypeSpecification.h │ ├── EMSFilterByValuesSpecification.h │ ├── EMSGeofenceGroup.h │ ├── EMSGeofenceInternal.h │ ├── EMSGeofenceResponse.h │ ├── EMSGeofenceResponseMapper.h │ ├── EMSIAMAppEventProtocol.h │ ├── EMSIAMCloseProtocol.h │ ├── EMSIAMViewControllerProvider.h │ ├── EMSInAppInternal.h │ ├── EMSInAppLog.h │ ├── EMSInMemoryStorage.h │ ├── EMSInboxResultParser.h │ ├── EMSInboxV3.h │ ├── EMSInnerFeature.h │ ├── EMSInstanceRouter.h │ ├── EMSListChunker.h │ ├── EMSLockableProtocol.h │ ├── EMSLogEndpoints.h │ ├── EMSLogEntryProtocol.h │ ├── EMSLogMapper.h │ ├── EMSLogger.h │ ├── EMSLoggingGeofenceInternal.h │ ├── EMSLoggingInApp.h │ ├── EMSLoggingInboxV3.h │ ├── EMSLoggingMobileEngageInternal.h │ ├── EMSLoggingOnEventActionInternal.h │ ├── EMSLoggingPredictInternal.h │ ├── EMSLoggingPushInternal.h │ ├── EMSMacros.h │ ├── EMSMainWindowProvider.h │ ├── EMSMethodNotAllowed.h │ ├── EMSMobileEngageMapper.h │ ├── EMSMobileEngageNullSafeBodyParser.h │ ├── EMSMobileEngageProtocol.h │ ├── EMSMobileEngageRefreshTokenCompletionProxy.h │ ├── EMSMobileEngageV3Internal.h │ ├── EMSModelMapperProtocol.h │ ├── EMSNotificationCenterManager.h │ ├── EMSNotificationService+Actions.h │ ├── EMSNotificationService+Attachment.h │ ├── EMSNotificationService+PushToInApp.h │ ├── EMSOfflineQueueSize.h │ ├── EMSOnEventActionInternal.h │ ├── EMSOnEventResponseHandler.h │ ├── EMSOpenExternalUrlAction.h │ ├── EMSOpenIdTokenMapper.h │ ├── EMSOperationQueue.h │ ├── EMSPredicate.h │ ├── EMSPredictInternal.h │ ├── EMSPredictInternalProtocol.h │ ├── EMSPredictMapper.h │ ├── EMSPredictRequestModelBuilder.h │ ├── EMSPredictRequestModelBuilderProvider.h │ ├── EMSProduct+Emarsys.h │ ├── EMSProductBuilder.h │ ├── EMSProductMapper.h │ ├── EMSPushV3Internal.h │ ├── EMSQueryOldestRowSpecification.h │ ├── EMSQueueDelegator.h │ ├── EMSRESTClient.h │ ├── EMSRESTClientCompletionProxyFactory.h │ ├── EMSRESTClientCompletionProxyProtocol.h │ ├── EMSRandomProvider.h │ ├── EMSRefreshTokenResponseHandler.h │ ├── EMSRemoteConfig.h │ ├── EMSRemoteConfigResponseMapper.h │ ├── EMSRepositoryProtocol.h │ ├── EMSRequestFactory.h │ ├── EMSRequestFromShardsMapperProtocol.h │ ├── EMSRequestLog.h │ ├── EMSRequestManager.h │ ├── EMSRequestModel+RequestIds.h │ ├── EMSRequestModel.h │ ├── EMSRequestModelBuilder.h │ ├── EMSRequestModelMapper.h │ ├── EMSRequestModelMapperProtocol.h │ ├── EMSRequestModelRepository.h │ ├── EMSRequestModelRepositoryProtocol.h │ ├── EMSResponseBodyParserProtocol.h │ ├── EMSResponseModel+EMSCore.h │ ├── EMSResponseModel.h │ ├── EMSSQLSpecificationProtocol.h │ ├── EMSSQLStatementFactory.h │ ├── EMSSQLiteHelper.h │ ├── EMSSQLiteHelperProtocol.h │ ├── EMSSQLiteHelperSchemaHandlerProtocol.h │ ├── EMSSceneProvider.h │ ├── EMSScheduler.h │ ├── EMSSchemaContract.h │ ├── EMSSdkStateLogger.h │ ├── EMSServiceDictionaryValidator.h │ ├── EMSSession.h │ ├── EMSSessionIdHolder.h │ ├── EMSShard.h │ ├── EMSShardBuilder.h │ ├── EMSShardMapper.h │ ├── EMSShardRepository.h │ ├── EMSShardRepositoryProtocol.h │ ├── EMSSqliteSchemaHandler.h │ ├── EMSStatusLog.h │ ├── EMSStorage.h │ ├── EMSStorageProtocol.h │ ├── EMSTimestampProvider.h │ ├── EMSTrigger.h │ ├── EMSUUIDProvider.h │ ├── EMSValueProvider.h │ ├── EMSViewControllerProvider.h │ ├── EMSVisitorIdResponseHandler.h │ ├── EMSWindowProvider.h │ ├── EMSWorkerProtocol.h │ ├── EMSWrapperChecker.h │ ├── EMSXPResponseHandler.h │ ├── EmarsysSDKVersion.h │ ├── MEButtonClick.h │ ├── MEButtonClickContract.h │ ├── MEButtonClickMapper.h │ ├── MEButtonClickRepository+Private.h │ ├── MEButtonClickRepository.h │ ├── MEDefaultHeaders.h │ ├── MEDisplayedIAM.h │ ├── MEDisplayedIAMContract.h │ ├── MEDisplayedIAMMapper.h │ ├── MEDisplayedIAMRepository.h │ ├── MEDownloader.h │ ├── MEExperimental.h │ ├── MEIAMButtonClicked.h │ ├── MEIAMCleanupResponseHandlerV3.h │ ├── MEIAMCleanupResponseHandlerV4.h │ ├── MEIAMClose.h │ ├── MEIAMCommandResultUtils.h │ ├── MEIAMCopyToClipboard.h │ ├── MEIAMJSCommandFactory.h │ ├── MEIAMJSCommandProtocol.h │ ├── MEIAMOpenExternalLink.h │ ├── MEIAMProtocol.h │ ├── MEIAMRequestPushPermission.h │ ├── MEIAMResponseHandler.h │ ├── MEIAMTriggerAppEvent.h │ ├── MEIAMTriggerMEEvent.h │ ├── MEIAMViewController.h │ ├── MEInApp.h │ ├── MEInAppMessage.h │ ├── MEInAppTrackingProtocol.h │ ├── MEJSBridge.h │ ├── MERequestContext.h │ ├── MERequestModelRepositoryFactory.h │ ├── MERequestRepositoryProxy.h │ ├── MERequestTools.h │ ├── NSData+MobileEngine.h │ ├── NSDate+EMSCore.h │ ├── NSDictionary+EMSCore.h │ ├── NSDictionary+MobileEngage.h │ ├── NSError+EMSCore.h │ ├── NSHTTPURLResponse+EMSCore.h │ ├── NSMutableDictionary+EMSCore.h │ ├── NSOperationQueue+EMSCore.h │ ├── NSString+EMSCore.h │ ├── NSURL+EMSCore.h │ ├── NSURLRequest+EMSCore.h │ └── PRERequestContext.h └── include │ ├── EMSActionModelProtocol.h │ ├── EMSAppDelegate.h │ ├── EMSAppEventActionModel.h │ ├── EMSBlocks.h │ ├── EMSCartItem.h │ ├── EMSCartItemProtocol.h │ ├── EMSConfig.h │ ├── EMSConfigBuilder.h │ ├── EMSConfigProtocol.h │ ├── EMSCustomEventActionModel.h │ ├── EMSDismissActionModel.h │ ├── EMSFlipperFeatures.h │ ├── EMSGeofence.h │ ├── EMSGeofenceProtocol.h │ ├── EMSGeofenceTrigger.h │ ├── EMSInAppProtocol.h │ ├── EMSInboxResult.h │ ├── EMSInboxTag.h │ ├── EMSInlineInAppView.h │ ├── EMSLogLevel.h │ ├── EMSLogLevelProtocol.h │ ├── EMSLogic.h │ ├── EMSLogicProtocol.h │ ├── EMSMessage.h │ ├── EMSMessageInboxProtocol.h │ ├── EMSNotificationInformation.h │ ├── EMSNotificationService.h │ ├── EMSOnEventActionProtocol.h │ ├── EMSOpenExternalUrlActionModel.h │ ├── EMSPredictProtocol.h │ ├── EMSProduct.h │ ├── EMSProductProtocol.h │ ├── EMSPushNotificationProtocol.h │ ├── EMSRecommendationFilter.h │ ├── EMSRecommendationFilterProtocol.h │ └── Emarsys.h ├── Tests ├── CoreTests.plist ├── CoreTests │ ├── AuthenticationTests.m │ ├── Batch │ │ ├── EMSBatchingShardTriggerTests.m │ │ ├── EMSCountPredicateTests.m │ │ └── EMSListChunkerTests.m │ ├── Categories │ │ ├── NSDate+EMSCoreTests.m │ │ ├── NSDictionary+EMSCoreTest.m │ │ ├── NSDictionary+EMSCoreTests.m │ │ ├── NSMutableDicitionary+EMSCoreTests.m │ │ ├── NSURL+EMSCoreTests.m │ │ └── NSURLRequest+CoreTests.m │ ├── Crypto │ │ ├── EMS11-C3FD3.json │ │ ├── EMS11-C3FD3.sig │ │ └── EMSCryptoTests.m │ ├── Database │ │ ├── EMSSQLStatementFactoryTests.m │ │ ├── EMSSQLiteHelper+Test.h │ │ ├── EMSSQLiteHelperTests.m │ │ ├── EMSTestColumnInfo.h │ │ ├── EMSTestColumnInfo.m │ │ ├── EMSTestColumnInfoMapper.h │ │ ├── EMSTestColumnInfoMapper.m │ │ └── Triggers │ │ │ └── DbTriggerTests.m │ ├── DennaTests.m │ ├── EMSDefaultWorker+Private.h │ ├── EMSDefaultWorkerTests.m │ ├── EMSDeviceInfoTests.m │ ├── EMSDictionaryValidatorTests.m │ ├── EMSResponseModelTests.m │ ├── Fake │ │ ├── FakeCompletionHandler.h │ │ ├── FakeCompletionHandler.m │ │ ├── FakeConnectionChangeListener.h │ │ ├── FakeConnectionChangeListener.m │ │ ├── FakeConnectionWatchdog.h │ │ ├── FakeConnectionWatchdog.m │ │ ├── FakeDBTrigger.h │ │ ├── FakeDBTrigger.m │ │ ├── FakeFlipperFeature.h │ │ ├── FakeFlipperFeature.m │ │ ├── FakeRESTClientCompletionProxy.h │ │ ├── FakeRESTClientCompletionProxy.m │ │ ├── FakeRequestModelMapper.h │ │ ├── FakeRequestModelMapper.m │ │ ├── FakeSQLSpecification.h │ │ ├── FakeSQLSpecification.m │ │ ├── FakeShardRepository.h │ │ ├── FakeShardRepository.m │ │ ├── FakeTimeStampProvider.h │ │ └── FakeTimeStampProvider.m │ ├── Flipper │ │ ├── MEExperimental+Test.h │ │ └── MEExperimentalTests.m │ ├── Log │ │ ├── EMSLogLevelTests.m │ │ ├── EMSLogMapperTests.m │ │ ├── EMSLoggerTests.m │ │ ├── EMSSdkStateLoggerTests.m │ │ └── LogEntry │ │ │ ├── EMSAppEventLogTests.m │ │ │ ├── EMSCrashLogTests.m │ │ │ ├── EMSInAppLogTests.m │ │ │ ├── EMSMethodNotAllowedTests.m │ │ │ ├── EMSOfflineQueueSizeTests.m │ │ │ ├── EMSRequestLogTests.m │ │ │ └── EMSStatusLogTests.m │ ├── Middlewares │ │ └── EMSCompletionMiddlewareTests.m │ ├── Networking │ │ ├── EMSCoreCompletionHandlerMiddlewareTests.m │ │ ├── EMSCoreCompletionHandlerTests.m │ │ ├── EMSRESTClientCompletionProxyFactoryTests.m │ │ └── EMSRESTClientTests.m │ ├── OfflineTests.m │ ├── OperationQueue │ │ ├── EMSOperationQueueTests.m │ │ └── Proxy │ │ │ ├── EMSDispatchWaiterTests.m │ │ │ └── EMSQueueDelegatorTests.m │ ├── Providers │ │ ├── EMSCompletionBlockProviderTests.m │ │ ├── EMSRandomProviderTest.m │ │ ├── EMSTimestampProviderTests.m │ │ └── EMSUUIDProviderTests.m │ ├── Repository │ │ ├── EMSFilterByNothingSpecificationTests.m │ │ ├── EMSFilterByTypeSpecificationTests.m │ │ ├── EMSFilterByValuesSpecificationTests.m │ │ ├── EMSQueryOldestRowSpecificationTests.m │ │ ├── EMSRequestModelRepositoryTests.m │ │ └── EMSShardRepositoryTests.m │ ├── Request │ │ ├── EMSRequestManagerTests.m │ │ └── EMSRequestModelTests.m │ ├── Router │ │ └── EMSInstanceRouterTests.m │ ├── Schedulers │ │ └── EMSSchedulerTests.m │ ├── Shard │ │ └── EMSShardTests.m │ ├── Store │ │ ├── EMSInMemoryStorageTests.m │ │ └── EMSStorageTests.m │ └── Utils │ │ ├── EMSSession+Tests.h │ │ ├── EMSWaiter.h │ │ ├── EMSWaiter.m │ │ ├── Emarsys+Tests.h │ │ ├── EmarsysTestUtils.h │ │ ├── EmarsysTestUtils.m │ │ ├── TestUtils.h │ │ └── TestUtils.m ├── E2ETests-Bridging-Header.h ├── E2ETests │ ├── EmarsysE2ETests.swift │ ├── EmarsysInboxE2ETests.swift │ └── Info.plist ├── EMSTestPrefixHeader.pch ├── EmarsysSDKTests-Bridging-Header.h ├── EmarsysSDKTests │ ├── AppStart │ │ ├── EMSAppStartBlockProviderTests.m │ │ └── EMSWrapperCheckerTests.m │ ├── Config │ │ ├── EMSRemoteConfigResponseMapperTests.m │ │ └── EmarsysConfigIntegrationTests.m │ ├── DI │ │ └── EMSDependencyInjectionTests.m │ ├── DeepLink │ │ └── EMSDeepLinkInternalTests.m │ ├── EmarsysIntegrationTests.m │ ├── EmarsysTests.m │ ├── Endpoints │ │ └── EMSEndpointTests.m │ ├── EventHandler │ │ ├── EMSEventHandlerProtocolBlockConverterTests.m │ │ └── EMSEventHandlerProtocolImplementationTests.m │ ├── Fake │ │ ├── FakeRequestManager.h │ │ └── FakeRequestManager.m │ ├── FlipperFeatures │ │ └── EMSInnerFeatureTests.m │ ├── Info.plist │ ├── Push │ │ └── EmarsysPushIntegrationTests.m │ ├── RequestTools │ │ └── EMSEmarsysRequestFactoryTests.m │ └── Setup │ │ ├── BuilderTests.m │ │ ├── EMSConfigInternalTests.m │ │ ├── EMSConfigTests.m │ │ └── EMSValueProviderTests.m ├── Info.plist ├── MobileEngageTests-Bridging-Header.h ├── MobileEngageTests.plist ├── MobileEngageTests │ ├── Actions │ │ ├── EMSAppEventActionModelTests.m │ │ ├── EMSCustomEventActionModelTests.m │ │ ├── EMSDismissActionModelTests.m │ │ └── EMSOpenExternalUrlActionModelTests.m │ ├── Category │ │ ├── EMSDeviceInfo+MEClientPayloadTests.m │ │ ├── NSData+MobileEngageTest.m │ │ └── NSDictionary+MobileEngageTests.m │ ├── DeviceInfoClient │ │ ├── EMSDeviceInfoClientV3InternalIntegrationTests.m │ │ └── EMSDeviceInfoV3ClientInternalTests.m │ ├── EMSMobileEngageV3InternalTests.m │ ├── EMSNotificationCenterManagerTests.m │ ├── Fakes │ │ ├── FakeCommand.h │ │ ├── FakeCommand.m │ │ ├── FakeDbHelper.h │ │ ├── FakeDbHelper.m │ │ ├── FakeDisplayedIAMRepository.swift │ │ ├── FakeInAppTracker.h │ │ ├── FakeInAppTracker.m │ │ ├── FakeInboxNotificationRequestManager.h │ │ ├── FakeInboxNotificationRequestManager.m │ │ ├── FakeJSBridge.h │ │ ├── FakeJSBridge.m │ │ ├── FakeNotificationDelegate.h │ │ ├── FakeNotificationDelegate.m │ │ ├── FakeRequestFactory.swift │ │ ├── FakeRequestRepository.h │ │ ├── FakeRequestRepository.m │ │ ├── FakeResponseHandler.h │ │ ├── FakeResponseHandler.m │ │ ├── FakeSpecification.h │ │ └── FakeSpecification.m │ ├── Geofence │ │ ├── EMSGeofenceInternalTests.m │ │ └── EMSGeofenceMapperTests.m │ ├── HandlerTests │ │ ├── AbstractResponseHandlerTests.m │ │ ├── EMSAbstractResponseHandler+Private.h │ │ ├── EMSClientStateResponseHandlerTests.m │ │ ├── EMSContactTokenResponseHandlerTests.m │ │ ├── EMSDeviceEventStateResponseHandlerTests.m │ │ ├── EMSRefreshTokenResponseHandlerTests.m │ │ ├── MEIAMCleanupResponseHandlerV3Tests.m │ │ ├── MEIAMCleanupResponseHandlerV4Tests.m │ │ ├── MEIAMResponseHandlerTests.m │ │ └── OnEventResponseHandlerTests.swift │ ├── IAM │ │ ├── EMSInAppInternalTests.m │ │ ├── EMSInAppProtocolTests.m │ │ ├── EMSInAppTests.m │ │ ├── EMSInlineInAppViewTests.m │ │ ├── MEIAMViewControllerTests.m │ │ ├── MEInAppMessageTests.m │ │ ├── MEInAppTests.m │ │ ├── MEJSBridgeTests.m │ │ └── Providers │ │ │ ├── EMSIAMViewControllerProviderTests.m │ │ │ ├── EMSMainWindowProviderTests.m │ │ │ ├── EMSSceneProviderTests.m │ │ │ ├── EMSViewControllerProviderTests.m │ │ │ └── EMSWindowProviderTests.m │ ├── InboxV3 │ │ ├── EMSInboxResultParserTests.m │ │ ├── EMSInboxV3IntegrationTests.m │ │ └── EMSInboxV3Tests.m │ ├── MEIAMJSCommandTests │ │ ├── MEIAMButtonClickedTests.m │ │ ├── MEIAMCloseTests.m │ │ ├── MEIAMCopyToClipboardTests.m │ │ ├── MEIAMJSCommandFactoryTests.m │ │ ├── MEIAMOpenExternalLinkTests.m │ │ ├── MEIAMRequestPushPermissionTests.m │ │ ├── MEIAMTriggerAppEventTests.m │ │ ├── MEIAMTriggerMEEventTests.m │ │ └── TestCommands │ │ │ ├── MEIAMDidAppear.h │ │ │ └── MEIAMDidAppear.m │ ├── Mappers │ │ ├── EMSContactTokenMapperTests.m │ │ ├── EMSDeviceEventStateRequestMapperTests.m │ │ ├── EMSIdTokenMapperTests.m │ │ └── EMSMobileEngageMapperTests.m │ ├── OnEventAction │ │ └── EMSOnEventActionInternalTests.m │ ├── Parser │ │ └── EMSMobileEngageNullSafeBodyParserTests.m │ ├── Push │ │ ├── Actions │ │ │ ├── EMSActionFactoryTests.m │ │ │ ├── EMSAppEventActionTests.m │ │ │ ├── EMSBadgeCountActionTests.m │ │ │ ├── EMSCustomEventActionTests.m │ │ │ └── EMSOpenExternalEventActionTests.m │ │ └── EMSPushV3InternalTests.m │ ├── Request │ │ ├── EMSCompletionProxyFactoryTests.m │ │ ├── EMSMobileEngageRefreshTokenCompletionProxyTests.m │ │ ├── EMSRequestFactoryTests.m │ │ ├── EMSRequestModelMatcher.h │ │ ├── EMSRequestModelMatcher.m │ │ └── MERequestContextTests.m │ ├── RichNotificationExtension │ │ ├── EMSNotificationServiceExceptionHandlingTests.m │ │ ├── MEDownloaderTests.m │ │ └── MENotificationServiceTests.m │ ├── Session │ │ └── EMSSessionTests.m │ └── Storage │ │ ├── DisplayedIAMTests.m │ │ ├── EMSRequestToolsTests.m │ │ ├── MEButtonClickRepositoryTests.m │ │ ├── MEButtonClickTests.m │ │ ├── MEDisplayedIAMRepositoryTests.m │ │ ├── MERequestModelRepositoryFactoryTests.m │ │ ├── MERequestRepositoryProxyTests.m │ │ └── RequestModelSpecificationTests.m ├── PredictTests-Bridging-Header.h ├── PredictTests │ ├── EMSCartItemUtilsTests.m │ ├── EMSPredictInternalProtocolTests.m │ ├── EMSPredictInternalTests.m │ ├── EMSPredictMapperTests.m │ ├── Info.plist │ ├── Mapper │ │ ├── EMSProductMapperSwiftTests.swift │ │ └── EMSProductMapperTests.m │ ├── Models │ │ └── EMSProductTests.m │ ├── PRERequestContextTests.m │ ├── PredictIntegrationTests.m │ ├── Recommendations │ │ ├── EMSLogicTests.m │ │ └── EMSRecommendationFilterTests.m │ ├── Requests │ │ ├── EMSPredictRequestModelBuilderProviderTests.m │ │ └── EMSPredictRequestModelBuilderTests.m │ └── ResponseHandlers │ │ ├── EMSVisitorIdResponseHandlerTests.m │ │ └── EMSXPResponseHandlerTests.m ├── Tests-Bridging-Header.h ├── XCTestCase+Helper.h └── XCTestCase+Helper.m ├── docs ├── antora.yml └── modules │ └── ROOT │ ├── nav.adoc │ └── pages │ ├── index.adoc │ └── push.adoc ├── private-NSRelease.sh ├── private-release.sh ├── release.sh ├── repo-info.json └── revoke.sh /.github/workflows/build_docs.yml: -------------------------------------------------------------------------------- 1 | name: Build Documentation 2 | 3 | on: 4 | push: 5 | branches: 6 | - dev 7 | paths: 8 | - docs/** 9 | 10 | jobs: 11 | build-docs: 12 | name: Build documentation 13 | uses: emartech/me-workflows/.github/workflows/build-docs.yaml@main 14 | secrets: inherit -------------------------------------------------------------------------------- /.reuse/dep5: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: ios-emarsys-sdk 3 | Upstream-Contact: sdk-team@emarsys.com 4 | Source: https://github.com/emartech/ios-emarsys-sdk 5 | 6 | Files: * 7 | Copyright: 2023 Emarsys 8 | License: MPL-2.0 -------------------------------------------------------------------------------- /Dockerfile.codescan: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | RUN apt-get update 4 | RUN apt-get install -y ruby-full git curl build-essential 5 | RUN gem install cocoapods -v 1.10.0 6 | 7 | WORKDIR /workspace/source 8 | 9 | CMD pod install --allow-root && cat Podfile.lock 10 | -------------------------------------------------------------------------------- /Emarsys Sample/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/.DS_Store -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys Sample/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/Emarsys Sample/.DS_Store -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/1024.png -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/114.png -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/120.png -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/180.png -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/29.png -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/40.png -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/57.png -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/58.png -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/60.png -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/80.png -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/87.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/Emarsys-Sample/Assets.xcassets/AppIcon.appiconset/87.png -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/placeholderImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "placeholderImage.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Assets.xcassets/placeholderImage.imageset/placeholderImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emartech/ios-emarsys-sdk/ddd6392b3d527770f6306c9d11fb332a9306006e/Emarsys Sample/Emarsys-Sample/Assets.xcassets/placeholderImage.imageset/placeholderImage.png -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/ConfigUserDefaultsKey.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | import Foundation 6 | 7 | enum ConfigUserDefaultsKey: String { 8 | case applicationCode = "applicationCode" 9 | case contactFieldId = "contactFieldId" 10 | case merchantId = "merchantId" 11 | } 12 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Emarsys-Sample.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | aps-environment 6 | development 7 | com.apple.developer.applesignin 8 | 9 | Default 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Extensions/ShakeGesture.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | import Foundation 6 | import UIKit 7 | 8 | extension NSNotification.Name { 9 | public static let deviceDidShakeNotification = NSNotification.Name("DeviceDidShakeNotification") 10 | } 11 | 12 | extension UIWindow { 13 | open override func motionEnded(_ motion: UIEvent.EventSubtype, with event: UIEvent?) { 14 | super.motionEnded(motion, with: event) 15 | NotificationCenter.default.post(name: .deviceDidShakeNotification, object: event) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Extensions/UIApplication+Keyboard.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | import UIKit 6 | 7 | extension UIApplication { 8 | func endEditing() { 9 | sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Inbox/MessageManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | import EmarsysSDK 6 | 7 | import Foundation 8 | 9 | protocol MessageManager : ObservableObject { 10 | var messages: [Message] { get } 11 | var messagesPublished: Published<[Message]> { get } 12 | var messagesPublisher: Published<[Message]>.Publisher { get } 13 | 14 | func fetchMessages() 15 | init(messages: [Message]) 16 | } 17 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Models/Message.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | import Foundation 6 | 7 | struct Message: Identifiable { 8 | var id = UUID() 9 | 10 | var title: String = "" 11 | var body: String = "" 12 | var imageUrl: String? = nil 13 | } 14 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Models/Product.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | import Foundation 6 | 7 | struct Product: Identifiable { 8 | var id = UUID() 9 | 10 | var title: String 11 | var feature: String 12 | var imageUrl: URL? = nil 13 | } 14 | 15 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/ViewComponents/SignInWithAppleButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2021. Emarsys. All rights reserved. 3 | // 4 | 5 | import SwiftUI 6 | import AuthenticationServices 7 | 8 | struct SignInWithAppleButton: UIViewRepresentable { 9 | 10 | func makeUIView(context: Context) -> ASAuthorizationAppleIDButton { 11 | return ASAuthorizationAppleIDButton() 12 | } 13 | 14 | func updateUIView(_ uiView: ASAuthorizationAppleIDButton, context: Context) { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-Sample/Wrappers/StoredValue.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | import Foundation 6 | 7 | @propertyWrapper struct StoredValue { 8 | let key: String 9 | var storage: UserDefaults = .standard 10 | 11 | var wrappedValue: Value? { 12 | get { storage.value(forKey: key) as? Value } 13 | set { storage.setValue(newValue, forKey: key) } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-SampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Emarsys Sample/Emarsys-SampleUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Emarsys Sample/NotificationService/NotificationService.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | import UserNotifications 6 | import EmarsysNotificationService 7 | 8 | class NotificationService: EMSNotificationService { 9 | } 10 | -------------------------------------------------------------------------------- /Emarsys Sample/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '11.0' 2 | use_frameworks! 3 | 4 | target "Emarsys-Sample" do 5 | if ENV["DEV"] then 6 | pod 'EmarsysSDK', :path => '../' 7 | else 8 | pod 'EmarsysSDK' 9 | end 10 | end 11 | 12 | target "NotificationService" do 13 | if ENV["DEV"] then 14 | pod 'EmarsysNotificationService', :path => '../' 15 | else 16 | pod 'EmarsysNotificationService' 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /EmarsysSDK.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /EmarsysSDK.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "object": { 3 | "pins": [] 4 | }, 5 | "version": 1 6 | } -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '14.0' 2 | 3 | target "Tests" do 4 | pod 'Kiwi', :git => 'https://github.com/kiwi-bdd/Kiwi.git', :tag => 'v3.0.0' 5 | pod 'OCMock', :git => 'https://github.com/erikdoe/ocmock.git', :tag => 'v3.9.4' 6 | end 7 | 8 | -------------------------------------------------------------------------------- /SdkHost/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SdkHost 4 | // 5 | // Created by Laszlo Ori on 2018. 07. 24.. 6 | // Copyright © 2018. Emarsys. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /SdkHost/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /SdkHost/SdkHost.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | keychain-access-groups 6 | 7 | $(AppIdentifierPrefix)com.emarsys.SdkHost 8 | $(AppIdentifierPrefix)com.emarsys.SdkHostTestGroup 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /SdkHost/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // SdkHost 4 | // 5 | // Created by Laszlo Ori on 2018. 07. 24.. 6 | // Copyright © 2018. Emarsys. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /SdkHost/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // SdkHost 4 | // 5 | // Created by Laszlo Ori on 2018. 07. 24.. 6 | // Copyright © 2018. Emarsys. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /SdkHost/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2018. Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "AppDelegate.h" 7 | 8 | int main(int argc, char * argv[]) { 9 | @autoreleasepool { 10 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Sources/Core/Batch/EMSCountPredicate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import "EMSCountPredicate.h" 5 | 6 | @interface EMSCountPredicate () 7 | 8 | @property(nonatomic, assign) int threshold; 9 | 10 | @end 11 | 12 | @implementation EMSCountPredicate 13 | 14 | - (instancetype)initWithThreshold:(int)threshold { 15 | NSParameterAssert(threshold > 0); 16 | if (self = [super init]) { 17 | _threshold = threshold; 18 | } 19 | return self; 20 | } 21 | 22 | - (BOOL)evaluate:(NSArray *)value { 23 | NSParameterAssert(value); 24 | return [value count] >= self.threshold; 25 | } 26 | 27 | 28 | @end -------------------------------------------------------------------------------- /Sources/Core/Batch/EMSPredicate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import "EMSPredicate.h" 5 | 6 | @implementation EMSPredicate 7 | 8 | - (BOOL)evaluate:(id)value { 9 | NSAssert(NO, @"Abstract method must be implemented!"); 10 | return NO; 11 | } 12 | 13 | @end -------------------------------------------------------------------------------- /Sources/Core/Categories/EMSRequestModel+RequestIds.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2018. Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSRequestModel+RequestIds.h" 6 | #import "EMSCompositeRequestModel.h" 7 | 8 | @implementation EMSRequestModel (RequestIds) 9 | 10 | - (NSArray *)requestIds { 11 | if ([self isKindOfClass:[EMSCompositeRequestModel class]]) { 12 | EMSCompositeRequestModel *compositeModel = (EMSCompositeRequestModel *) self; 13 | NSMutableArray *originalRequestIds = [NSMutableArray array]; 14 | for (EMSRequestModel *emsRequestModel in compositeModel.originalRequests) { 15 | [originalRequestIds addObject:emsRequestModel.requestId]; 16 | } 17 | return [NSArray arrayWithArray:originalRequestIds]; 18 | } 19 | 20 | return @[self.requestId]; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Sources/Core/Categories/EMSResponseModel+EMSCore.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import "EMSResponseModel+EMSCore.h" 5 | 6 | @implementation EMSResponseModel (EMSCore) 7 | 8 | - (BOOL)isSuccess { 9 | return self.statusCode >= 200 && self.statusCode <= 299;; 10 | } 11 | 12 | @end -------------------------------------------------------------------------------- /Sources/Core/Categories/NSError+EMSCore.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "NSError+EMSCore.h" 6 | 7 | @implementation NSError (EMSCore) 8 | 9 | + (NSError *)errorWithCode:(int)errorCode 10 | localizedDescription:(NSString *)localizedDescription { 11 | return [NSError errorWithDomain:@"com.emarsys.emarsys-sdk" 12 | code:errorCode 13 | userInfo:@{ 14 | NSLocalizedDescriptionKey: localizedDescription 15 | }]; 16 | } 17 | 18 | @end -------------------------------------------------------------------------------- /Sources/Core/Categories/NSHTTPURLResponse+EMSCore.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2022 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "NSHTTPURLResponse+EMSCore.h" 6 | 7 | 8 | @implementation NSHTTPURLResponse (EMSCore) 9 | 10 | - (BOOL)isSuccess { 11 | return self.statusCode >= 200 && self.statusCode <= 299; 12 | } 13 | 14 | @end -------------------------------------------------------------------------------- /Sources/Core/Categories/NSMutableDictionary+EMSCore.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "NSMutableDictionary+EMSCore.h" 6 | 7 | 8 | @implementation NSMutableDictionary (EMSCore) 9 | 10 | - (id)takeValueForKey:(NSString *)key { 11 | id value = self[key]; 12 | if ([value isMemberOfClass:[NSNull class]]) { 13 | value = nil; 14 | } 15 | [self removeObjectForKey:key]; 16 | return value; 17 | } 18 | 19 | @end -------------------------------------------------------------------------------- /Sources/Core/Categories/NSOperationQueue+EMSCore.m: -------------------------------------------------------------------------------- 1 | //// 2 | // 3 | // Copyright © 2024 Emarsys-Technologies Kft. All rights reserved. 4 | // 5 | 6 | #import "NSOperationQueue+EMSCore.h" 7 | 8 | @implementation NSOperationQueue (EMSCore) 9 | 10 | - (void)runSynchronized:(EMSRunnerBlock)runnerBlock { 11 | NSOperation *operation = [NSBlockOperation blockOperationWithBlock:runnerBlock]; 12 | [self addOperations:@[operation] 13 | waitUntilFinished:YES]; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Sources/Core/Categories/NSString+EMSCore.m: -------------------------------------------------------------------------------- 1 | //// 2 | // 3 | // Copyright © 2024 Emarsys-Technologies Kft. All rights reserved. 4 | // 5 | 6 | #import "NSString+EMSCore.h" 7 | 8 | @implementation NSString (EMSCore) 9 | 10 | - (NSString *)percentEncode { 11 | NSCharacterSet *allowedCharacters = [[NSCharacterSet characterSetWithCharactersInString:@"\"`;/?:^%#@&=$+{}<>,|\\ !'()*[]"] invertedSet]; 12 | return [self stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacters]; 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Sources/Core/Database/EMSCountMapper.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSCountMapper.h" 6 | 7 | 8 | @implementation EMSCountMapper 9 | 10 | - (id)modelFromStatement:(sqlite3_stmt *)statement { 11 | return @(sqlite3_column_int(statement, 0)); 12 | } 13 | 14 | - (sqlite3_stmt *)bindStatement:(sqlite3_stmt *)statement fromModel:(id)model { 15 | NSAssert(NO, @"NOT IMPLEMENTED"); 16 | return NULL; 17 | } 18 | 19 | - (NSString *)tableName { 20 | return nil; 21 | } 22 | 23 | 24 | - (NSUInteger)fieldCount { 25 | return 1; 26 | } 27 | 28 | @end -------------------------------------------------------------------------------- /Sources/Core/EMSAuthentication.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSAuthentication.h" 6 | 7 | @implementation EMSAuthentication 8 | 9 | + (NSString *)createBasicAuthWithUsername:(NSString *)username { 10 | NSParameterAssert(username); 11 | NSString *credentials = [NSString stringWithFormat:@"%@:", username]; 12 | NSData *credentialsData = [credentials dataUsingEncoding:NSUTF8StringEncoding]; 13 | NSString *base64Credentials = [credentialsData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithCarriageReturn]; 14 | return [NSString stringWithFormat:@"Basic %@", base64Credentials]; 15 | } 16 | 17 | @end -------------------------------------------------------------------------------- /Sources/Core/Flipper/MEExperimental.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "MEExperimental.h" 6 | 7 | 8 | @implementation MEExperimental 9 | static NSMutableSet *_enabledFeatures; 10 | 11 | + (BOOL)isFeatureEnabled:(id )feature { 12 | return [_enabledFeatures containsObject:feature]; 13 | } 14 | 15 | + (void)enableFeature:(id )feature { 16 | if (_enabledFeatures == nil) { 17 | _enabledFeatures = [NSMutableSet new]; 18 | } 19 | [_enabledFeatures addObject:feature]; 20 | } 21 | 22 | + (void)disableFeature:(id )feature { 23 | [_enabledFeatures removeObject:feature]; 24 | } 25 | 26 | + (void)reset { 27 | _enabledFeatures = nil; 28 | } 29 | 30 | @end -------------------------------------------------------------------------------- /Sources/Core/Log/LogEntry/EMSOfflineQueueSize.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import "EMSOfflineQueueSize.h" 5 | 6 | @interface EMSOfflineQueueSize () 7 | 8 | @property(nonatomic, strong) NSDictionary *data; 9 | 10 | @end 11 | 12 | @implementation EMSOfflineQueueSize 13 | 14 | - (instancetype)initWithQueueSize:(NSUInteger)queueSize { 15 | if (self = [super init]) { 16 | NSMutableDictionary *mutableData = [NSMutableDictionary dictionary]; 17 | mutableData[@"offlineQueueSize"] = [NSString stringWithFormat:@"%@", @(queueSize)]; 18 | _data = [NSDictionary dictionaryWithDictionary:mutableData]; 19 | } 20 | return self; 21 | } 22 | 23 | - (NSString *)topic { 24 | return @"log_offline_queue_size"; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Sources/Core/Models/EMSCompositeRequestModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import "EMSCompositeRequestModel.h" 5 | 6 | 7 | @implementation EMSCompositeRequestModel { 8 | 9 | } 10 | @end -------------------------------------------------------------------------------- /Sources/Core/Operation/EMSOperationQueue.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import "EMSOperationQueue.h" 5 | #import "EMSMacros.h" 6 | #import "EMSCrashLog.h" 7 | 8 | @implementation EMSOperationQueue 9 | 10 | - (void)addOperationWithBlock:(void (^)(void))block { 11 | [super addOperationWithBlock:^{ 12 | @try { 13 | block(); 14 | } @catch (NSException *exception) { 15 | EMSLog([[EMSCrashLog alloc] initWithException:exception], LogLevelError); 16 | } 17 | }]; 18 | } 19 | 20 | @end -------------------------------------------------------------------------------- /Sources/Core/Operation/Proxy/EMSDispatchWaiter.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSDispatchWaiter.h" 6 | 7 | @interface EMSDispatchWaiter() 8 | 9 | @property(nonatomic, strong) dispatch_group_t dispatchGroup; 10 | 11 | @end 12 | 13 | @implementation EMSDispatchWaiter 14 | 15 | - (instancetype)init { 16 | if (self = [super init]) { 17 | _dispatchGroup = dispatch_group_create(); 18 | } 19 | return self; 20 | } 21 | 22 | - (void)enter { 23 | dispatch_group_enter(self.dispatchGroup); 24 | } 25 | 26 | - (void)exit { 27 | dispatch_group_leave(self.dispatchGroup); 28 | } 29 | 30 | - (void)waitWithInterval:(int)interval { 31 | dispatch_time_t dispatchTime = interval == 0 ? DISPATCH_TIME_FOREVER : dispatch_time(DISPATCH_TIME_NOW, (interval * NSEC_PER_SEC)); 32 | dispatch_group_wait(self.dispatchGroup, dispatchTime); 33 | } 34 | 35 | @end -------------------------------------------------------------------------------- /Sources/Core/Providers/EMSCompletionProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import "EMSCompletionProvider.h" 5 | 6 | @interface EMSCompletionProvider () 7 | 8 | @property(nonatomic, strong) NSOperationQueue *operationQueue; 9 | 10 | @end 11 | 12 | @implementation EMSCompletionProvider 13 | 14 | - (instancetype)initWithOperationQueue:(NSOperationQueue *)operationQueue { 15 | NSParameterAssert(operationQueue); 16 | 17 | if (self = [super init]) { 18 | _operationQueue = operationQueue; 19 | } 20 | return self; 21 | } 22 | 23 | - (EMSCompletion)provideCompletion:(EMSCompletion)completionBlock { 24 | __weak typeof(self) weakSelf = self; 25 | return ^{ 26 | [weakSelf.operationQueue addOperationWithBlock:completionBlock]; 27 | }; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Sources/Core/Providers/EMSRandomProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSRandomProvider.h" 6 | 7 | @implementation EMSRandomProvider { 8 | 9 | } 10 | 11 | - (NSNumber *)provideDoubleUntil:(NSNumber *)until { 12 | return @((double) arc4random() / UINT32_MAX * [until doubleValue]); 13 | } 14 | 15 | @end -------------------------------------------------------------------------------- /Sources/Core/Providers/EMSTimestampProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSTimestampProvider.h" 6 | 7 | @implementation EMSTimestampProvider 8 | 9 | - (NSDate *)provideTimestamp { 10 | return [NSDate date]; 11 | } 12 | 13 | @end -------------------------------------------------------------------------------- /Sources/Core/Providers/EMSUUIDProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import "EMSUUIDProvider.h" 5 | 6 | @implementation EMSUUIDProvider 7 | 8 | - (NSString *)provideUUIDString { 9 | return [[NSUUID UUID] UUIDString]; 10 | } 11 | 12 | @end -------------------------------------------------------------------------------- /Sources/Core/Repository/Specifications/EMSFilterByNothingSpecification.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import "EMSFilterByNothingSpecification.h" 5 | 6 | @implementation EMSFilterByNothingSpecification 7 | 8 | - (BOOL)isEqual:(id)other { 9 | if (other == self) 10 | return YES; 11 | if (!other || ![[other class] isEqual:[self class]]) 12 | return NO; 13 | 14 | return [self isEqualToSpecification:other]; 15 | } 16 | 17 | - (BOOL)isEqualToSpecification:(EMSFilterByNothingSpecification *)specification { 18 | if (self == specification) 19 | return YES; 20 | if (specification == nil) 21 | return NO; 22 | return YES; 23 | } 24 | 25 | - (NSUInteger)hash { 26 | return [super hash]; 27 | } 28 | 29 | 30 | @end -------------------------------------------------------------------------------- /Sources/Core/Repository/Specifications/EMSQueryOldestRowSpecification.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import "EMSQueryOldestRowSpecification.h" 5 | 6 | @implementation EMSQueryOldestRowSpecification 7 | 8 | - (NSString *)orderBy { 9 | return @"ROWID ASC"; 10 | } 11 | 12 | - (NSString *)limit { 13 | return @"1"; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Sources/Core/ResponseHandlers/EMSAbstractResponseHandler.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSAbstractResponseHandler.h" 6 | 7 | @implementation EMSAbstractResponseHandler 8 | 9 | - (void)processResponse:(EMSResponseModel *)response { 10 | if ([self shouldHandleResponse:response]) { 11 | [self handleResponse:response]; 12 | } 13 | } 14 | 15 | - (BOOL)shouldHandleResponse:(EMSResponseModel *)response { 16 | NSAssert(NO, @"implement me please"); 17 | return NO; 18 | } 19 | 20 | - (void)handleResponse:(EMSResponseModel *)response { 21 | NSAssert(NO, @"implement me please"); 22 | } 23 | 24 | @end -------------------------------------------------------------------------------- /Sources/Core/Schedulers/EMSAgenda.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import "EMSAgenda.h" 5 | 6 | @implementation EMSAgenda 7 | 8 | - (instancetype)initWithTag:(NSString *)tag 9 | delay:(NSTimeInterval)delay 10 | interval:(NSNumber *)interval 11 | dispatchTimer:(dispatch_source_t)dispatchTimer 12 | triggerBlock:(EMSTriggerBlock)triggerBlock { 13 | if (self = [super init]) { 14 | _tag = tag; 15 | _delay = delay; 16 | _interval = interval; 17 | _dispatchTimer = dispatchTimer; 18 | _triggerBlock = triggerBlock; 19 | } 20 | return self; 21 | } 22 | 23 | @end -------------------------------------------------------------------------------- /Sources/EmarsysSDK/EventHandler/EMSEventHandlerProtocolBlockConverter.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSEventHandlerProtocolBlockConverter.h" 6 | 7 | @implementation EMSEventHandlerProtocolBlockConverter 8 | 9 | - (instancetype)init { 10 | if (self = [super init]) { 11 | _eventHandler = [EMSEventHandlerProtocolImplementation new]; 12 | } 13 | return self; 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Sources/EmarsysSDK/EventHandler/EMSEventHandlerProtocolImplementation.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSEventHandlerProtocolImplementation.h" 6 | 7 | @implementation EMSEventHandlerProtocolImplementation 8 | 9 | - (void)handleEvent:(NSString *)eventName 10 | payload:(NSDictionary *)payload { 11 | if (self.handlerBlock) { 12 | dispatch_async(dispatch_get_main_queue(), ^{ 13 | self.handlerBlock(eventName, payload); 14 | }); 15 | } 16 | } 17 | 18 | @end -------------------------------------------------------------------------------- /Sources/EmarsysSDK/Setup/EMSConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSConfig.h" 6 | 7 | @implementation EMSConfig 8 | 9 | + (nonnull EMSConfig *)makeWithBuilder:(MEConfigBuilderBlock)builderBlock { 10 | NSParameterAssert(builderBlock); 11 | EMSConfigBuilder *builder = [EMSConfigBuilder new]; 12 | builderBlock(builder); 13 | 14 | return [[EMSConfig alloc] initWithBuilder:builder]; 15 | } 16 | 17 | - (id)initWithBuilder:(EMSConfigBuilder *)builder { 18 | if (self = [super init]) { 19 | _applicationCode = builder.applicationCode; 20 | _experimentalFeatures = builder.experimentalFeatures; 21 | _enabledConsoleLogLevels = builder.enabledConsoleLogLevels; 22 | _merchantId = builder.merchantId; 23 | _sharedKeychainAccessGroup = builder.sharedKeychainAccessGroup; 24 | } 25 | return self; 26 | } 27 | 28 | @end -------------------------------------------------------------------------------- /Sources/MobileEngage/Category/EMSDeviceInfo+MEClientPayload.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import "EMSDeviceInfo+MEClientPayload.h" 5 | 6 | @implementation EMSDeviceInfo (MEClientPayload) 7 | 8 | - (NSDictionary *)clientPayload { 9 | return @{ 10 | @"platform": self.platform, 11 | @"applicationVersion": self.applicationVersion, 12 | @"deviceModel": self.deviceModel, 13 | @"osVersion": self.osVersion, 14 | @"sdkVersion": self.sdkVersion, 15 | @"language": self.languageCode, 16 | @"timezone": self.timeZone, 17 | @"pushSettings": self.pushSettings 18 | }; 19 | } 20 | 21 | @end -------------------------------------------------------------------------------- /Sources/MobileEngage/Category/NSData+MobileEngine.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "NSData+MobileEngine.h" 6 | 7 | 8 | @implementation NSData (MobileEngine) 9 | 10 | - (NSString *)deviceTokenString { 11 | NSMutableString *token = [NSMutableString new]; 12 | const char *data = [self bytes]; 13 | for (int i = 0; i < self.length; ++i) { 14 | [token appendFormat:@"%02.2hhx", data[i]]; 15 | } 16 | return token; 17 | } 18 | 19 | @end -------------------------------------------------------------------------------- /Sources/MobileEngage/IAM/JSCommands/MEIAMClose.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "MEIAMClose.h" 6 | #import "MEIAMProtocol.h" 7 | 8 | @interface MEIAMClose () 9 | 10 | @property(weak, nonatomic) id closeProtocol; 11 | 12 | @end 13 | 14 | @implementation MEIAMClose 15 | 16 | + (NSString *)commandName { 17 | return @"close"; 18 | } 19 | 20 | - (instancetype)initWithEMSIAMCloseProtocol:(id )closeProtocol { 21 | if (self = [super init]) { 22 | _closeProtocol = closeProtocol; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)handleMessage:(NSDictionary *)message 28 | resultBlock:(MEIAMJSResultBlock)resultBlock { 29 | [self.closeProtocol closeInAppWithCompletionHandler:nil]; 30 | } 31 | 32 | @end -------------------------------------------------------------------------------- /Sources/MobileEngage/IAM/Providers/EMSIAMViewControllerProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import "EMSIAMViewControllerProvider.h" 5 | #import "MEJSBridge.h" 6 | #import "MEIAMViewController.h" 7 | 8 | @interface EMSIAMViewControllerProvider () 9 | 10 | @property(nonatomic, strong) MEJSBridge *jsBridge; 11 | 12 | @end 13 | 14 | @implementation EMSIAMViewControllerProvider 15 | 16 | - (instancetype)initWithJSBridge:(MEJSBridge *)jsBridge { 17 | NSParameterAssert(jsBridge); 18 | if (self = [super init]) { 19 | _jsBridge = jsBridge; 20 | } 21 | return self; 22 | } 23 | 24 | - (MEIAMViewController *)provideViewController { 25 | return [[MEIAMViewController alloc] initWithJSBridge:self.jsBridge]; 26 | } 27 | 28 | 29 | @end -------------------------------------------------------------------------------- /Sources/MobileEngage/IAM/Providers/EMSMainWindowProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import "EMSMainWindowProvider.h" 5 | 6 | @interface EMSMainWindowProvider () 7 | 8 | @property(nonatomic, strong) UIApplication *application; 9 | 10 | @end 11 | 12 | @implementation EMSMainWindowProvider 13 | 14 | - (instancetype)initWithApplication:(UIApplication *)application { 15 | NSParameterAssert(application); 16 | if (self = [super init]) { 17 | _application = application; 18 | } 19 | return self; 20 | } 21 | 22 | - (UIWindow *)provideMainWindow { 23 | return [[_application delegate] window]; 24 | } 25 | 26 | 27 | @end -------------------------------------------------------------------------------- /Sources/MobileEngage/IAM/Providers/EMSViewControllerProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSViewControllerProvider.h" 6 | 7 | 8 | @implementation EMSViewControllerProvider 9 | 10 | - (UIViewController *)provideViewController { 11 | UIViewController *viewController = [UIViewController new]; 12 | viewController.view.backgroundColor = [UIColor clearColor]; 13 | return viewController; 14 | } 15 | 16 | @end -------------------------------------------------------------------------------- /Sources/MobileEngage/InboxV3/EMSInboxResult.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSInboxResult.h" 6 | 7 | @implementation EMSInboxResult 8 | 9 | - (BOOL)isEqual:(id)other { 10 | if (other == self) 11 | return YES; 12 | if (!other || ![[other class] isEqual:[self class]]) 13 | return NO; 14 | 15 | return [self isEqualToResult:other]; 16 | } 17 | 18 | - (BOOL)isEqualToResult:(EMSInboxResult *)result { 19 | if (self == result) 20 | return YES; 21 | if (result == nil) 22 | return NO; 23 | if (self.messages != result.messages && ![self.messages isEqualToArray:result.messages]) 24 | return NO; 25 | return YES; 26 | } 27 | 28 | - (NSUInteger)hash { 29 | return [self.messages hash]; 30 | } 31 | 32 | @end -------------------------------------------------------------------------------- /Sources/MobileEngage/OnEventAction/EMSOnEventActionInternal.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSOnEventActionInternal.h" 6 | 7 | @interface EMSOnEventActionInternal() 8 | 9 | @property(nonatomic, strong) EMSActionFactory *actionFactory; 10 | 11 | @end 12 | 13 | @implementation EMSOnEventActionInternal 14 | 15 | @synthesize eventHandler = _eventHandler; 16 | 17 | - (instancetype)initWithActionFactory:(EMSActionFactory *)actionFactory { 18 | if (self = [super init]) { 19 | _actionFactory = actionFactory; 20 | } 21 | return self; 22 | } 23 | 24 | - (void)setEventHandler:(EMSEventHandlerBlock)eventHandler { 25 | _eventHandler = eventHandler; 26 | self.actionFactory.eventHandler = eventHandler; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Sources/MobileEngage/RequestTools/MEDefaultHeaders.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSAuthentication.h" 6 | #import "MEDefaultHeaders.h" 7 | #import "EmarsysSDKVersion.h" 8 | 9 | @implementation MEDefaultHeaders 10 | 11 | + (NSDictionary *)additionalHeaders { 12 | return @{@"Content-Type": @"application/json", 13 | @"X-EMARSYS-SDK-VERSION": EMARSYS_SDK_VERSION, 14 | #if DEBUG 15 | @"X-EMARSYS-SDK-MODE": @"debug" 16 | #else 17 | @"X-EMARSYS-SDK-MODE" : @"production" 18 | #endif 19 | }; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Sources/MobileEngage/Session/EMSSessionIdHolder.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSSessionIdHolder.h" 6 | 7 | @implementation EMSSessionIdHolder 8 | 9 | @end -------------------------------------------------------------------------------- /Sources/MobileEngage/Storage/MERequestTools.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "MERequestTools.h" 6 | #import "EMSRequestModel.h" 7 | 8 | 9 | @implementation MERequestTools 10 | 11 | + (BOOL)isRequestCustomEvent:(EMSRequestModel *)request { 12 | NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"https://mobile-events\\.eservice\\.emarsys\\.net/(.+)/events$" 13 | options:NSRegularExpressionCaseInsensitive 14 | error:nil]; 15 | NSString *url = [request.url absoluteString]; 16 | return url && [regex numberOfMatchesInString:url options:0 range:NSMakeRange(0, [url length])] > 0; 17 | } 18 | 19 | @end -------------------------------------------------------------------------------- /Sources/Predict/Models/EMSCartItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSCartItem.h" 6 | 7 | 8 | @implementation EMSCartItem { 9 | 10 | } 11 | 12 | - (instancetype)initWithItemId:(NSString *)itemId price:(double)price quantity:(double)quantity { 13 | self = [super init]; 14 | if (self) { 15 | self.itemId = itemId; 16 | self.price = price; 17 | self.quantity = quantity; 18 | } 19 | 20 | return self; 21 | } 22 | 23 | + (instancetype)itemWithItemId:(NSString *)itemId price:(double)price quantity:(double)quantity { 24 | return [[self alloc] initWithItemId:itemId price:price quantity:quantity]; 25 | } 26 | 27 | 28 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSAbstractResponseHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSResponseModel.h" 7 | 8 | @interface EMSAbstractResponseHandler : NSObject 9 | 10 | - (void)processResponse:(EMSResponseModel *)response; 11 | 12 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSActionProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @protocol EMSActionProtocol 8 | 9 | - (void)execute; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSAgenda.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSTrigger.h" 6 | 7 | @interface EMSAgenda : NSObject 8 | 9 | @property(nonatomic, strong) NSString *tag; 10 | @property(nonatomic, assign) NSTimeInterval delay; 11 | @property(nonatomic, strong) NSNumber *interval; 12 | @property(nonatomic, strong) EMSTriggerBlock triggerBlock; 13 | @property(nonatomic, assign) dispatch_source_t dispatchTimer; 14 | 15 | - (instancetype)initWithTag:(NSString *)tag 16 | delay:(NSTimeInterval)delay 17 | interval:(NSNumber *)interval 18 | dispatchTimer:(dispatch_source_t)dispatchTimer 19 | triggerBlock:(EMSTriggerBlock)triggerBlock; 20 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSAppEventAction.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSActionProtocol.h" 7 | #import "EMSBlocks.h" 8 | 9 | 10 | @interface EMSAppEventAction : NSObject 11 | 12 | @property(nonatomic, strong) EMSEventHandlerBlock eventHandler; 13 | 14 | - (instancetype)init NS_UNAVAILABLE; 15 | 16 | - (instancetype)initWithActionDictionary:(NSDictionary *)action 17 | eventHandler:(EMSEventHandlerBlock)eventHandler; 18 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSAppEventLog.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSLogEntryProtocol.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface EMSAppEventLog : NSObject 10 | 11 | - (instancetype)initWithEventName:(NSString *)eventName 12 | attributes:(nullable NSDictionary *)attributes; 13 | 14 | @end 15 | 16 | NS_ASSUME_NONNULL_END 17 | -------------------------------------------------------------------------------- /Sources/Private/EMSAuthentication.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface EMSAuthentication : NSObject 10 | 11 | + (NSString *)createBasicAuthWithUsername:(NSString *)username; 12 | @end 13 | 14 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/Private/EMSBadgeCountAction.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSActionProtocol.h" 7 | #import 8 | 9 | @class UNUserNotificationCenter; 10 | 11 | @interface EMSBadgeCountAction : NSObject 12 | 13 | - (instancetype)init NS_UNAVAILABLE; 14 | 15 | - (instancetype)initWithActionDictionary:(NSDictionary *)action 16 | application:(UIApplication *)application 17 | userNotificationCenter:(UNUserNotificationCenter *)userNotificationCenter 18 | operationQueue:(NSOperationQueue *)operationQueue; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Sources/Private/EMSCartItemUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSCartItemProtocol.h" 7 | 8 | @interface EMSCartItemUtils : NSObject 9 | 10 | + (NSString *)queryParamFromCartItems:(NSArray> *)cartItems; 11 | 12 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSClientStateResponseHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSAbstractResponseHandler.h" 6 | #import "MERequestContext.h" 7 | 8 | @class EMSEndpoint; 9 | 10 | static NSString *const CLIENT_STATE = @"X-Client-State"; 11 | 12 | @interface EMSClientStateResponseHandler : EMSAbstractResponseHandler 13 | 14 | @property(nonatomic, readonly) MERequestContext *requestContext; 15 | @property(nonatomic, readonly) EMSEndpoint *endpoint; 16 | 17 | - (instancetype)initWithRequestContext:(MERequestContext *)requestContext 18 | endpoint:(EMSEndpoint *)endpoint; 19 | 20 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSCommonSQLSpecification.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSSQLSpecificationProtocol.h" 6 | 7 | @interface EMSCommonSQLSpecification : NSObject 8 | 9 | - (NSString *)generateInStatementWithArgs:(NSArray *)args; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSCompletionBlockProvider.h: -------------------------------------------------------------------------------- 1 | //// 2 | // 3 | // Copyright © 2024 Emarsys-Technologies Kft. All rights reserved. 4 | // 5 | 6 | #import 7 | #import "EMSBlocks.h" 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | @interface EMSCompletionBlockProvider: NSObject 12 | 13 | - (instancetype)initWithOperationQueue:(NSOperationQueue *)operationQueue; 14 | 15 | - (EMSCompletionBlock)provideCompletionBlock:(EMSCompletionBlock)completionBlock; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END 20 | -------------------------------------------------------------------------------- /Sources/Private/EMSCompletionMiddleware.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSCoreCompletion.h" 6 | #import "EMSBlocks.h" 7 | #import "EMSRequestModel.h" 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | @interface EMSCompletionMiddleware : NSObject 12 | 13 | @property(nonatomic, readonly) CoreSuccessBlock successBlock; 14 | @property(nonatomic, readonly) CoreErrorBlock errorBlock; 15 | 16 | - (instancetype)initWithSuccessBlock:(CoreSuccessBlock)successBlock 17 | errorBlock:(CoreErrorBlock)errorBlock; 18 | 19 | - (void)registerCompletionBlock:(EMSCompletionBlock)completionBlock 20 | forRequestModel:(EMSRequestModel *)requestModel; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/Private/EMSCompletionProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSBlocks.h" 6 | 7 | @interface EMSCompletionProvider : NSObject 8 | 9 | - (instancetype)initWithOperationQueue:(NSOperationQueue *)operationQueue; 10 | 11 | - (EMSCompletion)provideCompletion:(EMSCompletion)completionBlock; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Private/EMSCompositeRequestModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSRequestModel.h" 6 | 7 | 8 | @interface EMSCompositeRequestModel : EMSRequestModel 9 | 10 | @property(nonatomic, strong) NSArray *originalRequests; 11 | 12 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSConnectionWatchdog.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | typedef enum : NSInteger { 7 | NotReachable = 0, 8 | ReachableViaWiFi, 9 | ReachableViaWWAN, 10 | ReachableViaWire, 11 | ReachableViaLoopback, 12 | ReachableViaOther 13 | } EMSNetworkStatus; 14 | 15 | @protocol EMSConnectionChangeListener 16 | 17 | - (void)connectionChangedToNetworkStatus:(EMSNetworkStatus)networkStatus 18 | connectionStatus:(BOOL)connected; 19 | 20 | @end 21 | 22 | @interface EMSConnectionWatchdog : NSObject 23 | 24 | @property(nonatomic, weak) id connectionChangeListener; 25 | 26 | - (instancetype)initWithOperationQueue:(NSOperationQueue *)operationQueue; 27 | 28 | - (EMSNetworkStatus)connectionState; 29 | 30 | - (BOOL)isConnected; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Sources/Private/EMSContactTokenMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSRequestModelMapperProtocol.h" 6 | 7 | @class MERequestContext; 8 | @class EMSEndpoint; 9 | 10 | @interface EMSContactTokenMapper : NSObject 11 | 12 | @property(nonatomic, readonly) MERequestContext *requestContext; 13 | @property(nonatomic, readonly) EMSEndpoint *endpoint; 14 | 15 | - (instancetype)initWithRequestContext:(MERequestContext *)requestContext 16 | endpoint:(EMSEndpoint *)endpoint; 17 | 18 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSContactTokenResponseHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSAbstractResponseHandler.h" 7 | 8 | @class MERequestContext; 9 | @class EMSEndpoint; 10 | 11 | @interface EMSContactTokenResponseHandler : EMSAbstractResponseHandler 12 | 13 | @property(nonatomic, readonly) MERequestContext *requestContext; 14 | @property(nonatomic, readonly) EMSEndpoint *endpoint; 15 | 16 | - (instancetype)initWithRequestContext:(MERequestContext *)requestContext 17 | endpoint:(EMSEndpoint *)endpoint; 18 | 19 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSCoreCompletion.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSResponseModel; 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | typedef void (^CoreErrorBlock)(NSString *requestId, NSError *error); 12 | 13 | typedef void (^CoreSuccessBlock)(NSString *requestId, EMSResponseModel *response); 14 | 15 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/Private/EMSCoreCompletionHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSCoreCompletion.h" 6 | #import "EMSRESTClientCompletionProxyProtocol.h" 7 | 8 | @interface EMSCoreCompletionHandler : NSObject 9 | 10 | @property(nonatomic, readonly) CoreSuccessBlock successBlock; 11 | @property(nonatomic, readonly) CoreErrorBlock errorBlock; 12 | 13 | - (instancetype)initWithSuccessBlock:(CoreSuccessBlock)successBlock 14 | errorBlock:(CoreErrorBlock)errorBlock; 15 | 16 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSCountMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSModelMapperProtocol.h" 7 | 8 | 9 | @interface EMSCountMapper : NSObject 10 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSCountPredicate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSPredicate.h" 6 | 7 | @interface EMSCountPredicate : EMSPredicate 8 | 9 | - (instancetype)initWithThreshold:(int)threshold; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSCrashLog.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSLogEntryProtocol.h" 6 | 7 | @interface EMSCrashLog : NSObject 8 | 9 | - (instancetype)initWithException:(NSException *)exception; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSCrypto.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @interface EMSCrypto : NSObject 8 | 9 | - (BOOL)verifyContent:(NSData *)content 10 | withSignature:(NSData *)signature; 11 | 12 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSCustomEventAction.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSActionProtocol.h" 7 | 8 | @protocol EMSMobileEngageProtocol; 9 | 10 | 11 | @interface EMSCustomEventAction : NSObject 12 | 13 | - (instancetype)init NS_UNAVAILABLE; 14 | 15 | -(instancetype) initWithAction:(NSDictionary *)action 16 | mobileEngage:(id)mobileEngage; 17 | 18 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSDBTrigger.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSTrigger.h" 6 | 7 | @interface EMSDBTriggerType : NSObject 8 | 9 | + (EMSDBTriggerType *)beforeType; 10 | 11 | + (EMSDBTriggerType *)afterType; 12 | 13 | - (BOOL)isEqual:(id)other; 14 | 15 | - (BOOL)isEqualToType:(EMSDBTriggerType *)type; 16 | 17 | - (NSUInteger)hash; 18 | 19 | - (NSString *)description; 20 | 21 | @end 22 | 23 | 24 | @interface EMSDBTriggerEvent : NSObject 25 | 26 | + (EMSDBTriggerEvent *)insertEvent; 27 | 28 | + (EMSDBTriggerEvent *)deleteEvent; 29 | 30 | - (NSString *)eventName; 31 | 32 | - (BOOL)isEqual:(id)other; 33 | 34 | - (BOOL)isEqualToEvent:(EMSDBTriggerEvent *)event; 35 | 36 | - (NSUInteger)hash; 37 | 38 | - (NSString *)description; 39 | 40 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSDBTriggerKey.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSDBTrigger.h" 7 | 8 | @interface EMSDBTriggerKey : NSObject 9 | @property(nonatomic, readonly) NSString *tableName; 10 | @property(nonatomic, readonly) EMSDBTriggerEvent *triggerEvent; 11 | @property(nonatomic, readonly) EMSDBTriggerType *triggerType; 12 | 13 | - (instancetype)initWithTableName:(NSString *)tableName 14 | withEvent:(EMSDBTriggerEvent *)triggerEvent 15 | withType:(EMSDBTriggerType *)triggerType; 16 | 17 | - (BOOL)isEqual:(id)other; 18 | 19 | - (BOOL)isEqualToKey:(EMSDBTriggerKey *)key; 20 | 21 | - (NSUInteger)hash; 22 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSDBTriggerProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @protocol EMSDBTriggerProtocol 7 | 8 | - (void)trigger; 9 | 10 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSDeepLinkInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSDeepLinkProtocol.h" 6 | 7 | @class EMSRequestFactory; 8 | @class EMSRequestManager; 9 | 10 | @interface EMSDeepLinkInternal : NSObject 11 | 12 | - (instancetype)initWithRequestManager:(EMSRequestManager *)requestManager 13 | requestFactory:(EMSRequestFactory *)requestFactory; 14 | 15 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSDeepLinkProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSBlocks.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @protocol EMSDeepLinkProtocol 10 | 11 | - (BOOL)trackDeepLinkWith:(NSUserActivity *)userActivity 12 | sourceHandler:(_Nullable EMSSourceHandler)sourceHandler; 13 | 14 | - (BOOL)trackDeepLinkWith:(NSUserActivity *)userActivity 15 | sourceHandler:(_Nullable EMSSourceHandler)sourceHandler 16 | withCompletionBlock:(_Nullable EMSCompletionBlock)completionBlock; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /Sources/Private/EMSDependencyContainer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSConfig.h" 6 | #import "EMSDependencyContainerProtocol.h" 7 | 8 | @class EMSTimestampProvider; 9 | @class EMSResponseModel; 10 | 11 | @interface EMSDependencyContainer : NSObject 12 | 13 | - (instancetype)initWithConfig:(EMSConfig *)config; 14 | 15 | - (void (^)(NSString *, EMSResponseModel *))createSuccessBlock; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Sources/Private/EMSDependencyInjection.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSDependencyContainer.h" 6 | 7 | @interface EMSDependencyInjection : NSObject 8 | 9 | @property(class, nonatomic, readonly) id dependencyContainer; 10 | 11 | + (void)setupWithDependencyContainer:(id )dependencyContainer; 12 | 13 | + (void)tearDown; 14 | 15 | + (id )mobileEngage; 16 | 17 | + (id )push; 18 | 19 | + (id )deepLink; 20 | 21 | + (id )iam; 22 | 23 | + (id )predict; 24 | 25 | + (id )geofence; 26 | 27 | + (id )messageInbox; 28 | 29 | + (id )onEventAction; 30 | 31 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSDeviceEventStateRequestMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2022 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSRequestModelMapperProtocol.h" 7 | 8 | #define kDeviceEventStateKey @"DEVICE_EVENT_STATE_KEY" 9 | 10 | @class EMSEndpoint; 11 | @protocol EMSStorageProtocol; 12 | 13 | @interface EMSDeviceEventStateRequestMapper: NSObject 14 | 15 | @property(nonatomic, readonly) EMSEndpoint *endpoint; 16 | @property(nonatomic, readonly) id storage; 17 | 18 | - (instancetype)initWithEndpoint:(EMSEndpoint *)endpoint 19 | storage:(id )storage; 20 | 21 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSDeviceEventStateResponseHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSAbstractResponseHandler.h" 7 | 8 | #define kDeviceEventStateKey @"DEVICE_EVENT_STATE_KEY" 9 | 10 | @protocol EMSStorageProtocol; 11 | @class EMSEndpoint; 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface EMSDeviceEventStateResponseHandler : EMSAbstractResponseHandler 16 | 17 | - (instancetype)initWithStorage:(id)storage 18 | endpoint:(EMSEndpoint *)endpoint; 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END 23 | -------------------------------------------------------------------------------- /Sources/Private/EMSDeviceInfo+MEClientPayload.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSDeviceInfo.h" 6 | 7 | @interface EMSDeviceInfo (MEClientPayload) 8 | 9 | - (NSDictionary *)clientPayload; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSDeviceInfoClientProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSBlocks.h" 6 | 7 | @protocol EMSDeviceInfoClientProtocol 8 | 9 | - (void)trackDeviceInfoWithCompletionBlock:(EMSCompletionBlock)completionBlock; 10 | 11 | - (void)sendDeviceInfoWithCompletionBlock:(EMSCompletionBlock)completionBlock; 12 | 13 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSDeviceInfoV3ClientInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSDeviceInfoClientProtocol.h" 6 | 7 | @class EMSRequestManager; 8 | @class EMSRequestFactory; 9 | @class EMSDeviceInfo; 10 | @class MERequestContext; 11 | 12 | #define kDEVICE_INFO @"kDEVICE_INFO" 13 | 14 | @interface EMSDeviceInfoV3ClientInternal : NSObject 15 | 16 | - (instancetype)initWithRequestManager:(EMSRequestManager *)requestManager 17 | requestFactory:(EMSRequestFactory *)requestFactory 18 | deviceInfo:(EMSDeviceInfo *)deviceInfo 19 | requestContext:(MERequestContext *)requestContext; 20 | 21 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSDictionaryValidator.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @interface EMSDictionaryValidator : NSObject 8 | 9 | @property(nonatomic, readonly) NSDictionary *dictionary; 10 | 11 | - (instancetype)initWithDictionary:(NSDictionary *)dictionary; 12 | 13 | - (void)valueExistsForKey:(id)key withType:(Class)type; 14 | 15 | - (NSArray *)failureReasons; 16 | 17 | @end 18 | 19 | 20 | typedef void (^ValidatorBlock)(EMSDictionaryValidator *validate); 21 | 22 | @interface NSDictionary (Validator) 23 | 24 | - (NSArray *)validate:(ValidatorBlock)validator; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Sources/Private/EMSDispatchWaiter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @interface EMSDispatchWaiter : NSObject 8 | 9 | - (void)enter; 10 | - (void)exit; 11 | - (void)waitWithInterval:(int)interval; 12 | 13 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSEmarsysRequestFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @class EMSTimestampProvider; 7 | @class EMSUUIDProvider; 8 | @class EMSRequestModel; 9 | @class EMSEndpoint; 10 | @class MERequestContext; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface EMSEmarsysRequestFactory : NSObject 15 | 16 | - (instancetype)initWithTimestampProvider:(EMSTimestampProvider *)timestampProvider 17 | uuidProvider:(EMSUUIDProvider *)uuidProvider 18 | endpoint:(EMSEndpoint *)endpoint 19 | requestContext:(MERequestContext *)requestContext; 20 | 21 | - (EMSRequestModel * _Nullable)createRemoteConfigRequestModel; 22 | - (EMSRequestModel * _Nullable)createRemoteConfigSignatureRequestModel; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /Sources/Private/EMSEventHandlerProtocolBlockConverter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSIAMAppEventProtocol.h" 7 | #import "EMSEventHandlerProtocolImplementation.h" 8 | 9 | @interface EMSEventHandlerProtocolBlockConverter: NSObject 10 | 11 | @property(nonatomic, strong) EMSEventHandlerProtocolImplementation *eventHandler; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Private/EMSEventHandlerProtocolImplementation.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSBlocks.h" 7 | 8 | @interface EMSEventHandlerProtocolImplementation: NSObject 9 | 10 | @property(nonatomic, strong) EMSEventHandlerBlock handlerBlock; 11 | 12 | - (void)handleEvent:(NSString *)eventName 13 | payload:(NSDictionary *)payload; 14 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSFilterByNothingSpecification.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSSQLSpecificationProtocol.h" 6 | #import "EMSCommonSQLSpecification.h" 7 | 8 | @interface EMSFilterByNothingSpecification : EMSCommonSQLSpecification 9 | 10 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSFilterByTypeSpecification.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2018. Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSCommonSQLSpecification.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface EMSFilterByTypeSpecification : EMSCommonSQLSpecification 10 | 11 | - (instancetype)initWitType:(NSString *)type 12 | column:(NSString *)column; 13 | 14 | @end 15 | 16 | NS_ASSUME_NONNULL_END 17 | -------------------------------------------------------------------------------- /Sources/Private/EMSFilterByValuesSpecification.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2018. Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSCommonSQLSpecification.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface EMSFilterByValuesSpecification : EMSCommonSQLSpecification 10 | 11 | - (instancetype)initWithValues:(NSArray *)values 12 | column:(NSString *)column; 13 | 14 | @end 15 | 16 | NS_ASSUME_NONNULL_END 17 | -------------------------------------------------------------------------------- /Sources/Private/EMSGeofenceGroup.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSGeofence; 8 | 9 | @interface EMSGeofenceGroup : NSObject 10 | 11 | @property(nonatomic, strong) NSString *id; 12 | @property(nonatomic, assign) double waitInterval; 13 | @property(nonatomic, strong) NSArray *geofences; 14 | 15 | - (instancetype)initWithId:(NSString *)id 16 | waitInterval:(double)waitInterval 17 | geofences:(NSArray *)geofences; 18 | 19 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSGeofenceResponse.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSGeofenceGroup; 8 | 9 | @interface EMSGeofenceResponse : NSObject 10 | 11 | @property(nonatomic, strong) NSArray *groups; 12 | @property(nonatomic, assign) double refreshRadiusRatio; 13 | 14 | - (instancetype)initWithGroups:(NSArray *)groups 15 | refreshRadiusRatio:(double)refreshRadiusRatio; 16 | 17 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSGeofenceResponseMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSResponseModel; 8 | @class EMSGeofenceResponse; 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface EMSGeofenceResponseMapper : NSObject 13 | 14 | - (nullable EMSGeofenceResponse *)mapFromResponseModel:(EMSResponseModel *)responseModel; 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/Private/EMSIAMAppEventProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSBlocks.h" 7 | 8 | @protocol EMSIAMAppEventProtocol 9 | - (_Nullable EMSEventHandlerBlock)eventHandler; 10 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSIAMCloseProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSBlocks.h" 7 | 8 | @protocol EMSIAMCloseProtocol 9 | - (void)closeInAppWithCompletionHandler:(_Nullable EMSCompletion)completionHandler; 10 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSIAMViewControllerProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @class MEJSBridge; 7 | @class MEIAMViewController; 8 | 9 | @interface EMSIAMViewControllerProvider : NSObject 10 | 11 | - (instancetype)initWithJSBridge:(MEJSBridge *)jsBridge; 12 | 13 | - (MEIAMViewController *)provideViewController; 14 | 15 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSInAppInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "MEInAppTrackingProtocol.h" 7 | 8 | @class EMSRequestManager; 9 | @class EMSRequestFactory; 10 | @class MEInApp; 11 | @class EMSTimestampProvider; 12 | @class EMSUUIDProvider; 13 | 14 | @interface EMSInAppInternal : NSObject 15 | 16 | - (instancetype)initWithRequestManager:(EMSRequestManager *)requestManager 17 | requestFactory:(EMSRequestFactory *)requestFactory 18 | meInApp:(MEInApp *)meInApp 19 | timestampProvider:(EMSTimestampProvider *)timestampProvider 20 | uuidProvider:(EMSUUIDProvider *)uuidProvider; 21 | 22 | - (void)handleInApp:(NSDictionary *)userInfo 23 | inApp:(NSDictionary *)inApp; 24 | 25 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSInAppLog.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSLogEntryProtocol.h" 6 | 7 | @class MEInAppMessage; 8 | 9 | @interface EMSInAppLog : NSObject 10 | 11 | - (instancetype)initWithMessage:(MEInAppMessage *)message 12 | loadingTimeEnd:(NSDate *)loadingTimeEnd; 13 | 14 | - (void)setOnScreenTimeStart:(NSDate *)onScreenTimeStart; 15 | 16 | - (void)setOnScreenTimeEnd:(NSDate *)onScreenTimeEnd; 17 | 18 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSInMemoryStorage.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2022 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSStorageProtocol.h" 7 | 8 | @interface EMSInMemoryStorage: NSObject 9 | 10 | @property(nonatomic, readonly) NSDictionary *inMemoryStore; 11 | 12 | - (instancetype)initWithStorage:(id)storage; 13 | 14 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSInboxResultParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSResponseModel; 8 | @class EMSInboxResult; 9 | 10 | @interface EMSInboxResultParser : NSObject 11 | 12 | - (EMSInboxResult *)parseFromResponse:(EMSResponseModel *)response; 13 | 14 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSInboxV3.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSMessageInboxProtocol.h" 7 | 8 | @class EMSRequestFactory; 9 | @class EMSRequestManager; 10 | @class EMSInboxResultParser; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface EMSInboxV3 : NSObject 15 | 16 | @property(nonatomic, strong, nullable) NSArray *messages; 17 | 18 | - (instancetype)initWithRequestFactory:(EMSRequestFactory *)requestFactory 19 | requestManager:(EMSRequestManager *)requestManager 20 | inboxResultParser:(EMSInboxResultParser *)inboxResultParser; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/Private/EMSInnerFeature.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSFlipperFeatures.h" 6 | 7 | @interface EMSInnerFeature : NSObject 8 | 9 | @property(class, nonatomic, readonly) id mobileEngage; 10 | @property(class, nonatomic, readonly) id predict; 11 | @property(class, nonatomic, readonly) id eventServiceV4; 12 | 13 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSInstanceRouter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | typedef BOOL (^RouterLogicBlock)(void); 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | @interface EMSInstanceRouter: NSObject 12 | 13 | - (instancetype)initWithDefaultInstance:(id)defaultInstance 14 | loggingInstance:(id)loggingInstance 15 | routerLogic:(RouterLogicBlock)routerLogic; 16 | 17 | - (id)instance; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /Sources/Private/EMSListChunker.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @interface EMSListChunker : NSObject 7 | 8 | - (instancetype)initWithChunkSize:(int)size; 9 | 10 | - (NSArray *)chunk:(NSArray *)array; 11 | 12 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSLockableProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @protocol EMSLockableProtocol 8 | 9 | - (void)lock; 10 | 11 | - (void)unlock; 12 | 13 | - (BOOL)isLocked; 14 | 15 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSLogEndpoints.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | #define EMSLogEndpoint @"https://log-dealer.eservice.emarsys.net/v1/log" 7 | 8 | -------------------------------------------------------------------------------- /Sources/Private/EMSLogEntryProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @protocol EMSLogEntryProtocol 7 | 8 | - (NSString *)topic; 9 | 10 | - (NSDictionary *)data; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Sources/Private/EMSLogMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSRequestFromShardsMapperProtocol.h" 6 | #import "MERequestContext.h" 7 | 8 | @interface EMSLogMapper : NSObject 9 | 10 | - (instancetype)initWithRequestContext:(MERequestContext *)requestContext 11 | applicationCode:(NSString *)applicationCode 12 | merchantId:(NSString *)merchantId; 13 | 14 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSLoggingGeofenceInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSGeofenceProtocol.h" 7 | 8 | @interface EMSLoggingGeofenceInternal : NSObject 9 | 10 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSLoggingInApp.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSInAppProtocol.h" 6 | #import "MEIAMProtocol.h" 7 | 8 | @interface EMSLoggingInApp : NSObject 9 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSLoggingInboxV3.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSMessageInboxProtocol.h" 7 | 8 | @interface EMSLoggingInboxV3 : NSObject 9 | 10 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSLoggingMobileEngageInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSMobileEngageProtocol.h" 6 | 7 | @interface EMSLoggingMobileEngageInternal : NSObject 8 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSLoggingOnEventActionInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSOnEventActionProtocol.h" 7 | 8 | @interface EMSLoggingOnEventActionInternal : NSObject 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Sources/Private/EMSLoggingPredictInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSPredictProtocol.h" 6 | #import "EMSPredictInternalProtocol.h" 7 | 8 | @interface EMSLoggingPredictInternal : NSObject 9 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSLoggingPushInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSPushNotificationProtocol.h" 6 | 7 | @interface EMSLoggingPushInternal : NSObject 8 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSMacros.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2018. Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSDependencyInjection.h" 7 | #import "EMSDependencyContainer.h" 8 | #import "EMSLogger.h" 9 | 10 | #define EMSLog(logEntry, logLevel) [EMSDependencyInjection.dependencyContainer.logger log:logEntry level:logLevel]; 11 | 12 | #define EMSStrictLog(logEntry, entryLogLevel) \ 13 | EMSLogger *logger = EMSDependencyInjection.dependencyContainer.logger; \ 14 | if (logger.logLevel == entryLogLevel) { \ 15 | [logger log:logEntry level:entryLogLevel]; \ 16 | } -------------------------------------------------------------------------------- /Sources/Private/EMSMainWindowProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import 6 | 7 | @interface EMSMainWindowProvider : NSObject 8 | 9 | - (instancetype)initWithApplication:(UIApplication *)application; 10 | 11 | - (UIWindow *)provideMainWindow; 12 | 13 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSMethodNotAllowed.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSLogEntryProtocol.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface EMSMethodNotAllowed : NSObject 10 | 11 | - (instancetype)initWithClass:(Class)klass 12 | sel:(SEL)sel 13 | parameters:(nullable NSDictionary *)parameters; 14 | 15 | - (instancetype)initWithProtocol:(Protocol *)proto 16 | sel:(SEL)sel 17 | parameters:(nullable NSDictionary *)parameters; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /Sources/Private/EMSMobileEngageMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSRequestModelMapperProtocol.h" 6 | #import "MERequestContext.h" 7 | 8 | @class EMSEndpoint; 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface EMSMobileEngageMapper : NSObject 13 | 14 | - (instancetype)initWithRequestContext:(MERequestContext *)requestContext 15 | endpoint:(EMSEndpoint *)endpoint; 16 | 17 | @end 18 | 19 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/Private/EMSMobileEngageNullSafeBodyParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSResponseBodyParserProtocol.h" 7 | #import "EMSEndpoint.h" 8 | 9 | @class EMSEndpoint; 10 | 11 | 12 | @interface EMSMobileEngageNullSafeBodyParser : NSObject 13 | 14 | @property(nonatomic, readonly) EMSEndpoint *endpoint; 15 | 16 | - (instancetype)initWithEndpoint:(EMSEndpoint *)endpoint; 17 | 18 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSModelMapperProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import 7 | 8 | @protocol EMSModelMapperProtocol 9 | 10 | - (id)modelFromStatement:(sqlite3_stmt *)statement; 11 | 12 | - (sqlite3_stmt *)bindStatement:(sqlite3_stmt *)statement fromModel:(id)model; 13 | 14 | - (NSString *)tableName; 15 | 16 | - (NSUInteger)fieldCount; 17 | 18 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSNotificationCenterManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | 8 | typedef void (^MEHandlerBlock)(void); 9 | 10 | @interface EMSNotificationCenterManager : NSObject 11 | 12 | @property(nonatomic, readonly) NSArray *observers; 13 | 14 | - (instancetype)initWithNotificationCenter:(NSNotificationCenter *)notificationCenter; 15 | 16 | - (void)addHandlerBlock:(MEHandlerBlock)handlerBlock 17 | forNotification:(NSString *)notificationName; 18 | 19 | - (void)removeHandlers; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Sources/Private/EMSNotificationService+Actions.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSNotificationService.h" 6 | 7 | typedef void(^ActionsCompletionHandler)(UNNotificationCategory *category); 8 | 9 | @interface EMSNotificationService (Actions) 10 | 11 | - (void)createCategoryForContent:(UNMutableNotificationContent *)content 12 | completionHandler:(ActionsCompletionHandler)completionHandler; 13 | 14 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSNotificationService+Attachment.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSNotificationService.h" 6 | #import "MEDownloader.h" 7 | 8 | typedef void(^AttachmentsCompletionHandler)(NSArray *attachments); 9 | 10 | @interface EMSNotificationService (Attachment) 11 | 12 | - (void)createAttachmentForContent:(UNNotificationContent *)content 13 | withDownloader:(MEDownloader *)downloader 14 | completionHandler:(AttachmentsCompletionHandler)completionHandler; 15 | 16 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSNotificationService+PushToInApp.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSNotificationService.h" 6 | #import "MEDownloader.h" 7 | 8 | typedef void(^PushToInAppCompletionHandler)(NSDictionary *userInfo); 9 | 10 | @interface EMSNotificationService (PushToInApp) 11 | 12 | - (void)createUserInfoWithInAppForContent:(UNMutableNotificationContent *)content 13 | withDownloader:(MEDownloader *)downloader 14 | completionHandler:(PushToInAppCompletionHandler)completionHandler; 15 | 16 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSOfflineQueueSize.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSLogEntryProtocol.h" 6 | 7 | @interface EMSOfflineQueueSize : NSObject 8 | 9 | - (instancetype)initWithQueueSize:(NSUInteger)queueSize; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSOnEventActionInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSOnEventActionProtocol.h" 7 | #import "EMSActionFactory.h" 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | @interface EMSOnEventActionInternal : NSObject 12 | 13 | - (instancetype)initWithActionFactory:(EMSActionFactory *)actionFactory; 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Sources/Private/EMSOnEventResponseHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSAbstractResponseHandler.h" 7 | #import "EMSRequestManager.h" 8 | #import "EMSRequestFactory.h" 9 | #import "EMSRepositoryProtocol.h" 10 | #import "EMSActionFactory.h" 11 | #import "EMSTimestampProvider.h" 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | @interface EMSOnEventResponseHandler : EMSAbstractResponseHandler 16 | 17 | - (instancetype)initWithRequestManager:(EMSRequestManager *)requestManager 18 | requestFactory:(EMSRequestFactory *)requestFactory 19 | displayedIAMRepository:(id )repository 20 | actionFactory:(EMSActionFactory *)actionFactory 21 | timestampProvider:(EMSTimestampProvider *)timestampProvider; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /Sources/Private/EMSOpenExternalUrlAction.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSActionProtocol.h" 7 | 8 | @interface EMSOpenExternalUrlAction : NSObject 9 | 10 | - (instancetype)init NS_UNAVAILABLE; 11 | 12 | - (instancetype)initWithActionDictionary:(NSDictionary *)action 13 | application:(UIApplication *)application; 14 | 15 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSOpenIdTokenMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSRequestModelMapperProtocol.h" 7 | 8 | @class EMSEndpoint; 9 | @class MERequestContext; 10 | 11 | @interface EMSOpenIdTokenMapper: NSObject 12 | 13 | @property(nonatomic, readonly) MERequestContext *requestContext; 14 | @property(nonatomic, readonly) EMSEndpoint *endpoint; 15 | 16 | - (instancetype)initWithRequestContext:(MERequestContext *)requestContext 17 | endpoint:(EMSEndpoint *)endpoint; 18 | 19 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSOperationQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @interface EMSOperationQueue : NSOperationQueue 7 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSPredicate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @interface EMSPredicate<__covariant T> : NSObject 7 | 8 | - (BOOL)evaluate:(T)value; 9 | 10 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSPredictInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSPredictProtocol.h" 6 | #import "EMSPredictInternalProtocol.h" 7 | 8 | @class PRERequestContext; 9 | @class EMSRequestManager; 10 | @class EMSPredictRequestModelBuilderProvider; 11 | @class EMSProductMapper; 12 | 13 | @interface EMSPredictInternal : NSObject 14 | 15 | - (instancetype)initWithRequestContext:(PRERequestContext *)requestContext 16 | requestManager:(EMSRequestManager *)requestManager 17 | requestBuilderProvider:(EMSPredictRequestModelBuilderProvider *)requestBuilderProvider 18 | productMapper:(EMSProductMapper *)productMapper; 19 | 20 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSPredictInternalProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @protocol EMSPredictInternalProtocol 7 | 8 | - (void)setContactWithContactFieldId:(NSNumber *)contactFieldId 9 | contactFieldValue:(NSString *)contactFieldValue; 10 | 11 | - (void)clearContact; 12 | 13 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSPredictMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSRequestFromShardsMapperProtocol.h" 6 | 7 | @class EMSUUIDProvider; 8 | @class EMSTimestampProvider; 9 | @class PRERequestContext; 10 | @class EMSEndpoint; 11 | 12 | @interface EMSPredictMapper : NSObject 13 | 14 | @property(nonatomic, readonly) PRERequestContext *requestContext; 15 | @property(nonatomic, readonly) EMSEndpoint *endpoint; 16 | 17 | - (instancetype)initWithRequestContext:(PRERequestContext *)requestContext 18 | endpoint:(EMSEndpoint *)endpoint; 19 | 20 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSPredictRequestModelBuilderProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSPredictRequestModelBuilder; 8 | @class PRERequestContext; 9 | @class EMSEndpoint; 10 | 11 | 12 | @interface EMSPredictRequestModelBuilderProvider : NSObject 13 | 14 | - (instancetype)initWithRequestContext:(PRERequestContext *)requestContext 15 | endpoint:(EMSEndpoint *)endpoint; 16 | 17 | - (EMSPredictRequestModelBuilder *)provideBuilder; 18 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSProduct+Emarsys.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSProduct.h" 6 | #import "EMSProductBuilder.h" 7 | 8 | NS_ASSUME_NONNULL_BEGIN 9 | 10 | typedef void(^EMSProductBuilderBlock)(EMSProductBuilder *builder); 11 | 12 | @interface EMSProduct (Emarsys) 13 | 14 | + (instancetype)makeWithBuilder:(EMSProductBuilderBlock)builderBlock; 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/Private/EMSProductMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSProduct; 8 | @class EMSResponseModel; 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface EMSProductMapper : NSObject 13 | 14 | - (NSArray *)mapFromResponse:(EMSResponseModel *)responseModel; 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/Private/EMSQueryOldestRowSpecification.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSSQLSpecificationProtocol.h" 6 | #import "EMSCommonSQLSpecification.h" 7 | 8 | @interface EMSQueryOldestRowSpecification : EMSCommonSQLSpecification 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Sources/Private/EMSQueueDelegator.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSInstanceRouter.h" 7 | 8 | @class EMSDispatchWaiter; 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @interface EMSQueueDelegator : NSProxy 13 | 14 | @property(nonatomic, strong) EMSInstanceRouter * instanceRouter; 15 | 16 | - (void)setupWithQueue:(NSOperationQueue *)queue 17 | emptyTarget:(id)emptyTarget; 18 | 19 | - (void)proxyWithInstanceRouter:(EMSInstanceRouter *)instanceRouter; 20 | 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/Private/EMSRESTClientCompletionProxyProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSCoreCompletion.h" 6 | 7 | @class EMSRequestModel; 8 | @class EMSResponseModel; 9 | 10 | typedef void(^EMSRESTClientCompletionBlock)(EMSRequestModel *requestModel, EMSResponseModel *responseModel, NSError *error); 11 | 12 | @protocol EMSRESTClientCompletionProxyProtocol 13 | 14 | - (EMSRESTClientCompletionBlock)completionBlock; 15 | 16 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSRandomProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | 8 | @interface EMSRandomProvider : NSObject 9 | 10 | - (NSNumber *)provideDoubleUntil:(NSNumber *)until; 11 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSRefreshTokenResponseHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSAbstractResponseHandler.h" 7 | 8 | @class MERequestContext; 9 | @class EMSEndpoint; 10 | 11 | @interface EMSRefreshTokenResponseHandler : EMSAbstractResponseHandler 12 | 13 | @property(nonatomic, readonly) MERequestContext *requestContext; 14 | @property(nonatomic, readonly) EMSEndpoint *endpoint; 15 | 16 | - (instancetype)initWithRequestContext:(MERequestContext *)requestContext 17 | endpoint:(EMSEndpoint *)endpoint; 18 | 19 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSRemoteConfigResponseMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @class EMSRemoteConfig; 7 | @class EMSResponseModel; 8 | @class EMSRandomProvider; 9 | @class EMSDeviceInfo; 10 | 11 | @interface EMSRemoteConfigResponseMapper : NSObject 12 | 13 | @property(nonatomic, readonly) EMSRandomProvider *randomProvider; 14 | 15 | - (instancetype)initWithRandomProvider:(EMSRandomProvider *)randomProvider 16 | deviceInfo:(EMSDeviceInfo *)deviceInfo; 17 | 18 | - (EMSRemoteConfig *)map:(EMSResponseModel *)responseModel; 19 | 20 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSRepositoryProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSSQLSpecificationProtocol.h" 7 | 8 | @protocol EMSRepositoryProtocol 9 | 10 | - (void)add:(id)item; 11 | 12 | - (void)remove:(id )sqlSpecification; 13 | 14 | - (NSArray *)query:(id )sqlSpecification; 15 | 16 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSRequestFromShardsMapperProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @class EMSRequestModel; 7 | @class EMSShard; 8 | 9 | @protocol EMSRequestFromShardsMapperProtocol 10 | 11 | - (EMSRequestModel *)requestFromShards:(NSArray *)shards; 12 | 13 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSRequestLog.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSLogEntryProtocol.h" 6 | 7 | @class EMSResponseModel; 8 | 9 | @interface EMSRequestLog : NSObject 10 | 11 | - (instancetype)initWithResponseModel:(EMSResponseModel *)responseModel 12 | networkingStartTime:(NSDate *)networkingStartTime 13 | headers:(NSDictionary *)headers 14 | payload:(NSDictionary *)payload; 15 | 16 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSRequestModel+RequestIds.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2018. Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSRequestModel.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface EMSRequestModel (RequestIds) 10 | 11 | - (NSArray *)requestIds; 12 | 13 | @end 14 | 15 | NS_ASSUME_NONNULL_END 16 | -------------------------------------------------------------------------------- /Sources/Private/EMSRequestModelMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSModelMapperProtocol.h" 7 | 8 | @interface EMSRequestModelMapper : NSObject 9 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSRequestModelMapperProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @class EMSRequestModel; 7 | 8 | @protocol EMSRequestModelMapperProtocol 9 | 10 | - (BOOL)shouldHandleWithRequestModel:(EMSRequestModel *)requestModel; 11 | 12 | - (EMSRequestModel *)modelFromModel:(EMSRequestModel *)requestModel; 13 | 14 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSRequestModelRepository.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSRequestModelRepositoryProtocol.h" 7 | 8 | @protocol EMSSQLiteHelperProtocol; 9 | 10 | @interface EMSRequestModelRepository : NSObject 11 | 12 | - (instancetype)initWithDbHelper:(id )sqliteHelper 13 | operationQueue:(NSOperationQueue *)operationQueue; 14 | 15 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSRequestModelRepositoryProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "EMSRepositoryProtocol.h" 6 | #import "EMSRequestModel.h" 7 | #import "EMSSQLSpecificationProtocol.h" 8 | 9 | @protocol EMSRequestModelRepositoryProtocol 10 | 11 | - (void)add:(EMSRequestModel *)item; 12 | 13 | - (void)remove:(id )sqlSpecification; 14 | 15 | - (NSArray *)query:(id )sqlSpecification; 16 | 17 | - (BOOL)isEmpty; 18 | 19 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSResponseBodyParserProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSRequestModel; 8 | 9 | @protocol EMSResponseBodyParserProtocol 10 | 11 | - (BOOL)shouldParse:(EMSRequestModel *)requestModel 12 | responseBody:(NSData *)responseBody 13 | httpUrlResponse:(NSHTTPURLResponse *)httpUrlResponse; 14 | 15 | - (id)parseWithRequestModel:(EMSRequestModel *)requestModel 16 | responseBody:(NSData *)responseBody; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Sources/Private/EMSResponseModel+EMSCore.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSResponseModel.h" 6 | 7 | @interface EMSResponseModel (EMSCore) 8 | 9 | - (BOOL)isSuccess; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSSQLSpecificationProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import 7 | 8 | @protocol EMSSQLSpecificationProtocol 9 | 10 | - (NSString *)selection; 11 | 12 | - (NSArray *)selectionArgs; 13 | 14 | - (NSString *)orderBy; 15 | 16 | - (NSString *)limit; 17 | 18 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSSQLStatementFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @protocol EMSModelMapperProtocol; 7 | @protocol EMSSQLSpecificationProtocol; 8 | 9 | @interface EMSSQLStatementFactory : NSObject 10 | 11 | + (NSString *)createQueryStatementWithTableName:(NSString *)tableName 12 | selection:(NSString *)selection 13 | orderBy:(NSString *)orderBy 14 | limit:(NSString *)limit; 15 | 16 | + (NSString *)createDeleteStatementWithTableName:(NSString *)tableName 17 | selection:(NSString *)selection; 18 | 19 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSSQLiteHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSDBTrigger.h" 7 | #import "EMSSQLiteHelperProtocol.h" 8 | 9 | @class EMSSQLiteHelper; 10 | @protocol EMSModelMapperProtocol; 11 | @protocol EMSDBTriggerProtocol; 12 | @protocol EMSSQLiteHelperSchemaHandlerProtocol; 13 | 14 | @interface EMSSQLiteHelper: NSObject 15 | 16 | @property(nonatomic, strong) id schemaHandler; 17 | @property(nonatomic, readonly) NSDictionary *registeredTriggers; 18 | 19 | - (instancetype)initWithDatabasePath:(NSString *)path 20 | schemaDelegate:(id )schemaDelegate 21 | operationQueue:(NSOperationQueue *)operationQueue; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Sources/Private/EMSSQLiteHelperSchemaHandlerProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSSQLiteHelperProtocol.h" 7 | 8 | @protocol EMSSQLiteHelperSchemaHandlerProtocol 9 | 10 | - (void)onCreateWithDbHelper:(id )dbHelper; 11 | 12 | - (void)onUpgradeWithDbHelper:(id )dbHelper 13 | oldVersion:(int)oldVersion 14 | newVersion:(int)newVersion; 15 | 16 | - (int)schemaVersion; 17 | 18 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSSceneProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface EMSSceneProvider : NSObject 10 | 11 | - (instancetype)initWithApplication:(UIApplication *)application; 12 | 13 | - (nullable UIScene *)provideScene API_AVAILABLE(ios(13.0)); 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/Private/EMSScheduler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSTrigger.h" 6 | 7 | @class EMSAgenda; 8 | 9 | @interface EMSScheduler : NSObject 10 | 11 | @property(nonatomic, readonly) NSDictionary *scheduledAgendas; 12 | 13 | - (instancetype)initWithOperationQueue:(NSOperationQueue *)operationQueue 14 | leeway:(NSTimeInterval)leeway; 15 | 16 | - (void)scheduleTriggerWithTag:(NSString *)tag 17 | delay:(NSTimeInterval)delay 18 | interval:(NSNumber *)interval 19 | triggerBlock:(EMSTriggerBlock)trigger; 20 | 21 | - (void)cancelTriggerWithTag:(NSString *)tag; 22 | 23 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSSdkStateLogger.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSEndpoint; 8 | @class MERequestContext; 9 | @class EMSConfig; 10 | @protocol EMSStorageProtocol; 11 | 12 | 13 | @interface EMSSdkStateLogger : NSObject 14 | @property(nonatomic, readonly) EMSEndpoint *endpoint; 15 | @property(nonatomic, readonly) MERequestContext *meRequestContext; 16 | @property(nonatomic, readonly) EMSConfig *config; 17 | @property(nonatomic, readonly) id storage; 18 | 19 | - (instancetype)initWithEndpoint:(EMSEndpoint *)endpoint 20 | meRequestContext:(MERequestContext *)meRequestContext 21 | config:(EMSConfig *)config 22 | storage:(id)storage; 23 | 24 | - (void)log; 25 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSServiceDictionaryValidator.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | 7 | @interface EMSServiceDictionaryValidator : NSObject 8 | 9 | @property(nonatomic, readonly) NSDictionary *dictionary; 10 | 11 | - (instancetype)initWithDictionary:(NSDictionary *)dictionary; 12 | 13 | - (void)valueExistsForKey:(id)key withType:(Class)type; 14 | 15 | - (NSArray *)failureReasons; 16 | 17 | @end 18 | 19 | 20 | typedef void (^ValidatorBlock)(EMSServiceDictionaryValidator *validate); 21 | 22 | @interface NSDictionary (Validator) 23 | 24 | - (NSArray *)validateWithBlock:(ValidatorBlock)validator; 25 | 26 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSSessionIdHolder.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @interface EMSSessionIdHolder : NSObject 8 | 9 | @property(nonatomic, strong, nullable) NSString *sessionId; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSShardMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSModelMapperProtocol.h" 7 | 8 | @interface EMSShardMapper : NSObject 9 | @end 10 | -------------------------------------------------------------------------------- /Sources/Private/EMSShardRepository.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSShardRepositoryProtocol.h" 6 | 7 | @class EMSSQLiteHelper; 8 | 9 | 10 | @interface EMSShardRepository : NSObject 11 | 12 | - (instancetype)initWithDbHelper:(EMSSQLiteHelper *)sqliteHelper; 13 | 14 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSShardRepositoryProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSSQLSpecificationProtocol.h" 7 | #import "EMSRepositoryProtocol.h" 8 | 9 | @class EMSShard; 10 | 11 | @protocol EMSShardRepositoryProtocol 12 | 13 | - (void)add:(EMSShard *)item; 14 | 15 | - (void)remove:(id )sqlSpecification; 16 | 17 | - (NSArray *)query:(id )sqlSpecification; 18 | 19 | - (BOOL)isEmpty; 20 | 21 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSSqliteSchemaHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSSQLiteHelperSchemaHandlerProtocol.h" 7 | 8 | @interface EMSSqliteSchemaHandler : NSObject 9 | 10 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSStatusLog.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSLogEntryProtocol.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface EMSStatusLog : NSObject 10 | 11 | - (instancetype)initWithClass:(Class)klass 12 | sel:(SEL)sel 13 | parameters:(nullable NSDictionary *)parameters 14 | status:(nullable NSDictionary *)status; 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Sources/Private/EMSStorage.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSStorageProtocol.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface EMSStorage : NSObject 10 | 11 | @property(nonatomic, readonly) NSString *accessGroup; 12 | 13 | - (instancetype)init NS_UNAVAILABLE; 14 | 15 | + (instancetype)new NS_UNAVAILABLE; 16 | 17 | - (instancetype)initWithSuiteNames:(NSArray *)suiteNames 18 | accessGroup:(nullable NSString *)accessGroup 19 | operationQueue:(NSOperationQueue *)operationQueue; 20 | 21 | - (void)setSharedData:(nullable NSData *)data 22 | forKey:(NSString *)key; 23 | 24 | - (nullable NSData *)sharedDataForKey:(NSString *)key; 25 | 26 | @end 27 | 28 | NS_ASSUME_NONNULL_END 29 | -------------------------------------------------------------------------------- /Sources/Private/EMSTimestampProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @interface EMSTimestampProvider : NSObject 8 | 9 | - (NSDate *)provideTimestamp; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSTrigger.h: -------------------------------------------------------------------------------- 1 | typedef void(^EMSTriggerBlock)(void); -------------------------------------------------------------------------------- /Sources/Private/EMSUUIDProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @interface EMSUUIDProvider : NSObject 7 | 8 | - (NSString *)provideUUIDString; 9 | 10 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSValueProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @interface EMSValueProvider : NSObject 7 | 8 | - (instancetype)initWithDefaultValue:(NSString *)defaultValue 9 | valueKey:(NSString *)valueKey; 10 | 11 | - (NSString *)provideValue; 12 | 13 | - (void)updateValue:(NSString *)newValue; 14 | 15 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSViewControllerProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import 6 | 7 | @interface EMSViewControllerProvider : NSObject 8 | 9 | - (UIViewController *)provideViewController; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSVisitorIdResponseHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "PRERequestContext.h" 6 | #import "EMSAbstractResponseHandler.h" 7 | 8 | @class EMSEndpoint; 9 | 10 | @interface EMSVisitorIdResponseHandler : EMSAbstractResponseHandler 11 | 12 | @property(nonatomic, readonly) PRERequestContext *requestContext; 13 | @property(nonatomic, readonly) EMSEndpoint *endpoint; 14 | 15 | - (instancetype)initWithRequestContext:(PRERequestContext *)requestContext 16 | endpoint:(EMSEndpoint *)endpoint; 17 | 18 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSWindowProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import 6 | 7 | @class EMSViewControllerProvider; 8 | @class EMSSceneProvider; 9 | 10 | @interface EMSWindowProvider : NSObject 11 | 12 | - (instancetype)initWithViewControllerProvider:(EMSViewControllerProvider *)viewControllerProvider 13 | sceneProvider:(EMSSceneProvider *)sceneProvider; 14 | 15 | - (UIWindow *)provideWindow; 16 | 17 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSWorkerProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSLockableProtocol.h" 7 | 8 | @protocol EMSWorkerProtocol 9 | 10 | - (void)run; 11 | 12 | @end -------------------------------------------------------------------------------- /Sources/Private/EMSWrapperChecker.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSDispatchWaiter; 8 | @protocol EMSStorageProtocol; 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | #define kInnerWrapperKey @"kInnerWrapperKey" 13 | 14 | @interface EMSWrapperChecker : NSObject 15 | 16 | @property(nonatomic, readonly) NSString *wrapper; 17 | 18 | - (instancetype)initWithOperationQueue:(NSOperationQueue *)queue 19 | waiter:(EMSDispatchWaiter *)waiter 20 | storage:(id)storage; 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /Sources/Private/EMSXPResponseHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSAbstractResponseHandler.h" 6 | 7 | @class PRERequestContext; 8 | @class EMSEndpoint; 9 | 10 | @interface EMSXPResponseHandler : EMSAbstractResponseHandler 11 | 12 | @property(nonatomic, readonly) PRERequestContext *requestContext; 13 | @property(nonatomic, readonly) EMSEndpoint *endpoint; 14 | 15 | - (instancetype)initWithRequestContext:(PRERequestContext *)requestContext 16 | endpoint:(EMSEndpoint *)endpoint; 17 | 18 | @end -------------------------------------------------------------------------------- /Sources/Private/EmarsysSDKVersion.h: -------------------------------------------------------------------------------- 1 | #define EMARSYS_SDK_VERSION @"3.8.1" -------------------------------------------------------------------------------- /Sources/Private/MEButtonClick.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @interface MEButtonClick : NSObject 8 | 9 | @property(nonatomic, strong) NSString *campaignId; 10 | @property(nonatomic, strong) NSString *buttonId; 11 | @property(nonatomic, strong) NSDate *timestamp; 12 | 13 | - (instancetype)initWithCampaignId:(NSString *)campaignId 14 | buttonId:(NSString *)buttonId 15 | timestamp:(NSDate *)timestamp; 16 | 17 | - (BOOL)isEqual:(id)other; 18 | 19 | - (BOOL)isEqualToClick:(MEButtonClick *)click; 20 | 21 | - (NSUInteger)hash; 22 | 23 | - (NSDictionary *)dictionaryRepresentation; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Sources/Private/MEButtonClickMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSModelMapperProtocol.h" 7 | 8 | @interface MEButtonClickMapper : NSObject 9 | 10 | @end 11 | -------------------------------------------------------------------------------- /Sources/Private/MEButtonClickRepository+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "MEButtonClickRepository.h" 6 | 7 | @interface MEButtonClickRepository (Private) 8 | 9 | - (EMSSQLiteHelper *)sqliteHelper; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/MEButtonClickRepository.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSSQLiteHelper.h" 6 | #import "EMSSQLSpecificationProtocol.h" 7 | #import "MEButtonClick.h" 8 | #import "EMSRepositoryProtocol.h" 9 | 10 | @interface MEButtonClickRepository : NSObject 11 | 12 | - (instancetype)initWithDbHelper:(EMSSQLiteHelper *)sqliteHelper; 13 | 14 | - (void)add:(MEButtonClick *)item; 15 | 16 | - (void)remove:(id )sqlSpecification; 17 | 18 | - (NSArray *)query:(id )sqlSpecification; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Sources/Private/MEDefaultHeaders.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSConfig; 8 | 9 | @interface MEDefaultHeaders : NSObject 10 | 11 | + (NSDictionary *)additionalHeaders; 12 | 13 | @end -------------------------------------------------------------------------------- /Sources/Private/MEDisplayedIAM.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | 8 | @interface MEDisplayedIAM : NSObject 9 | 10 | @property(nonatomic, strong) NSString *campaignId; 11 | @property(nonatomic, strong) NSDate *timestamp; 12 | 13 | - (instancetype)initWithCampaignId:(NSString *)campaignId timestamp:(NSDate *)timestamp; 14 | 15 | - (NSDictionary *)dictionaryRepresentation; 16 | 17 | - (BOOL)isEqual:(id)other; 18 | 19 | - (BOOL)isEqualToIam:(MEDisplayedIAM *)iam; 20 | 21 | - (NSUInteger)hash; 22 | 23 | @end -------------------------------------------------------------------------------- /Sources/Private/MEDisplayedIAMContract.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #define TABLE_NAME_DISPLAYED_IAM @"displayed_iam" 6 | #define COLUMN_NAME_CAMPAIGN_ID @"campaign_id" 7 | #define COLUMN_NAME_TIMESTAMP @"timestamp" 8 | 9 | #define SQL_CREATE_TABLE_DISPLAYED_IAM [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS %@ (%@ TEXT, %@ DOUBLE);", TABLE_NAME_DISPLAYED_IAM, COLUMN_NAME_CAMPAIGN_ID, COLUMN_NAME_TIMESTAMP] 10 | #define SQL_REQUEST_INSERT_DISPLAYED_IAM [NSString stringWithFormat:@"INSERT INTO %@ (%@, %@) VALUES (?, ?);", TABLE_NAME_DISPLAYED_IAM, COLUMN_NAME_CAMPAIGN_ID, COLUMN_NAME_TIMESTAMP] 11 | -------------------------------------------------------------------------------- /Sources/Private/MEDisplayedIAMMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSModelMapperProtocol.h" 7 | 8 | @interface MEDisplayedIAMMapper : NSObject 9 | @end -------------------------------------------------------------------------------- /Sources/Private/MEDisplayedIAMRepository.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "MEDisplayedIAM.h" 7 | #import "EMSSQLiteHelper.h" 8 | #import "EMSSQLSpecificationProtocol.h" 9 | #import "EMSRepositoryProtocol.h" 10 | 11 | @interface MEDisplayedIAMRepository : NSObject 12 | 13 | - (instancetype)initWithDbHelper:(EMSSQLiteHelper *)sqliteHelper; 14 | 15 | - (void)add:(MEDisplayedIAM *)item; 16 | 17 | - (void)remove:(id )sqlSpecification; 18 | 19 | - (NSArray *)query:(id )sqlSpecification; 20 | 21 | @end -------------------------------------------------------------------------------- /Sources/Private/MEDownloader.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | typedef void(^DownloadTaskCompletionHandler)(NSURL *destinationUrl, NSError *error); 7 | 8 | @interface MEDownloader : NSObject 9 | 10 | - (void)downloadFileFromUrl:(NSURL *)sourceUrl 11 | completionHandler:(DownloadTaskCompletionHandler)completionHandler; 12 | 13 | @end -------------------------------------------------------------------------------- /Sources/Private/MEExperimental.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSFlipperFeatures.h" 7 | 8 | @interface MEExperimental : NSObject 9 | 10 | + (BOOL)isFeatureEnabled:(id )feature; 11 | 12 | + (void)enableFeature:(id )feature; 13 | 14 | + (void)disableFeature:(id )feature; 15 | 16 | @end -------------------------------------------------------------------------------- /Sources/Private/MEIAMButtonClicked.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "MEIAMJSCommandProtocol.h" 6 | #import "MEButtonClickRepository.h" 7 | #import "MEInAppTrackingProtocol.h" 8 | 9 | @interface MEIAMButtonClicked : NSObject 10 | 11 | @property(nonatomic, readonly) MEInAppMessage *inAppMessage; 12 | @property(nonatomic, readonly) MEButtonClickRepository *repository; 13 | @property(nonatomic, readonly) id inAppTracker; 14 | 15 | - (instancetype)initWithInAppMessage:(MEInAppMessage *)inAppMessage 16 | repository:(MEButtonClickRepository *)repository 17 | inAppTracker:(id )inAppTracker; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Sources/Private/MEIAMCleanupResponseHandlerV3.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSAbstractResponseHandler.h" 7 | #import "MEButtonClickRepository.h" 8 | #import "MEDisplayedIAMRepository.h" 9 | #import "EMSEndpoint.h" 10 | 11 | @interface MEIAMCleanupResponseHandlerV3 : EMSAbstractResponseHandler 12 | 13 | - (instancetype)initWithButtonClickRepository:(MEButtonClickRepository *)buttonClickRepository 14 | displayIamRepository:(MEDisplayedIAMRepository *)displayedIAMRepository 15 | endpoint:(EMSEndpoint *)endpoint; 16 | 17 | @end -------------------------------------------------------------------------------- /Sources/Private/MEIAMCleanupResponseHandlerV4.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSAbstractResponseHandler.h" 7 | #import "MEButtonClickRepository.h" 8 | #import "MEDisplayedIAMRepository.h" 9 | #import "EMSEndpoint.h" 10 | 11 | @interface MEIAMCleanupResponseHandlerV4 : EMSAbstractResponseHandler 12 | 13 | - (instancetype)initWithButtonClickRepository:(MEButtonClickRepository *)buttonClickRepository 14 | displayIamRepository:(MEDisplayedIAMRepository *)displayedIAMRepository 15 | endpoint:(EMSEndpoint *)endpoint; 16 | 17 | @end -------------------------------------------------------------------------------- /Sources/Private/MEIAMClose.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "MEIAMJSCommandProtocol.h" 7 | 8 | @protocol EMSIAMCloseProtocol; 9 | 10 | @interface MEIAMClose : NSObject 11 | 12 | - (instancetype)initWithEMSIAMCloseProtocol:(id )closeProtocol; 13 | 14 | @end -------------------------------------------------------------------------------- /Sources/Private/MEIAMCommandResultUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @interface MEIAMCommandResultUtils : NSObject 7 | 8 | + (NSDictionary *)createSuccessResultWith:(NSString *)jsCommandId; 9 | 10 | + (NSDictionary *)createErrorResultWith:(NSString *)jsCommandId 11 | errorMessage:(NSString *)errorMessage; 12 | 13 | + (NSDictionary *)createErrorResultWith:(NSString *)jsCommandId 14 | errorArray:(NSArray *)errorMessages; 15 | 16 | + (NSDictionary *)createMissingParameterErrorResultWith:(NSString *)jsCommandId 17 | missingParameter:(NSString *)missingParameter; 18 | 19 | @end -------------------------------------------------------------------------------- /Sources/Private/MEIAMCopyToClipboard.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2023 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "MEIAMJSCommandProtocol.h" 7 | 8 | @class UIPasteboard; 9 | 10 | @interface MEIAMCopyToClipboard: NSObject 11 | 12 | - (instancetype)initWithPasteboard:(UIPasteboard *)pasteboard; 13 | 14 | @end -------------------------------------------------------------------------------- /Sources/Private/MEIAMJSCommandProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | typedef void (^MEIAMJSResultBlock)(NSDictionary *result); 8 | 9 | @protocol MEIAMJSCommandProtocol 10 | 11 | + (NSString *)commandName; 12 | 13 | - (void)handleMessage:(NSDictionary *)message 14 | resultBlock:(MEIAMJSResultBlock)resultBlock; 15 | 16 | @end -------------------------------------------------------------------------------- /Sources/Private/MEIAMOpenExternalLink.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import 7 | #import "MEIAMJSCommandProtocol.h" 8 | 9 | @interface MEIAMOpenExternalLink : NSObject 10 | 11 | - (instancetype)initWithApplication:(UIApplication *)application; 12 | 13 | @end -------------------------------------------------------------------------------- /Sources/Private/MEIAMProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "MEInAppTrackingProtocol.h" 7 | #import "EMSIAMCloseProtocol.h" 8 | #import "EMSIAMAppEventProtocol.h" 9 | 10 | @class MEIAMViewController; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @protocol MEIAMProtocol 15 | 16 | @property(nonatomic, strong, nullable) id inAppTracker; 17 | 18 | - (MEInAppMessage *)currentInAppMessage; 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/Private/MEIAMRequestPushPermission.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "MEIAMJSCommandProtocol.h" 7 | 8 | @interface MEIAMRequestPushPermission : NSObject 9 | @end -------------------------------------------------------------------------------- /Sources/Private/MEIAMResponseHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSAbstractResponseHandler.h" 7 | 8 | @protocol EMSInAppProtocol; 9 | @protocol MEIAMProtocol; 10 | @class MEInApp; 11 | 12 | @interface MEIAMResponseHandler : EMSAbstractResponseHandler 13 | 14 | - (instancetype)initWithInApp:(id)inApp; 15 | 16 | @end -------------------------------------------------------------------------------- /Sources/Private/MEIAMTriggerAppEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2017 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "MEIAMJSCommandProtocol.h" 6 | #import "EMSBlocks.h" 7 | 8 | @interface MEIAMTriggerAppEvent : NSObject 9 | 10 | - (instancetype)initWithEventHandler:(EMSEventHandlerBlock)eventHandler; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Sources/Private/MEIAMTriggerMEEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "MEIAMJSCommandProtocol.h" 6 | 7 | @interface MEIAMTriggerMEEvent : NSObject 8 | @end -------------------------------------------------------------------------------- /Sources/Private/MEIAMViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import 7 | #import 8 | 9 | @class MEJSBridge; 10 | 11 | typedef void (^MECompletionHandler)(void); 12 | 13 | @interface MEIAMViewController : UIViewController 14 | 15 | - (instancetype)initWithJSBridge:(MEJSBridge *)bridge; 16 | 17 | - (void)loadMessage:(NSString *)message 18 | completionHandler:(MECompletionHandler)completionHandler; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Sources/Private/MEInAppTrackingProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class MEInAppMessage; 8 | 9 | @protocol MEInAppTrackingProtocol 10 | 11 | - (void)trackInAppDisplay:(MEInAppMessage *)inAppMessage; 12 | 13 | - (void)trackInAppClick:(MEInAppMessage *)inAppMessage 14 | buttonId:(NSString *)buttonId; 15 | 16 | @end -------------------------------------------------------------------------------- /Sources/Private/MEJSBridge.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import 7 | #import "MEIAMJSCommandProtocol.h" 8 | 9 | @class MEIAMJSCommandFactory; 10 | 11 | @interface MEJSBridge : NSObject 12 | 13 | @property(nonatomic, strong) MEIAMJSResultBlock jsResultBlock; 14 | 15 | - (instancetype)initWithJSCommandFactory:(MEIAMJSCommandFactory *)factory 16 | operationQueue:(NSOperationQueue *)operationQueue; 17 | 18 | - (NSArray *)jsCommandNames; 19 | 20 | - (WKUserContentController *)userContentController; 21 | 22 | @end -------------------------------------------------------------------------------- /Sources/Private/MERequestTools.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSRequestModel; 8 | 9 | 10 | @interface MERequestTools : NSObject 11 | 12 | + (BOOL)isRequestCustomEvent:(EMSRequestModel *)request; 13 | 14 | @end -------------------------------------------------------------------------------- /Sources/Private/NSData+MobileEngine.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @interface NSData (MobileEngine) 8 | 9 | - (NSString *)deviceTokenString; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/NSDate+EMSCore.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @interface NSDate (EMSCore) 7 | 8 | - (NSNumber *)numberValueInMillis; 9 | 10 | - (NSNumber *)numberValueInMillisFromDate:(NSDate *)date; 11 | 12 | - (NSString *)stringValueInUTC; 13 | 14 | + (NSDateFormatter *)utcDateFormatter; 15 | 16 | @end -------------------------------------------------------------------------------- /Sources/Private/NSDictionary+MobileEngage.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @interface NSDictionary (MobileEngage) 8 | 9 | - (NSDictionary *)customData; 10 | 11 | - (NSString *)messageId; 12 | 13 | @end -------------------------------------------------------------------------------- /Sources/Private/NSError+EMSCore.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface NSError (EMSCore) 10 | 11 | + (NSError *)errorWithCode:(int)errorCode 12 | localizedDescription:(NSString *)localizedDescription; 13 | 14 | @end 15 | 16 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/Private/NSHTTPURLResponse+EMSCore.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2022 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @interface NSHTTPURLResponse (EMSCore) 8 | 9 | - (BOOL)isSuccess; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/NSMutableDictionary+EMSCore.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @interface NSMutableDictionary (EMSCore) 8 | 9 | - (id)takeValueForKey:(NSString *)key; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/NSOperationQueue+EMSCore.h: -------------------------------------------------------------------------------- 1 | //// 2 | // 3 | // Copyright © 2024 Emarsys-Technologies Kft. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | NS_ASSUME_NONNULL_BEGIN 9 | 10 | typedef void (^EMSRunnerBlock)(void); 11 | 12 | @interface NSOperationQueue (EMSCore) 13 | 14 | - (void)runSynchronized:(EMSRunnerBlock)runnerBlock; 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Sources/Private/NSString+EMSCore.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Copyright © 2024 Emarsys-Technologies Kft. All rights reserved. 4 | // 5 | 6 | #import 7 | 8 | NS_ASSUME_NONNULL_BEGIN 9 | 10 | @interface NSString (EMSCore) 11 | 12 | - (NSString *)percentEncode; 13 | 14 | @end 15 | 16 | NS_ASSUME_NONNULL_END 17 | -------------------------------------------------------------------------------- /Sources/Private/NSURL+EMSCore.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @interface NSURL (EMSCore) 7 | 8 | + (NSURL *)urlWithBaseUrl:(NSString *)url 9 | queryParameters:(NSDictionary *)queryParameters; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/Private/NSURLRequest+EMSCore.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSRequestModel; 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | @interface NSURLRequest (EMSCore) 12 | 13 | + (NSURLRequest *)requestWithRequestModel:(EMSRequestModel *)requestModel 14 | additionalHeaders:(nullable NSDictionary *)additionalHeaders; 15 | 16 | + (NSURLRequest *)requestWithRequestModel:(EMSRequestModel *)requestModel; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/include/EMSActionModelProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @protocol EMSActionModelProtocol 10 | 11 | - (NSString *)id; 12 | - (NSString *)title; 13 | - (NSString *)type; 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/include/EMSAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import 7 | #import "EMSBlocks.h" 8 | 9 | @class EMSConfig; 10 | 11 | @interface EMSAppDelegate : UIResponder 12 | 13 | @property(strong, nonatomic) EMSEventHandlerBlock eventHandler; 14 | @property(strong, nonatomic) UIWindow *window; 15 | 16 | - (EMSConfig *)provideEMSConfig; 17 | 18 | @end -------------------------------------------------------------------------------- /Sources/include/EMSAppEventActionModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSActionModelProtocol.h" 7 | 8 | NS_ASSUME_NONNULL_BEGIN 9 | 10 | @interface EMSAppEventActionModel : NSObject 11 | 12 | @property(nonatomic, readonly) NSString *id; 13 | @property(nonatomic, readonly) NSString *title; 14 | @property(nonatomic, readonly) NSString *type; 15 | @property(nonatomic, readonly) NSString *name; 16 | @property(nonatomic, readonly, nullable) NSDictionary *payload; 17 | 18 | - (instancetype)initWithId:(NSString *)id 19 | title:(NSString *)title 20 | type:(NSString *)type 21 | name:(NSString *)name 22 | payload:(nullable NSDictionary *)payload; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/include/EMSBlocks.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSInboxResult.h" 6 | 7 | @class EMSNotificationInformation; 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | typedef void (^EMSCompletion)(void); 12 | 13 | typedef void (^EMSCompletionBlock)(NSError *_Nullable error); 14 | 15 | typedef void (^EMSSourceHandler)(NSString *source); 16 | 17 | typedef void (^EMSInboxMessageResultBlock)(EMSInboxResult *_Nullable inboxResult, NSError *_Nullable error); 18 | 19 | typedef void (^EMSEventHandlerBlock)(NSString *eventName, NSDictionary *_Nullable payload); 20 | 21 | typedef void (^EMSSilentNotificationInformationBlock)(EMSNotificationInformation *notificationInformation); 22 | 23 | typedef void (^EMSInlineInappViewCloseBlock)(void); 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /Sources/include/EMSCartItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSCartItemProtocol.h" 7 | 8 | @interface EMSCartItem : NSObject 9 | 10 | @property(nonatomic, strong) NSString *itemId; 11 | @property(nonatomic, assign) double price; 12 | @property(nonatomic, assign) double quantity; 13 | 14 | - (instancetype)initWithItemId:(NSString *)itemId price:(double)price quantity:(double)quantity; 15 | 16 | + (instancetype)itemWithItemId:(NSString *)itemId price:(double)price quantity:(double)quantity; 17 | 18 | 19 | @end -------------------------------------------------------------------------------- /Sources/include/EMSCartItemProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @protocol EMSCartItemProtocol 7 | 8 | - (NSString *)itemId; 9 | 10 | - (double)price; 11 | 12 | - (double)quantity; 13 | 14 | @end -------------------------------------------------------------------------------- /Sources/include/EMSConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSConfigBuilder.h" 7 | 8 | @protocol EMSFlipperFeature; 9 | @protocol EMSLogLevelProtocol; 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface EMSConfig : NSObject 14 | 15 | @property(nonatomic, readonly) NSString *applicationCode; 16 | @property(nonatomic, readonly) NSArray> *experimentalFeatures; 17 | @property(nonatomic, readonly) NSArray> *enabledConsoleLogLevels; 18 | @property(nonatomic, readonly) NSString *merchantId; 19 | @property(nonatomic, readonly) NSString *sharedKeychainAccessGroup; 20 | 21 | typedef void(^MEConfigBuilderBlock)(EMSConfigBuilder *builder); 22 | 23 | + (EMSConfig *)makeWithBuilder:(MEConfigBuilderBlock)builderBlock; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/include/EMSCustomEventActionModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSActionModelProtocol.h" 7 | 8 | NS_ASSUME_NONNULL_BEGIN 9 | 10 | @interface EMSCustomEventActionModel : NSObject 11 | 12 | @property(nonatomic, readonly) NSString *id; 13 | @property(nonatomic, readonly) NSString *title; 14 | @property(nonatomic, readonly) NSString *type; 15 | @property(nonatomic, readonly) NSString *name; 16 | @property(nonatomic, readonly, nullable) NSDictionary *payload; 17 | 18 | - (instancetype)initWithId:(NSString *)id 19 | title:(NSString *)title 20 | type:(NSString *)type 21 | name:(NSString *)name 22 | payload:(NSDictionary *)payload; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /Sources/include/EMSDismissActionModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSActionModelProtocol.h" 7 | 8 | NS_ASSUME_NONNULL_BEGIN 9 | 10 | @interface EMSDismissActionModel : NSObject 11 | 12 | @property(nonatomic, readonly) NSString *id; 13 | @property(nonatomic, readonly) NSString *title; 14 | @property(nonatomic, readonly) NSString *type; 15 | 16 | - (instancetype)initWithId:(NSString *)id 17 | title:(NSString *)title 18 | type:(NSString *)type; 19 | 20 | @end 21 | 22 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/include/EMSFlipperFeatures.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @protocol EMSFlipperFeature 8 | 9 | - (NSString *)name; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/include/EMSGeofence.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @class EMSGeofenceTrigger; 8 | 9 | @interface EMSGeofence : NSObject 10 | 11 | @property(nonatomic, strong) NSString *id; 12 | @property(nonatomic, assign) double lat; 13 | @property(nonatomic, assign) double lon; 14 | @property(nonatomic, assign) int r; 15 | @property(nonatomic, assign) double waitInterval; 16 | @property(nonatomic, strong) NSArray *triggers; 17 | 18 | - (instancetype)initWithId:(NSString *)id 19 | lat:(double)lat 20 | lon:(double)lon 21 | r:(int)r 22 | waitInterval:(double)waitInterval 23 | triggers:(NSArray *)triggers; 24 | 25 | @end -------------------------------------------------------------------------------- /Sources/include/EMSGeofenceProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSBlocks.h" 7 | 8 | @class EMSGeofence; 9 | 10 | NS_ASSUME_NONNULL_BEGIN 11 | 12 | @protocol EMSGeofenceProtocol 13 | 14 | @property(nonatomic, strong) EMSEventHandlerBlock eventHandler; 15 | @property(nonatomic, assign) BOOL initialEnterTriggerEnabled; 16 | 17 | - (void)requestAlwaysAuthorization; 18 | - (void)requestWhenInUseAuthorization; 19 | - (NSArray *) registeredGeofences; 20 | 21 | - (void)enable; 22 | - (void)enableWithCompletionBlock:(_Nullable EMSCompletionBlock)completionBlock 23 | NS_SWIFT_NAME(enable(completionBlock:)); 24 | - (void)disable; 25 | - (BOOL)isEnabled; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /Sources/include/EMSGeofenceTrigger.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @interface EMSGeofenceTrigger : NSObject 8 | 9 | @property(nonatomic, strong) NSString *id; 10 | @property(nonatomic, strong) NSString *type; 11 | @property(nonatomic, assign) int loiteringDelay; 12 | @property(nonatomic, strong) NSDictionary *action; 13 | 14 | - (instancetype)initWithId:(NSString *)id 15 | type:(NSString *)type 16 | loiteringDelay:(int)loiteringDelay 17 | action:(NSDictionary *)action; 18 | 19 | @end -------------------------------------------------------------------------------- /Sources/include/EMSInAppProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSBlocks.h" 6 | 7 | @protocol EMSInAppProtocol 8 | 9 | @property(nonatomic, strong) EMSEventHandlerBlock eventHandler; 10 | 11 | - (void)pause; 12 | 13 | - (void)resume; 14 | 15 | - (BOOL)isPaused; 16 | 17 | @end -------------------------------------------------------------------------------- /Sources/include/EMSInboxResult.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSMessage.h" 7 | 8 | @interface EMSInboxResult : NSObject 9 | 10 | @property(nonatomic, strong) NSArray *messages; 11 | 12 | @end -------------------------------------------------------------------------------- /Sources/include/EMSInboxTag.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | static NSString *const EMSInboxTagOpened = @"opened"; 8 | static NSString *const EMSInboxTagSeen = @"seen"; 9 | static NSString *const EMSInboxTagDeleted = @"deleted"; 10 | static NSString *const EMSInboxTagPinned = @"pinned"; 11 | 12 | @interface EMSInboxTag : NSObject 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Sources/include/EMSInlineInAppView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSBlocks.h" 7 | 8 | @interface EMSInlineInAppView: UIView 9 | 10 | @property(nonatomic, strong) EMSEventHandlerBlock eventHandler; 11 | @property(nonatomic, strong) EMSCompletionBlock completionBlock; 12 | @property(nonatomic, strong) EMSInlineInappViewCloseBlock closeBlock; 13 | 14 | - (void)loadInAppWithViewId:(NSString *)viewId 15 | NS_SWIFT_NAME(loadInApp(viewId:)); 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Sources/include/EMSLogLevel.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSLogLevelProtocol.h" 7 | 8 | @interface EMSLogLevel : NSObject 9 | 10 | @property(class, nonatomic, readonly) id trace; 11 | @property(class, nonatomic, readonly) id debug; 12 | @property(class, nonatomic, readonly) id info; 13 | @property(class, nonatomic, readonly) id warn; 14 | @property(class, nonatomic, readonly) id error; 15 | @property(class, nonatomic, readonly) id basic; 16 | 17 | @end -------------------------------------------------------------------------------- /Sources/include/EMSLogLevelProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @protocol EMSLogLevelProtocol 8 | 9 | - (NSString *)level; 10 | 11 | @end -------------------------------------------------------------------------------- /Sources/include/EMSLogicProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @protocol EMSLogicProtocol 8 | 9 | - (NSString *)logic; 10 | 11 | - (NSDictionary *)data; 12 | 13 | - (NSArray *)variants; 14 | 15 | @end -------------------------------------------------------------------------------- /Sources/include/EMSNotificationInformation.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface EMSNotificationInformation : NSObject 10 | 11 | @property(nonatomic, readonly) NSString *campaignId; 12 | 13 | - (instancetype)initWithCampaignId:(NSString *)campaignId; 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Sources/include/EMSNotificationService.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2017. Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | @interface EMSNotificationService : UNNotificationServiceExtension 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Sources/include/EMSOnEventActionProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSBlocks.h" 7 | 8 | @protocol EMSOnEventActionProtocol 9 | 10 | @property(nonatomic, strong, nullable) EMSEventHandlerBlock eventHandler; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /Sources/include/EMSOpenExternalUrlActionModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSActionModelProtocol.h" 7 | 8 | NS_ASSUME_NONNULL_BEGIN 9 | 10 | @interface EMSOpenExternalUrlActionModel : NSObject 11 | 12 | @property(nonatomic, readonly) NSString *id; 13 | @property(nonatomic, readonly) NSString *title; 14 | @property(nonatomic, readonly) NSString *type; 15 | @property(nonatomic, readonly) NSURL *url; 16 | 17 | - (instancetype)initWithId:(NSString *)id 18 | title:(NSString *)title 19 | type:(NSString *)type 20 | url:(NSURL *)url; 21 | 22 | @end 23 | 24 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/include/EMSProduct.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSProductProtocol.h" 6 | 7 | NS_ASSUME_NONNULL_BEGIN 8 | 9 | @interface EMSProduct : NSObject 10 | 11 | @end 12 | 13 | NS_ASSUME_NONNULL_END -------------------------------------------------------------------------------- /Sources/include/EMSRecommendationFilterProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | 6 | @protocol EMSRecommendationFilterProtocol 7 | 8 | - (NSString *)type; 9 | 10 | - (NSString *)field; 11 | 12 | - (NSString *)comparison; 13 | 14 | - (NSArray *)expectations; 15 | 16 | @end -------------------------------------------------------------------------------- /Tests/CoreTests.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Tests/CoreTests/Crypto/EMS11-C3FD3.json: -------------------------------------------------------------------------------- 1 | {"serviceUrls":{"eventService":"https://mobile-events.eservice.emarsys.net","clientService":"https://me-client.eservice.emarsys.net"},"logLevel":"ERROR","luckyLogger":{"logLevel":"DEBUG","threshold":0.2},"features":{"mobileEngage":true,"experimentalFeature1":false},"overrides":{"hardwareId1":{"serviceUrls":{"eventService":"https://mobile-events-2.eservice.emarsys.net"},"logLevel":"TRACE","features":{"inApp":false}},"hardwareId2":{"serviceUrls":{"eventService":"https://mobile-events-2.eservice.emarsys.net","clientService":"https://me-client.eservice.emarsys.net"},"logLevel":"DEBUG","features":{"mobileEngage":false,"experimentalFeature1":false}}}} -------------------------------------------------------------------------------- /Tests/CoreTests/Crypto/EMS11-C3FD3.sig: -------------------------------------------------------------------------------- 1 | MEUCIDkPyn4ISGE+rpeqsHWzwW/vN9Szykm40l63nEJUalSiAiEAyX2E+LlgHHbl5TbWOTN/i3r5zD7H13CoMRkXhECVhIk= -------------------------------------------------------------------------------- /Tests/CoreTests/Database/EMSSQLiteHelper+Test.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSSQLiteHelper.h" 6 | 7 | @interface EMSSQLiteHelper (Test) 8 | 9 | - (instancetype)initWithSqlite3Db:(sqlite3 *)db 10 | schemaDelegate:(id )schemaDelegate 11 | operationQueue:(NSOperationQueue *)operationQueue; 12 | @end 13 | -------------------------------------------------------------------------------- /Tests/CoreTests/Database/EMSTestColumnInfoMapper.h: -------------------------------------------------------------------------------- 1 | //// 2 | // 3 | // Copyright © 2024 Emarsys-Technologies Kft. All rights reserved. 4 | // 5 | 6 | #import 7 | #import "EMSModelMapperProtocol.h" 8 | 9 | NS_ASSUME_NONNULL_BEGIN 10 | 11 | @interface EMSTestColumnInfoMapper: NSObject 12 | 13 | - (instancetype)initWithTableName:(NSString *)tableName; 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Tests/CoreTests/EMSDefaultWorker+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSDefaultWorker.h" 7 | #import "EMSRESTClient.h" 8 | 9 | @interface EMSDefaultWorker (Private) 10 | 11 | - (void)setConnectionWatchdog:(EMSConnectionWatchdog *)connectionWatchdog; 12 | 13 | - (void)setRepository:(id )repository; 14 | 15 | - (void)setClient:(EMSRESTClient *)client; 16 | 17 | - (EMSRESTClient *)client; 18 | 19 | - (EMSRequestModel *)nextNonExpiredModel; 20 | 21 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeCompletionHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSCoreCompletion.h" 7 | 8 | @interface FakeCompletionHandler : NSObject 9 | 10 | @property(nonatomic, strong, readonly) CoreSuccessBlock successBlock; 11 | @property(nonatomic, strong, readonly) CoreErrorBlock errorBlock; 12 | 13 | @property(nonatomic, strong, readonly) NSNumber *successCount; 14 | @property(nonatomic, strong, readonly) NSNumber *errorCount; 15 | 16 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeCompletionHandler.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "FakeCompletionHandler.h" 6 | 7 | @implementation FakeCompletionHandler 8 | 9 | - (instancetype)init { 10 | if (self = [super init]) { 11 | _successCount = @0; 12 | _errorCount = @0; 13 | _successBlock = ^(NSString *requestId, EMSResponseModel *response) { 14 | _successCount = @([_successCount intValue] + 1); 15 | }; 16 | _errorBlock = ^(NSString *requestId, NSError *error) { 17 | _errorCount = @([_errorCount intValue] + 1); 18 | }; 19 | } 20 | return self; 21 | } 22 | 23 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeConnectionChangeListener.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSConnectionWatchdog.h" 6 | 7 | typedef void (^FakeConnectionChangeListenerCompletionBlock)(NSOperationQueue *currentQueue); 8 | 9 | @interface FakeConnectionChangeListener : NSObject 10 | 11 | @property(nonatomic, assign) EMSNetworkStatus networkStatus; 12 | @property(nonatomic, assign) BOOL connected; 13 | 14 | - (instancetype)initWithCompletionBlock:(FakeConnectionChangeListenerCompletionBlock)completionBlock; 15 | 16 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeConnectionWatchdog.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import 7 | #import "EMSConnectionWatchdog.h" 8 | 9 | @interface FakeConnectionWatchdog : EMSConnectionWatchdog 10 | 11 | @property(nonatomic, strong) NSNumber *isConnectedCallCount; 12 | 13 | - (instancetype)initWithOperationQueue:(NSOperationQueue *)operationQueue 14 | connectionResponses:(NSArray *)connectionResponses 15 | expectation:(XCTestExpectation *)expectation; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeDBTrigger.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import 6 | #import "EMSDBTriggerProtocol.h" 7 | 8 | typedef void (^TriggerAction)(void); 9 | 10 | @interface FakeDBTrigger : NSObject 11 | 12 | - (instancetype)initWithExpectation:(XCTestExpectation *)expectation; 13 | 14 | - (instancetype)initWithExpectation:(XCTestExpectation *)expectation triggerAction:(TriggerAction)triggerAction; 15 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeFlipperFeature.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSFlipperFeatures.h" 6 | 7 | @interface FakeFlipperFeature : NSObject 8 | 9 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeFlipperFeature.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import "FakeFlipperFeature.h" 5 | 6 | @implementation FakeFlipperFeature 7 | 8 | - (NSString *)name { 9 | return @"FakeFlipperFeature"; 10 | } 11 | 12 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeRESTClientCompletionProxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSRESTClientCompletionProxyProtocol.h" 6 | 7 | @interface FakeRESTClientCompletionProxy : NSObject 8 | 9 | @property(nonatomic, strong) EMSRESTClientCompletionBlock completionBlock; 10 | 11 | - (instancetype)initWithCompletionBlock:(EMSRESTClientCompletionBlock)completionBlock; 12 | 13 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeRESTClientCompletionProxy.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import "FakeRESTClientCompletionProxy.h" 5 | 6 | @implementation FakeRESTClientCompletionProxy 7 | 8 | - (instancetype)initWithCompletionBlock:(EMSRESTClientCompletionBlock)completionBlock { 9 | if (self = [super init]) { 10 | self.completionBlock = completionBlock; 11 | } 12 | return self; 13 | } 14 | 15 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeRequestModelMapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSRequestModelMapperProtocol.h" 6 | 7 | @interface FakeRequestModelMapper : NSObject 8 | 9 | @property(nonatomic, strong) EMSRequestModel *returningValue; 10 | @property(nonatomic, strong) EMSRequestModel *inputValue; 11 | @property(nonatomic, assign) BOOL shouldHandle; 12 | 13 | - (instancetype)initWithShouldHandle:(BOOL)shouldHandle 14 | returningValue:(EMSRequestModel *)returningValue; 15 | 16 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeRequestModelMapper.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import "FakeRequestModelMapper.h" 5 | 6 | @implementation FakeRequestModelMapper 7 | 8 | - (instancetype)initWithShouldHandle:(BOOL)shouldHandle 9 | returningValue:(EMSRequestModel *)returningValue { 10 | if (self = [super init]) { 11 | _returningValue = returningValue; 12 | _shouldHandle = shouldHandle; 13 | } 14 | return self; 15 | } 16 | 17 | - (BOOL)shouldHandleWithRequestModel:(EMSRequestModel *)requestModel { 18 | return self.shouldHandle; 19 | } 20 | 21 | - (EMSRequestModel *)modelFromModel:(EMSRequestModel *)requestModel { 22 | _inputValue = requestModel; 23 | return self.returningValue; 24 | } 25 | 26 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeSQLSpecification.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSSQLSpecificationProtocol.h" 6 | 7 | @interface FakeSQLSpecification : NSObject 8 | 9 | @property(nonatomic, strong) NSString *selection; 10 | @property(nonatomic, strong) NSArray *selectionArgs; 11 | @property(nonatomic, strong) NSString *orderBy; 12 | @property(nonatomic, strong) NSString *limit; 13 | 14 | - (instancetype)initWithSelection:(NSString *)selection 15 | selectionArgs:(NSArray *)selectionArgs 16 | orderBy:(NSString *)orderBy 17 | limit:(NSString *)limit; 18 | 19 | 20 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeSQLSpecification.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import "FakeSQLSpecification.h" 5 | 6 | 7 | @implementation FakeSQLSpecification 8 | 9 | - (instancetype)initWithSelection:(NSString *)selection 10 | selectionArgs:(NSArray *)selectionArgs 11 | orderBy:(NSString *)orderBy 12 | limit:(NSString *)limit { 13 | if (self = [super init]) { 14 | self.selection = selection; 15 | self.selectionArgs = selectionArgs; 16 | self.orderBy = orderBy; 17 | self.limit = limit; 18 | } 19 | 20 | return self; 21 | } 22 | 23 | - (NSString *)sql { 24 | return nil; 25 | } 26 | 27 | - (void)bindStatement:(sqlite3_stmt *)statement { 28 | 29 | } 30 | 31 | 32 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeShardRepository.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSShardRepositoryProtocol.h" 6 | 7 | typedef void (^FakeCompletionBlock)(NSOperationQueue *currentQueue); 8 | 9 | @interface FakeShardRepository : NSObject 10 | 11 | @property(nonatomic, strong) FakeCompletionBlock completionBlock; 12 | 13 | - (instancetype)initWithCompletionBlock:(FakeCompletionBlock)completionBlock; 14 | 15 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeShardRepository.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import "FakeShardRepository.h" 5 | 6 | @implementation FakeShardRepository 7 | 8 | - (instancetype)initWithCompletionBlock:(FakeCompletionBlock)completionBlock { 9 | if (self = [super init]) { 10 | _completionBlock = completionBlock; 11 | } 12 | return self; 13 | } 14 | 15 | 16 | - (void)add:(EMSShard *)item { 17 | [self complete]; 18 | } 19 | 20 | - (void)remove:(id )sqlSpecification { 21 | [self complete]; 22 | } 23 | 24 | - (NSArray *)query:(id )sqlSpecification { 25 | [self complete]; 26 | return nil; 27 | } 28 | 29 | - (BOOL)isEmpty { 30 | [self complete]; 31 | return NO; 32 | } 33 | 34 | - (void)complete { 35 | self.completionBlock([NSOperationQueue currentQueue]); 36 | } 37 | 38 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeTimeStampProvider.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSTimestampProvider.h" 6 | 7 | @interface FakeTimeStampProvider : EMSTimestampProvider 8 | 9 | @property(nonatomic, strong) NSArray *timestamps; 10 | 11 | - (instancetype)initWithTimestamps:(NSArray *)timestamps; 12 | 13 | + (instancetype)providerWithTimestamps:(NSArray *)timestamps; 14 | 15 | 16 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Fake/FakeTimeStampProvider.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import "FakeTimeStampProvider.h" 5 | 6 | @implementation FakeTimeStampProvider { 7 | NSUInteger _timestampIndex; 8 | } 9 | 10 | - (instancetype)initWithTimestamps:(NSArray *)timestamps { 11 | self = [super init]; 12 | if (self) { 13 | self.timestamps = timestamps; 14 | } 15 | 16 | return self; 17 | } 18 | 19 | + (instancetype)providerWithTimestamps:(NSArray *)timestamps { 20 | return [[self alloc] initWithTimestamps:timestamps]; 21 | } 22 | 23 | - (NSDate *)provideTimestamp { 24 | NSDate *result; 25 | if (self.timestamps) { 26 | result = self.timestamps[_timestampIndex]; 27 | if (_timestampIndex < self.timestamps.count - 1) { 28 | _timestampIndex++; 29 | } 30 | } 31 | return result; 32 | } 33 | 34 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Flipper/MEExperimental+Test.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "MEExperimental.h" 7 | 8 | @interface MEExperimental (Test) 9 | 10 | + (void)reset; 11 | 12 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Log/EMSLogLevelTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSLogLevel.h" 7 | 8 | @interface EMSLogLevelTests : XCTestCase 9 | 10 | @end 11 | 12 | @implementation EMSLogLevelTests 13 | 14 | - (void)testLogLevel { 15 | XCTAssertEqualObjects(@"TRACE", EMSLogLevel.trace.level); 16 | XCTAssertEqualObjects(@"DEBUG", EMSLogLevel.debug.level); 17 | XCTAssertEqualObjects(@"INFO", EMSLogLevel.info.level); 18 | XCTAssertEqualObjects(@"WARN", EMSLogLevel.warn.level); 19 | XCTAssertEqualObjects(@"ERROR", EMSLogLevel.error.level); 20 | XCTAssertEqualObjects(@"BASIC", EMSLogLevel.basic.level); 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Tests/CoreTests/Log/LogEntry/EMSOfflineQueueSizeTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2019 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSOfflineQueueSize.h" 7 | 8 | @interface EMSOfflineQueueSizeTests : XCTestCase 9 | 10 | @end 11 | 12 | @implementation EMSOfflineQueueSizeTests 13 | 14 | - (void)testTopic { 15 | EMSOfflineQueueSize *queueSize = [[EMSOfflineQueueSize alloc] initWithQueueSize:0]; 16 | XCTAssertEqualObjects(queueSize.topic, @"log_offline_queue_size"); 17 | } 18 | 19 | - (void)testData { 20 | NSDictionary *expectedData = @{ 21 | @"offlineQueueSize": @"1", 22 | }; 23 | 24 | EMSOfflineQueueSize *queueSize = [[EMSOfflineQueueSize alloc] initWithQueueSize:1]; 25 | XCTAssertEqualObjects(queueSize.data, expectedData); 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Tests/CoreTests/Providers/EMSRandomProviderTest.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSRandomProvider.h" 7 | 8 | @interface EMSRandomProviderTest : XCTestCase 9 | 10 | @end 11 | 12 | @implementation EMSRandomProviderTest 13 | 14 | - (void)testProvideDoubleUntil { 15 | EMSRandomProvider *randomProvider = [EMSRandomProvider new]; 16 | NSNumber *result = [randomProvider provideDoubleUntil:@50]; 17 | 18 | XCTAssertGreaterThanOrEqual([result doubleValue], [@0 doubleValue]); 19 | XCTAssertLessThan([result doubleValue], [@50 doubleValue]); 20 | } 21 | 22 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Providers/EMSTimestampProviderTests.m: -------------------------------------------------------------------------------- 1 | #import "Kiwi.h" 2 | #import "EMSTimestampProvider.h" 3 | 4 | SPEC_BEGIN(EMSTimestampProviderTests) 5 | 6 | describe(@"TimestampProvider:provideTimestamp", ^{ 7 | 8 | it(@"should return the current timestamp", ^{ 9 | NSDate *before = [NSDate date]; 10 | NSDate *timestamp = [[EMSTimestampProvider new] provideTimestamp]; 11 | NSDate *after = [NSDate date]; 12 | [[timestamp should] beBetween:before and:after]; 13 | }); 14 | 15 | }); 16 | 17 | SPEC_END -------------------------------------------------------------------------------- /Tests/CoreTests/Providers/EMSUUIDProviderTests.m: -------------------------------------------------------------------------------- 1 | #import "Kiwi.h" 2 | #import "EMSUUIDProvider.h" 3 | 4 | SPEC_BEGIN(EMSUUIDProviderTests) 5 | 6 | describe(@"provideUUIDString", ^{ 7 | 8 | it(@"should not return with nil", ^{ 9 | [[[[EMSUUIDProvider new] provideUUIDString] shouldNot] beNil]; 10 | }); 11 | 12 | it(@"should return with UUID", ^{ 13 | [[[[EMSUUIDProvider new] provideUUIDString] should] beKindOfClass:[NSString class]]; 14 | }); 15 | 16 | }); 17 | 18 | SPEC_END -------------------------------------------------------------------------------- /Tests/CoreTests/Utils/EMSSession+Tests.h: -------------------------------------------------------------------------------- 1 | //// 2 | // 3 | // Copyright © 2024 Emarsys-Technologies Kft. All rights reserved. 4 | // 5 | 6 | #import "EMSSession.h" 7 | 8 | #ifndef EMSSession_Tests_h 9 | #define EMSSession_Tests_h 10 | 11 | @interface EMSSession (Tests) 12 | 13 | @property(nonatomic, strong) NSMutableArray *observers; 14 | 15 | @end 16 | 17 | #endif /* EMSSession_Tests_h */ 18 | -------------------------------------------------------------------------------- /Tests/CoreTests/Utils/EMSWaiter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import 7 | 8 | 9 | @interface EMSWaiter : NSObject 10 | 11 | + (void)waitForExpectations:(NSArray *)expectations; 12 | + (void)waitForExpectations:(NSArray *)expectations timeout:(NSTimeInterval)seconds; 13 | 14 | + (void)waitForTimeout:(NSArray *)expectations timeout:(NSTimeInterval)seconds; 15 | 16 | @end -------------------------------------------------------------------------------- /Tests/CoreTests/Utils/EMSWaiter.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import "EMSWaiter.h" 5 | #import 6 | 7 | @implementation EMSWaiter 8 | 9 | + (void)waitForExpectations:(NSArray *)expectations { 10 | [EMSWaiter waitForExpectations:expectations 11 | timeout:10]; 12 | } 13 | 14 | + (void)waitForExpectations:(NSArray *)expectations timeout:(NSTimeInterval)seconds { 15 | XCTWaiterResult result = [XCTWaiter waitForExpectations:expectations timeout:seconds]; 16 | XCTAssertEqual(result, XCTWaiterResultCompleted); 17 | } 18 | 19 | + (void)waitForTimeout:(NSArray *)expectations timeout:(NSTimeInterval)seconds { 20 | XCTWaiterResult result = [XCTWaiter waitForExpectations:expectations timeout:seconds]; 21 | XCTAssertEqual(result, XCTWaiterResultTimedOut); 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Tests/CoreTests/Utils/Emarsys+Tests.h: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // Copyright © 2024 Emarsys-Technologies Kft. All rights reserved. 4 | // 5 | 6 | #ifndef Emarsys_Tests_h 7 | #define Emarsys_Tests_h 8 | 9 | @interface Emarsys (Tests) 10 | 11 | + (void) resetDispatchOnce; 12 | 13 | @end 14 | 15 | 16 | #endif /* Emarsys_Tests_h */ 17 | -------------------------------------------------------------------------------- /Tests/CoreTests/Utils/TestUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | 7 | 8 | #define itShouldThrowException(reasonString, exceptionBlock) [TestUtils assertForException:exceptionBlock reason:reasonString] 9 | #define xitShouldThrowException(reasonString, exceptionBlock) 10 | 11 | @interface TestUtils : NSObject 12 | 13 | + (void)assertForException:(void (^)(void))exceptionBlock reason:(NSString *)reasonString; 14 | @end 15 | -------------------------------------------------------------------------------- /Tests/CoreTests/Utils/TestUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "TestUtils.h" 6 | #import "Kiwi.h" 7 | 8 | @implementation TestUtils 9 | 10 | + (void)assertForException:(void (^)(void))exceptionBlock reason:(NSString *)reasonString { 11 | it(reasonString, ^{ 12 | @try { 13 | exceptionBlock(); 14 | fail(reasonString); 15 | }@catch (NSException *exception){ 16 | [[theValue(exception) shouldNot] beNil]; 17 | } 18 | }); 19 | } 20 | 21 | 22 | @end -------------------------------------------------------------------------------- /Tests/E2ETests-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import "Emarsys.h" 6 | #import "EmarsysTestUtils.h" 7 | -------------------------------------------------------------------------------- /Tests/E2ETests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Tests/EMSTestPrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // Copyright © 2018. Emarsys. All rights reserved. 2 | // 3 | 4 | #ifndef EMSPrefixHeader_pch 5 | #define EMSPrefixHeader_pch 6 | 7 | #define IGNORE_NONNULL_BEGIN \ 8 | _Pragma("clang diagnostic push") \ 9 | _Pragma("clang diagnostic ignored \"-Wnonnull\"") 10 | #define IGNORE_NONNULL_END _Pragma("clang diagnostic pop") 11 | 12 | #endif /* EMSPrefixHeader_pch */ 13 | -------------------------------------------------------------------------------- /Tests/EmarsysSDKTests-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import "Emarsys.h" 6 | #import "EmarsysTestUtils.h" 7 | -------------------------------------------------------------------------------- /Tests/EmarsysSDKTests/EventHandler/EMSEventHandlerProtocolBlockConverterTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSEventHandlerProtocolBlockConverter.h" 7 | 8 | @interface EMSEventHandlerProtocolBlockConverterTests : XCTestCase 9 | 10 | @end 11 | 12 | @implementation EMSEventHandlerProtocolBlockConverterTests 13 | 14 | - (void)testInit { 15 | XCTAssertNotNil([EMSEventHandlerProtocolBlockConverter new].eventHandler); 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Tests/EmarsysSDKTests/Fake/FakeRequestManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2019 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSRequestManager.h" 6 | 7 | @interface FakeRequestManager : EMSRequestManager 8 | 9 | - (instancetype)initWithSubmitNowCompletionBlock:(EMSCompletion)completionBlock; 10 | 11 | @property(nonatomic, strong) EMSRequestModel *submitNowRequestModel; 12 | @property(nonatomic, strong) EMSRequestModel *submittedRequestModel; 13 | @property(nonatomic) CoreSuccessBlock successBlock; 14 | @property(nonatomic) CoreErrorBlock errorBlock; 15 | 16 | @end -------------------------------------------------------------------------------- /Tests/EmarsysSDKTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Tests/EmarsysSDKTests/Setup/EMSConfigTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2019 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSConfig.h" 7 | 8 | @interface EMSConfigTests : XCTestCase 9 | 10 | @end 11 | 12 | @implementation EMSConfigTests 13 | 14 | - (void)testMakeWithBuilder_builderBlock_mustNotBeNil { 15 | @try { 16 | [EMSConfig makeWithBuilder:nil]; 17 | XCTFail(@"Expected Exception when builderBlock is nil!"); 18 | } @catch (NSException *exception) { 19 | XCTAssertEqualObjects(exception.reason, @"Invalid parameter not satisfying: builderBlock"); 20 | } 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Tests/MobileEngageTests-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import "EMSActionFactory.h" 6 | #import "EMSActionProtocol.h" 7 | #import "EMSOnEventResponseHandler.h" 8 | -------------------------------------------------------------------------------- /Tests/MobileEngageTests.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Category/NSData+MobileEngageTest.m: -------------------------------------------------------------------------------- 1 | #import "Kiwi.h" 2 | #import "NSData+MobileEngine.h" 3 | 4 | SPEC_BEGIN(NSDataMobileEngageTests) 5 | 6 | describe(@"deviceTokenString", ^{ 7 | 8 | it(@"should transform data into string", ^{ 9 | char *rawData = "1234512345ABCDEF"; 10 | NSData *deviceToken = [NSData dataWithBytes:rawData length:sizeof(rawData)]; 11 | NSMutableString *token = [NSMutableString new]; 12 | const char *data = [deviceToken bytes]; 13 | for (int i = 0; i < deviceToken.length; ++i) { 14 | [token appendFormat:@"%02.2hhx", data[i]]; 15 | } 16 | [[[deviceToken deviceTokenString] should] equal:token]; 17 | }); 18 | 19 | }); 20 | 21 | SPEC_END 22 | -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeCommand.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "MEIAMJSCommandProtocol.h" 7 | 8 | @interface FakeCommand : NSObject 9 | 10 | @property (nonatomic, strong) void (^completionBlock)(void); 11 | 12 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeCommand.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "FakeCommand.h" 6 | 7 | 8 | @implementation FakeCommand 9 | 10 | + (NSString *)commandName { 11 | return @"FakeCommand"; 12 | } 13 | 14 | - (void)handleMessage:(NSDictionary *)message 15 | resultBlock:(MEIAMJSResultBlock)resultBlock { 16 | self.completionBlock(); 17 | } 18 | 19 | 20 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeDbHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSSQLiteHelperProtocol.h" 7 | 8 | @interface FakeDbHelper : NSObject 9 | 10 | @property (nonatomic, strong) void (^closeOperationQueueBlock)(NSOperationQueue *operationQueue); 11 | 12 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeDisplayedIAMRepository.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2020 Emarsys. All rights reserved. 3 | // 4 | 5 | import Foundation 6 | 7 | class FakeDisplayedIAMRepository: NSObject, EMSRepositoryProtocol { 8 | var addedItem: MEDisplayedIAM? 9 | var calledAdd: Bool = false 10 | 11 | func add(_ item: Any) { 12 | self.addedItem = item as! MEDisplayedIAM 13 | self.calledAdd = true 14 | } 15 | 16 | func remove(_ sqlSpecification: EMSSQLSpecificationProtocol!) { 17 | } 18 | 19 | func query(_ sqlSpecification: EMSSQLSpecificationProtocol!) -> [Any]! { 20 | fatalError("query(_:) has not been implemented") 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeInAppTracker.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "MEInAppTrackingProtocol.h" 6 | #import 7 | 8 | @interface FakeInAppTracker : NSObject 9 | 10 | @property(nonatomic, strong) MEInAppMessage *inAppMessage; 11 | @property(nonatomic, strong) NSString *buttonId; 12 | @property(nonatomic, strong) NSOperationQueue *displayOperationQueue; 13 | 14 | - (instancetype)initWithDisplayExpectation:(XCTestExpectation *)displayExpectation 15 | clickExpectation:(XCTestExpectation *)clickExpectation; 16 | 17 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeInboxNotificationRequestManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSRequestManager.h" 7 | 8 | typedef enum { 9 | ResultTypeSuccess, 10 | ResultTypeFailure 11 | } ResultType; 12 | 13 | @interface FakeInboxNotificationRequestManager : EMSRequestManager 14 | 15 | @property (nonatomic, strong) NSMutableArray *submittedRequests; 16 | 17 | - (instancetype)initWithResultType:(ResultType)resultType; 18 | - (instancetype)initWithSuccessResults:(NSArray *> *)results; 19 | 20 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeJSBridge.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "MEJSBridge.h" 7 | 8 | typedef void (^FakeMessageBlock)(WKScriptMessage *result); 9 | 10 | @interface FakeJSBridge : MEJSBridge 11 | 12 | - (instancetype)initWithMessageBlock:(FakeMessageBlock)messageBlock; 13 | 14 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeJSBridge.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "FakeJSBridge.h" 6 | 7 | @interface FakeJSBridge () 8 | 9 | @property(nonatomic, strong) FakeMessageBlock messageBlock; 10 | 11 | @end 12 | 13 | @implementation FakeJSBridge 14 | 15 | 16 | - (instancetype)initWithMessageBlock:(FakeMessageBlock)messageBlock { 17 | if (self = [super init]) { 18 | _messageBlock = messageBlock; 19 | } 20 | return self; 21 | } 22 | 23 | 24 | - (NSArray *)jsCommandNames { 25 | return @[@"IAMDidAppear"]; 26 | } 27 | 28 | - (void)userContentController:(WKUserContentController *)userContentController 29 | didReceiveScriptMessage:(WKScriptMessage *)message { 30 | 31 | self.messageBlock(message); 32 | 33 | } 34 | 35 | 36 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeNotificationDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import 7 | 8 | 9 | @interface FakeNotificationDelegate : NSObject 10 | 11 | @property(nonatomic, strong) void (^willPresentBlock)(NSOperationQueue *operationQueue); 12 | @property(nonatomic, strong) void (^didReceiveBlock)(NSOperationQueue *operationQueue); 13 | 14 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeNotificationDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "FakeNotificationDelegate.h" 6 | 7 | 8 | @implementation FakeNotificationDelegate 9 | 10 | - (void)userNotificationCenter:(UNUserNotificationCenter *)center 11 | willPresentNotification:(UNNotification *)notification 12 | withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler { 13 | if (self.willPresentBlock) { 14 | self.willPresentBlock([NSOperationQueue currentQueue]); 15 | } 16 | } 17 | 18 | - (void)userNotificationCenter:(UNUserNotificationCenter *)center 19 | didReceiveNotificationResponse:(UNNotificationResponse *)response 20 | withCompletionHandler:(void (^)(void))completionHandler { 21 | if (self.didReceiveBlock) { 22 | self.didReceiveBlock([NSOperationQueue currentQueue]); 23 | } 24 | } 25 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeRequestRepository.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSRequestModelRepository.h" 7 | 8 | @interface FakeRequestRepository : EMSRequestModelRepository 9 | 10 | @property (nonatomic, strong) NSDictionary *queryResponseMapping; 11 | @property (nonatomic, assign) BOOL isEmpty; 12 | 13 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeRequestRepository.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "FakeRequestRepository.h" 6 | 7 | 8 | @implementation FakeRequestRepository 9 | 10 | - (void)add:(EMSRequestModel *)item { 11 | } 12 | 13 | - (void)remove:(id )sqlSpecification { 14 | } 15 | 16 | - (NSArray *)query:(id )sqlSpecification { 17 | return self.queryResponseMapping[NSStringFromClass([((NSObject *) sqlSpecification) class])]; 18 | } 19 | 20 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeResponseHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSAbstractResponseHandler.h" 7 | 8 | @interface FakeResponseHandler : EMSAbstractResponseHandler 9 | 10 | @property (nonatomic, assign) BOOL shouldHandle; 11 | @property (nonatomic, strong) EMSResponseModel *handledResponseModel; 12 | 13 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeResponseHandler.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "FakeResponseHandler.h" 6 | 7 | 8 | @implementation FakeResponseHandler 9 | 10 | - (BOOL)shouldHandleResponse:(EMSResponseModel *)response { 11 | return _shouldHandle; 12 | } 13 | 14 | - (void)handleResponse:(EMSResponseModel *)response { 15 | _handledResponseModel = response; 16 | } 17 | 18 | 19 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeSpecification.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import 5 | #import "EMSSQLSpecificationProtocol.h" 6 | 7 | @interface FakeSpecification : NSObject 8 | @end 9 | -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Fakes/FakeSpecification.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import "FakeSpecification.h" 5 | 6 | 7 | @implementation FakeSpecification 8 | 9 | - (NSString *)sql { 10 | return nil; 11 | } 12 | 13 | - (void)bindStatement:(sqlite3_stmt *)statement { 14 | 15 | } 16 | 17 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/HandlerTests/EMSAbstractResponseHandler+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "EMSAbstractResponseHandler.h" 7 | 8 | @interface EMSAbstractResponseHandler (Private) 9 | 10 | - (BOOL)shouldHandleResponse:(EMSResponseModel *)response; 11 | - (void)handleResponse:(EMSResponseModel *)response; 12 | 13 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/IAM/EMSInAppProtocolTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "EmarsysTestUtils.h" 3 | 4 | @interface EMSInAppProtocolTests : XCTestCase 5 | 6 | @end 7 | 8 | @implementation EMSInAppProtocolTests 9 | 10 | - (void)setUp { 11 | [EmarsysTestUtils setupEmarsysWithFeatures:@[] 12 | withDependencyContainer:nil]; 13 | } 14 | 15 | - (void)tearDown { 16 | [EmarsysTestUtils tearDownEmarsys]; 17 | } 18 | 19 | - (void)testPause { 20 | [Emarsys.inApp pause]; 21 | 22 | XCTAssertTrue([Emarsys.inApp isPaused]); 23 | } 24 | 25 | - (void)testResume { 26 | [Emarsys.inApp resume]; 27 | 28 | XCTAssertFalse([Emarsys.inApp isPaused]); 29 | } 30 | 31 | - (void)testIsPaused { 32 | XCTAssertFalse([Emarsys.inApp isPaused]); 33 | } 34 | 35 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/MEIAMJSCommandTests/TestCommands/MEIAMDidAppear.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "MEIAMJSCommandProtocol.h" 7 | 8 | @interface MEIAMDidAppear : NSObject 9 | 10 | - (void)triggerResultBlockWithDictionary:(NSDictionary *)dictionary; 11 | 12 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/MEIAMJSCommandTests/TestCommands/MEIAMDidAppear.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import "MEIAMDidAppear.h" 6 | 7 | @interface MEIAMDidAppear () 8 | 9 | @property(nonatomic, strong) MEIAMJSResultBlock resultBlock; 10 | 11 | @end 12 | 13 | @implementation MEIAMDidAppear 14 | 15 | + (NSString *)commandName { 16 | return @"IAMDidAppear"; 17 | } 18 | 19 | - (void)handleMessage:(NSDictionary *)message 20 | resultBlock:(MEIAMJSResultBlock)resultBlock { 21 | _resultBlock = resultBlock; 22 | } 23 | 24 | - (void)triggerResultBlockWithDictionary:(NSDictionary *)dictionary { 25 | self.resultBlock(dictionary); 26 | } 27 | 28 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/OnEventAction/EMSOnEventActionInternalTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright © 2020. Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import 7 | #import "EMSOnEventActionInternal.h" 8 | 9 | @interface EMSOnEventActionInternalTests : XCTestCase 10 | 11 | @end 12 | 13 | @implementation EMSOnEventActionInternalTests 14 | 15 | - (void)testEventHandler { 16 | EMSEventHandlerBlock eventHandler = ^(NSString *eventName, NSDictionary *payload) { 17 | }; 18 | EMSActionFactory *mockActionFactory = OCMClassMock([EMSActionFactory class]); 19 | EMSOnEventActionInternal *eventActionInternal = [[EMSOnEventActionInternal alloc] initWithActionFactory:mockActionFactory]; 20 | 21 | eventActionInternal.eventHandler = eventHandler; 22 | 23 | OCMVerify([mockActionFactory setEventHandler: eventHandler]); 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Request/EMSRequestModelMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2017 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import "KWMatcher.h" 7 | #import "EMSRequestModel.h" 8 | 9 | 10 | @interface EMSRequestModelMatcher : KWMatcher 11 | 12 | - (void)beSimilarWithRequest:(EMSRequestModel *)model; 13 | 14 | @end -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Storage/DisplayedIAMTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import "EMSRequestModelBuilder.h" 5 | #import "Kiwi.h" 6 | #import "MEDisplayedIAM.h" 7 | #import "NSDate+EMSCore.h" 8 | 9 | SPEC_BEGIN(MEDisplayedIAMTests) 10 | 11 | describe(@"dictionaryRepresentation", ^{ 12 | it(@"should return correct dictionary", ^{ 13 | NSDate *date = [NSDate dateWithTimeIntervalSince1970:12345]; 14 | MEDisplayedIAM *display = [[MEDisplayedIAM alloc] initWithCampaignId:@"123" timestamp:date]; 15 | [[[display dictionaryRepresentation] should] equal:@{ 16 | @"campaignId" : @"123", 17 | @"timestamp" : date.stringValueInUTC 18 | }]; 19 | }); 20 | }); 21 | 22 | SPEC_END 23 | -------------------------------------------------------------------------------- /Tests/MobileEngageTests/Storage/MEButtonClickTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2018 Emarsys. All rights reserved. 3 | // 4 | #import "EMSRequestModelBuilder.h" 5 | #import "Kiwi.h" 6 | #import "MEButtonClick.h" 7 | #import "NSDate+EMSCore.h" 8 | 9 | SPEC_BEGIN(MEButtonClickTests) 10 | 11 | describe(@"dictionaryRepresentation", ^{ 12 | it(@"should return correct dictionary", ^{ 13 | NSDate *date = [NSDate dateWithTimeIntervalSince1970:12345]; 14 | MEButtonClick *click = [[MEButtonClick alloc] initWithCampaignId:@"123" buttonId:@"456" timestamp:date]; 15 | [[[click dictionaryRepresentation] should] equal:@{ 16 | @"campaignId" : @"123", 17 | @"buttonId" : @"456", 18 | @"timestamp" : date.stringValueInUTC 19 | }]; 20 | }); 21 | }); 22 | 23 | SPEC_END 24 | -------------------------------------------------------------------------------- /Tests/PredictTests-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import "EMSProductMapper.h" 6 | #import "EMSResponseModel.h" 7 | #import "EMSProduct.h" 8 | #import "EMSRequestModel.h" 9 | -------------------------------------------------------------------------------- /Tests/PredictTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Tests/Tests-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Use this file to import your target's public headers that you would like to expose to Swift. 3 | // 4 | 5 | #import "EMSProductMapper.h" 6 | #import "EMSResponseModel.h" 7 | #import "EMSProduct.h" 8 | #import "EMSRequestModel.h" 9 | #import "Emarsys.h" 10 | #import "EmarsysTestUtils.h" 11 | #import "EMSActionFactory.h" 12 | #import "EMSActionProtocol.h" 13 | #import "EMSAbstractResponseHandler+Private.h" 14 | #import "EMSAbstractResponseHandler.h" 15 | #import "MEDisplayedIAMRepository.h" 16 | #import "FakeRequestRepository.h" 17 | #import "MEDisplayedIAM.h" 18 | #import "EMSTimestampProvider.h" 19 | #import "EMSRequestFactory.h" 20 | #import "EMSRequestManager.h" 21 | #import "FakeRequestManager.h" 22 | #import "EMSUUIDProvider.h" 23 | #import "EMSOnEventResponseHandler.h" 24 | #import "EmarsysTestUtils.h" 25 | -------------------------------------------------------------------------------- /Tests/XCTestCase+Helper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2021 Emarsys. All rights reserved. 3 | // 4 | 5 | #import 6 | #import 7 | 8 | @interface XCTestCase (Helper) 9 | 10 | - (void)retryWithRunnerBlock:(void (^)(XCTestExpectation *expectation))runnerBlock 11 | assertionBlock:(void (^)(XCTWaiterResult waiterResult))assertionBlock 12 | retryCount:(NSInteger)retryCount; 13 | 14 | - (NSOperationQueue *)createTestOperationQueue; 15 | 16 | - (void)waitATickOnOperationQueue:(NSOperationQueue *)operationQueue; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /docs/antora.yml: -------------------------------------------------------------------------------- 1 | name: ios-emarsys-sdk 2 | title: iOS Emarsys SDK 3 | version: master 4 | start_page: ROOT:index.adoc 5 | nav: 6 | - modules/ROOT/nav.adoc 7 | -------------------------------------------------------------------------------- /docs/modules/ROOT/nav.adoc: -------------------------------------------------------------------------------- 1 | * https://github.com/emartech/ios-emarsys-sdk/wiki[Api] 2 | * xref:push.adoc[Push] 3 | -------------------------------------------------------------------------------- /docs/modules/ROOT/pages/index.adoc: -------------------------------------------------------------------------------- 1 | == Android Emarsys SDK 2 | 3 | https://github.com/emartech/ios-emarsys-sdk/blob/master/README.md[README] 4 | -------------------------------------------------------------------------------- /private-NSRelease.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VERSION_NUMBER=$1 4 | printf "Deploying version $VERSION_NUMBER to private cocoapods...\n"; 5 | 6 | TEMPLATE="`cat EmarsysNotificationService.podspec.template`" 7 | PODSPEC="${TEMPLATE//$VERSION_NUMBER}" 8 | COMMIT_HASH=$(git rev-parse HEAD) 9 | PODSPEC="${PODSPEC//:commit => '$COMMIT_HASH'}" 10 | printf "$PODSPEC" > EmarsysNotificationService.podspec 11 | 12 | pod repo push emapod EmarsysNotificationService.podspec --allow-warnings 13 | 14 | printf "[$VERSION_NUMBER] deployed to private cocoapod." 15 | -------------------------------------------------------------------------------- /private-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VERSION_NUMBER=$1 4 | printf "Deploying version $VERSION_NUMBER to private cocoapods...\n"; 5 | 6 | TEMPLATE="`cat EmarsysSDK.podspec.template`" 7 | PODSPEC="${TEMPLATE//$VERSION_NUMBER}" 8 | COMMIT_HASH=$(git rev-parse HEAD) 9 | PODSPEC="${PODSPEC//:commit => '$COMMIT_HASH'}" 10 | printf "$PODSPEC" > EmarsysSDK.podspec 11 | 12 | pod repo push emapod EmarsysSDK.podspec --allow-warnings 13 | 14 | printf "[$VERSION_NUMBER] deployed to private cocoapod." 15 | -------------------------------------------------------------------------------- /repo-info.json: -------------------------------------------------------------------------------- 1 | { 2 | "is_in_production": true, 3 | "is_scannable": true, 4 | "is_critical": false, 5 | "contact": "SDK Team - Legacy iOS SDK", 6 | "hosted": null 7 | } 8 | --------------------------------------------------------------------------------