diff --git a/CHANGELOG.md b/CHANGELOG.md index f91249f..d444a1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,13 +25,18 @@ The change log has moved to this repo's [GitHub Releases Page](https://github.co ## Release Notes -**1.8.1** -- fix: ref #171: Fix build errors during cocoapods' trunk push - +**1.8.0-alpha4** +**1.8.0-alpha3** +**1.8.0-alpha2** +**1.8.0-alpha1** **1.8.0** - feat: ref #168: add support for high sierra - feat: ref #45: How about support for macOS? +- feat: resolve #176: Add sandboxing status detection to RollbarCachesDirectory. +- fix: resolve #171: Fix build errors during cocoapods' trunk push +- docs: resolve #175: Create a sample app - macOSAppWithRollbarCocoaPod. + **1.7.0** diff --git a/Examples/macOSAppWithRollbarCocoaPod/Podfile b/Examples/macOSAppWithRollbarCocoaPod/Podfile new file mode 100644 index 0000000..6eb2154 --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/Podfile @@ -0,0 +1,6 @@ +platform :osx, '10.12' +use_frameworks! + +target 'macOSAppWithRollbarCocoaPod' do +pod 'Rollbar', '~> 1.8.0-alpha3' +end diff --git a/Examples/macOSAppWithRollbarCocoaPod/Podfile.lock b/Examples/macOSAppWithRollbarCocoaPod/Podfile.lock new file mode 100644 index 0000000..229c434 --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/Podfile.lock @@ -0,0 +1,16 @@ +PODS: + - Rollbar (1.8.0-alpha3) + +DEPENDENCIES: + - Rollbar (~> 1.8.0-alpha3) + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Rollbar + +SPEC CHECKSUMS: + Rollbar: 1d1076fcba2cec0d5cbf196bf90ca1c758f96566 + +PODFILE CHECKSUM: 0c381cdb31a09cd1da38fc2482515a4df1598e46 + +COCOAPODS: 1.7.3 diff --git a/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.xcodeproj/project.pbxproj b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.xcodeproj/project.pbxproj new file mode 100644 index 0000000..c597c77 --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.xcodeproj/project.pbxproj @@ -0,0 +1,408 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 51; + objects = { + +/* Begin PBXBuildFile section */ + 550647DE22D4097300530813 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 550647DD22D4097300530813 /* AppDelegate.m */; }; + 550647E122D4097300530813 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 550647E022D4097300530813 /* ViewController.m */; }; + 550647E322D4097500530813 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 550647E222D4097500530813 /* Assets.xcassets */; }; + 550647E622D4097500530813 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 550647E422D4097500530813 /* Main.storyboard */; }; + 550647E922D4097500530813 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 550647E822D4097500530813 /* main.m */; }; + B315D3D7A0712B4A3965F794 /* Pods_macOSAppWithRollbarCocoaPod.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4EDAE1D35DD40EEDF287F370 /* Pods_macOSAppWithRollbarCocoaPod.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 4EDAE1D35DD40EEDF287F370 /* Pods_macOSAppWithRollbarCocoaPod.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_macOSAppWithRollbarCocoaPod.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 550647D922D4097300530813 /* macOSAppWithRollbarCocoaPod.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = macOSAppWithRollbarCocoaPod.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 550647DC22D4097300530813 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 550647DD22D4097300530813 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 550647DF22D4097300530813 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 550647E022D4097300530813 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 550647E222D4097500530813 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 550647E522D4097500530813 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 550647E722D4097500530813 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 550647E822D4097500530813 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 550647EA22D4097500530813 /* macOSAppWithRollbarCocoaPod.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = macOSAppWithRollbarCocoaPod.entitlements; sourceTree = ""; }; + 550647F022D40E6F00530813 /* Podfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Podfile; sourceTree = SOURCE_ROOT; }; + 6D6F4F79D3BE3D6FA25A13A2 /* Pods-macOSAppWithRollbarCocoaPod.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-macOSAppWithRollbarCocoaPod.release.xcconfig"; path = "Target Support Files/Pods-macOSAppWithRollbarCocoaPod/Pods-macOSAppWithRollbarCocoaPod.release.xcconfig"; sourceTree = ""; }; + DB7913F8E3D95330157E60EB /* Pods-macOSAppWithRollbarCocoaPod.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-macOSAppWithRollbarCocoaPod.debug.xcconfig"; path = "Target Support Files/Pods-macOSAppWithRollbarCocoaPod/Pods-macOSAppWithRollbarCocoaPod.debug.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 550647D622D4097300530813 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B315D3D7A0712B4A3965F794 /* Pods_macOSAppWithRollbarCocoaPod.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3557153F461F7B97859D74DB /* Frameworks */ = { + isa = PBXGroup; + children = ( + 4EDAE1D35DD40EEDF287F370 /* Pods_macOSAppWithRollbarCocoaPod.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 550647D022D4097300530813 = { + isa = PBXGroup; + children = ( + 550647DB22D4097300530813 /* macOSAppWithRollbarCocoaPod */, + 550647DA22D4097300530813 /* Products */, + C96ED9DEF598F5C2270E57A2 /* Pods */, + 3557153F461F7B97859D74DB /* Frameworks */, + ); + sourceTree = ""; + }; + 550647DA22D4097300530813 /* Products */ = { + isa = PBXGroup; + children = ( + 550647D922D4097300530813 /* macOSAppWithRollbarCocoaPod.app */, + ); + name = Products; + sourceTree = ""; + }; + 550647DB22D4097300530813 /* macOSAppWithRollbarCocoaPod */ = { + isa = PBXGroup; + children = ( + 550647DC22D4097300530813 /* AppDelegate.h */, + 550647DD22D4097300530813 /* AppDelegate.m */, + 550647DF22D4097300530813 /* ViewController.h */, + 550647E022D4097300530813 /* ViewController.m */, + 550647E222D4097500530813 /* Assets.xcassets */, + 550647E422D4097500530813 /* Main.storyboard */, + 550647E722D4097500530813 /* Info.plist */, + 550647E822D4097500530813 /* main.m */, + 550647EA22D4097500530813 /* macOSAppWithRollbarCocoaPod.entitlements */, + 550647F022D40E6F00530813 /* Podfile */, + ); + path = macOSAppWithRollbarCocoaPod; + sourceTree = ""; + }; + C96ED9DEF598F5C2270E57A2 /* Pods */ = { + isa = PBXGroup; + children = ( + DB7913F8E3D95330157E60EB /* Pods-macOSAppWithRollbarCocoaPod.debug.xcconfig */, + 6D6F4F79D3BE3D6FA25A13A2 /* Pods-macOSAppWithRollbarCocoaPod.release.xcconfig */, + ); + path = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 550647D822D4097300530813 /* macOSAppWithRollbarCocoaPod */ = { + isa = PBXNativeTarget; + buildConfigurationList = 550647ED22D4097500530813 /* Build configuration list for PBXNativeTarget "macOSAppWithRollbarCocoaPod" */; + buildPhases = ( + 5C81AAC36AEAE945A0D0D279 /* [CP] Check Pods Manifest.lock */, + 550647D522D4097300530813 /* Sources */, + 550647D622D4097300530813 /* Frameworks */, + 550647D722D4097300530813 /* Resources */, + 80216CF3DE08C6DD0F061597 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = macOSAppWithRollbarCocoaPod; + productName = macOSAppWithRollbarCocoaPod; + productReference = 550647D922D4097300530813 /* macOSAppWithRollbarCocoaPod.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 550647D122D4097300530813 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = "Andrey Kornich (Wide Spectrum Computing LLC)"; + TargetAttributes = { + 550647D822D4097300530813 = { + CreatedOnToolsVersion = 10.2.1; + SystemCapabilities = { + com.apple.Sandbox = { + enabled = 1; + }; + }; + }; + }; + }; + buildConfigurationList = 550647D422D4097300530813 /* Build configuration list for PBXProject "macOSAppWithRollbarCocoaPod" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 550647D022D4097300530813; + productRefGroup = 550647DA22D4097300530813 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 550647D822D4097300530813 /* macOSAppWithRollbarCocoaPod */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 550647D722D4097300530813 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 550647E322D4097500530813 /* Assets.xcassets in Resources */, + 550647E622D4097500530813 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 5C81AAC36AEAE945A0D0D279 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-macOSAppWithRollbarCocoaPod-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 80216CF3DE08C6DD0F061597 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-macOSAppWithRollbarCocoaPod/Pods-macOSAppWithRollbarCocoaPod-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-macOSAppWithRollbarCocoaPod/Pods-macOSAppWithRollbarCocoaPod-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-macOSAppWithRollbarCocoaPod/Pods-macOSAppWithRollbarCocoaPod-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 550647D522D4097300530813 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 550647E122D4097300530813 /* ViewController.m in Sources */, + 550647E922D4097500530813 /* main.m in Sources */, + 550647DE22D4097300530813 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 550647E422D4097500530813 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 550647E522D4097500530813 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 550647EB22D4097500530813 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + 550647EC22D4097500530813 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "-"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + }; + name = Release; + }; + 550647EE22D4097500530813 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DB7913F8E3D95330157E60EB /* Pods-macOSAppWithRollbarCocoaPod.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = macOSAppWithRollbarCocoaPod/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.rollbar.macOSAppWithRollbarCocoaPod; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 550647EF22D4097500530813 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6D6F4F79D3BE3D6FA25A13A2 /* Pods-macOSAppWithRollbarCocoaPod.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + INFOPLIST_FILE = macOSAppWithRollbarCocoaPod/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.rollbar.macOSAppWithRollbarCocoaPod; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 550647D422D4097300530813 /* Build configuration list for PBXProject "macOSAppWithRollbarCocoaPod" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 550647EB22D4097500530813 /* Debug */, + 550647EC22D4097500530813 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 550647ED22D4097500530813 /* Build configuration list for PBXNativeTarget "macOSAppWithRollbarCocoaPod" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 550647EE22D4097500530813 /* Debug */, + 550647EF22D4097500530813 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 550647D122D4097300530813 /* Project object */; +} diff --git a/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..b4d1e44 --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.xcworkspace/contents.xcworkspacedata b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..0103116 --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/AppDelegate.h b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/AppDelegate.h new file mode 100644 index 0000000..9e496f3 --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/AppDelegate.h @@ -0,0 +1,15 @@ +// +// AppDelegate.h +// macOSAppWithRollbarCocoaPod +// +// Created by Andrey Kornich on 2019-07-08. +// Copyright © 2019 Andrey Kornich (Wide Spectrum Computing LLC). All rights reserved. +// + +#import + +@interface AppDelegate : NSObject + + +@end + diff --git a/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/AppDelegate.m b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/AppDelegate.m new file mode 100644 index 0000000..50e8f66 --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/AppDelegate.m @@ -0,0 +1,42 @@ +// +// AppDelegate.m +// macOSAppWithRollbarCocoaPod +// +// Created by Andrey Kornich on 2019-07-08. +// Copyright © 2019 Andrey Kornich (Wide Spectrum Computing LLC). All rights reserved. +// + +#import +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + // Insert code here to initialize your application + + // configure Rollbar: + RollbarConfiguration *config = [RollbarConfiguration configuration]; + //config.crashLevel = @"critical"; + config.environment = @"samples"; + + [Rollbar initWithAccessToken:@"2ffc7997ed864dda94f63e7b7daae0f3" configuration:config]; + //[Rollbar initWithAccessToken:@"2ffc7997ed864dda94f63e7b7daae0f3"]; + + // + [Rollbar info:@"macOSAppWithRollbarCocoaPod: the app just launched..."]; + +} + + +- (void)applicationWillTerminate:(NSNotification *)aNotification { + // Insert code here to tear down your application + + [Rollbar info:@"macOSAppWithRollbarCocoaPod: the app is about to terminate..."]; +} + + +@end diff --git a/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2db2b1c --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/Assets.xcassets/Contents.json b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/Base.lproj/Main.storyboard b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/Base.lproj/Main.storyboard new file mode 100644 index 0000000..ea54f31 --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/Base.lproj/Main.storyboard @@ -0,0 +1,717 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/Info.plist b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/Info.plist new file mode 100644 index 0000000..5d1aa24 --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2019 Andrey Kornich (Wide Spectrum Computing LLC). All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + + diff --git a/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/ViewController.h b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/ViewController.h new file mode 100644 index 0000000..ae63006 --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/ViewController.h @@ -0,0 +1,15 @@ +// +// ViewController.h +// macOSAppWithRollbarCocoaPod +// +// Created by Andrey Kornich on 2019-07-08. +// Copyright © 2019 Andrey Kornich (Wide Spectrum Computing LLC). All rights reserved. +// + +#import + +@interface ViewController : NSViewController + + +@end + diff --git a/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/ViewController.m b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/ViewController.m new file mode 100644 index 0000000..53a2bd5 --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/ViewController.m @@ -0,0 +1,27 @@ +// +// ViewController.m +// macOSAppWithRollbarCocoaPod +// +// Created by Andrey Kornich on 2019-07-08. +// Copyright © 2019 Andrey Kornich (Wide Spectrum Computing LLC). All rights reserved. +// + +#import "ViewController.h" + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + // Do any additional setup after loading the view. +} + + +- (void)setRepresentedObject:(id)representedObject { + [super setRepresentedObject:representedObject]; + + // Update the view, if already loaded. +} + + +@end diff --git a/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.entitlements b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.entitlements new file mode 100644 index 0000000..625af03 --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + com.apple.security.network.client + + + diff --git a/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/main.m b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/main.m new file mode 100644 index 0000000..134b67d --- /dev/null +++ b/Examples/macOSAppWithRollbarCocoaPod/macOSAppWithRollbarCocoaPod/main.m @@ -0,0 +1,13 @@ +// +// main.m +// macOSAppWithRollbarCocoaPod +// +// Created by Andrey Kornich on 2019-07-08. +// Copyright © 2019 Andrey Kornich (Wide Spectrum Computing LLC). All rights reserved. +// + +#import + +int main(int argc, const char * argv[]) { + return NSApplicationMain(argc, argv); +} diff --git a/Rollbar/RollbarCachesDirectory.m b/Rollbar/RollbarCachesDirectory.m index a229ea1..56f2839 100644 --- a/Rollbar/RollbarCachesDirectory.m +++ b/Rollbar/RollbarCachesDirectory.m @@ -11,18 +11,34 @@ @implementation RollbarCachesDirectory + (NSString *)directory { - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); + + NSArray *paths = NSSearchPathForDirectoriesInDomains( + NSCachesDirectory, + NSUserDomainMask, + YES); NSString *cachesDirectory = paths.firstObject; + #if TARGET_OS_OSX + NSProcessInfo *processInfo = [NSProcessInfo processInfo]; + if (nil != [processInfo.environment + valueForKey:@"APP_SANDBOX_CONTAINER_ID"]) { + // when the hosting process is sandboxed, the cachesDirectory is already + // allocated per application: + return cachesDirectory; + } + + // when the hosting process is not sandboxed let's make sure we sandbox + // our own cache based on the process' unique attributes: NSString *appBundleID = [NSBundle mainBundle].bundleIdentifier; if (appBundleID) { - cachesDirectory = [cachesDirectory stringByAppendingPathComponent:appBundleID]; + cachesDirectory = + [cachesDirectory stringByAppendingPathComponent:appBundleID]; } else { cachesDirectory = - [cachesDirectory stringByAppendingPathComponent: - [[NSProcessInfo processInfo] processName]]; + [cachesDirectory stringByAppendingPathComponent:processInfo.processName]; } + #endif return cachesDirectory; } diff --git a/Rollbar/RollbarNotifier.m b/Rollbar/RollbarNotifier.m index 166f422..dc01645 100644 --- a/Rollbar/RollbarNotifier.m +++ b/Rollbar/RollbarNotifier.m @@ -40,34 +40,46 @@ @implementation RollbarNotifier - (id)initWithAccessToken:(NSString*)accessToken configuration:(RollbarConfiguration*)configuration isRoot:(BOOL)isRoot { - + if ((self = [super init])) { [self updateAccessToken:accessToken configuration:configuration isRoot:isRoot]; - + if (isRoot) { NSString *cachesDirectory = [RollbarCachesDirectory directory]; if (nil != self.configuration.logPayloadFile && self.configuration.logPayloadFile.length > 0) { payloadsFilePath = - [cachesDirectory stringByAppendingPathComponent:self.configuration.logPayloadFile]; + [cachesDirectory stringByAppendingPathComponent:self.configuration.logPayloadFile]; } else { payloadsFilePath = - [cachesDirectory stringByAppendingPathComponent:PAYLOADS_FILE_NAME]; + [cachesDirectory stringByAppendingPathComponent:PAYLOADS_FILE_NAME]; } + // create working cache directory: + if (![[NSFileManager defaultManager] fileExistsAtPath:cachesDirectory]) { + NSError *error; + BOOL result = + [[NSFileManager defaultManager] createDirectoryAtPath:cachesDirectory + withIntermediateDirectories:YES + attributes:nil + error:&error + ]; + NSLog(@"result %@", result); + } + queuedItemsFilePath = - [cachesDirectory stringByAppendingPathComponent:QUEUED_ITEMS_FILE_NAME]; + [cachesDirectory stringByAppendingPathComponent:QUEUED_ITEMS_FILE_NAME]; stateFilePath = - [cachesDirectory stringByAppendingPathComponent:STATE_FILE_NAME]; - + [cachesDirectory stringByAppendingPathComponent:STATE_FILE_NAME]; + // either create or overwrite the payloads log file: [[NSFileManager defaultManager] createFileAtPath:payloadsFilePath - contents:nil - attributes:nil]; + contents:nil + attributes:nil]; // create the queued items file if does not exist already: if (![[NSFileManager defaultManager] fileExistsAtPath:queuedItemsFilePath]) { @@ -75,7 +87,7 @@ - (id)initWithAccessToken:(NSString*)accessToken contents:nil attributes:nil]; } - + // create state tracking file if does not exist already: if ([[NSFileManager defaultManager] fileExistsAtPath:stateFilePath]) { NSData *stateData = [NSData dataWithContentsOfFile:stateFilePath]; @@ -92,31 +104,31 @@ - (id)initWithAccessToken:(NSString*)accessToken queueState = [@{@"offset": [NSNumber numberWithUnsignedInt:0], @"retry_count": [NSNumber numberWithUnsignedInt:0]} mutableCopy]; } - + // Deals with sending items that have been queued up rollbarThread = [[RollbarThread alloc] initWithNotifier:self reportingRate:configuration.maximumReportsPerMinute]; [rollbarThread start]; - + // Listen for reachability status // so that items are only sent when the internet is available reachability = [RollbarReachability reachabilityForInternetConnection]; - + isNetworkReachable = [reachability isReachable]; - + reachability.reachableBlock = ^(RollbarReachability*reach) { [self captureTelemetryDataForNetwork:true]; isNetworkReachable = YES; }; - + reachability.unreachableBlock = ^(RollbarReachability*reach) { [self captureTelemetryDataForNetwork:false]; isNetworkReachable = NO; }; - + [reachability startNotifier]; } } - + return self; }