diff --git a/.gitignore b/.gitignore index 89c499e4..4c8c4435 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,6 @@ build/ !default.mode2v3 *.perspectivev3 !default.perspectivev3 -*.xcworkspace !default.xcworkspace xcuserdata profile diff --git a/README.md b/README.md index 62fa551d..fc41ce56 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![CocoaPods Version](https://cocoapod-badges.herokuapp.com/v/RMStore/badge.png)](http://cocoadocs.org/docsets/RMStore) [![Platform](https://cocoapod-badges.herokuapp.com/p/RMStore/badge.png)](http://cocoadocs.org/docsets/RMStore) [![Build Status](https://travis-ci.org/robotmedia/RMStore.png)](https://travis-ci.org/robotmedia/RMStore) +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Join the chat at https://gitter.im/robotmedia/RMStore](https://badges.gitter.im/robotmedia/RMStore.svg)](https://gitter.im/robotmedia/RMStore?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) A lightweight iOS library for In-App Purchases. @@ -28,6 +29,13 @@ Or add the files from the [RMStore](https://github.com/robotmedia/RMStore/tree/m Check out the [wiki](https://github.com/robotmedia/RMStore/wiki/Installation) for more options. +Using [Carthage](https://github.com/Carthage/Carthage): +- add this repo to your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile) +- `@import RMStore;` (Objective-C) +- `import RMStore` (Swift) + +Note that the Carthage framework target does not include [Receipt Verification](https://github.com/robotmedia/RMStore/wiki/Receipt-verification) code as this code should always be linked directly into your application and not be in a dynamic framework for security reasons. + ##StoreKit with blocks RMStore adds blocks to all asynchronous StoreKit operations. diff --git a/RMStore.xcodeproj/project.pbxproj b/RMStore.xcodeproj/project.pbxproj index f7da0a58..9c5b49d0 100644 --- a/RMStore.xcodeproj/project.pbxproj +++ b/RMStore.xcodeproj/project.pbxproj @@ -7,6 +7,17 @@ objects = { /* Begin PBXBuildFile section */ + 4C44620E1BBB2369003C0D7D /* RMStoreFramework.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C44620D1BBB2369003C0D7D /* RMStoreFramework.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4C4462131BBB2391003C0D7D /* RMStore.m in Sources */ = {isa = PBXBuildFile; fileRef = A0AF3D1217A802F300D2E836 /* RMStore.m */; }; + 4C4462141BBB2396003C0D7D /* RMStore.h in Headers */ = {isa = PBXBuildFile; fileRef = A0AF3D1017A802F300D2E836 /* RMStore.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4C4462151BBB2403003C0D7D /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A0AF3D3317A8059900D2E836 /* StoreKit.framework */; }; + 4C4462161BBB241E003C0D7D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A0AF3D0B17A802F300D2E836 /* Foundation.framework */; }; + 4CBA895B1BBC5A8400913336 /* RMStoreKeychainPersistence.h in Headers */ = {isa = PBXBuildFile; fileRef = 876046471812FB7500C9B78C /* RMStoreKeychainPersistence.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4CBA895C1BBC5A8B00913336 /* RMStoreKeychainPersistence.m in Sources */ = {isa = PBXBuildFile; fileRef = 876046481812FB7500C9B78C /* RMStoreKeychainPersistence.m */; }; + 4CBA895D1BBC5AB200913336 /* RMStoreTransaction.m in Sources */ = {isa = PBXBuildFile; fileRef = 876631F8180EEBF40049B368 /* RMStoreTransaction.m */; }; + 4CBA895E1BBC5ABF00913336 /* RMStoreTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 876631F7180EEBF40049B368 /* RMStoreTransaction.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 4CBA89601BBC5AE400913336 /* RMStoreUserDefaultsPersistence.m in Sources */ = {isa = PBXBuildFile; fileRef = 87A2A3A8180E82BB00376773 /* RMStoreUserDefaultsPersistence.m */; }; + 4CBA89611BBC5AE800913336 /* RMStoreUserDefaultsPersistence.h in Headers */ = {isa = PBXBuildFile; fileRef = 87A2A3A7180E82BB00376773 /* RMStoreUserDefaultsPersistence.h */; settings = {ATTRIBUTES = (Public, ); }; }; 8700D1C117DCA548005C8F5D /* NSNotification+RMStoreTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 8700D1C017DCA548005C8F5D /* NSNotification+RMStoreTests.m */; }; 8700D1D717DCB011005C8F5D /* libOCMock.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8700D1D617DCB011005C8F5D /* libOCMock.a */; }; 876046491812FB7500C9B78C /* RMStoreKeychainPersistence.m in Sources */ = {isa = PBXBuildFile; fileRef = 876046481812FB7500C9B78C /* RMStoreKeychainPersistence.m */; }; @@ -84,6 +95,10 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 4C44620B1BBB2369003C0D7D /* RMStore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RMStore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 4C44620D1BBB2369003C0D7D /* RMStoreFramework.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RMStoreFramework.h; sourceTree = ""; }; + 4C44620F1BBB2369003C0D7D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 4CBA896A1BBCA48100913336 /* RMStore.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = RMStore.modulemap; sourceTree = ""; }; 8700D1C017DCA548005C8F5D /* NSNotification+RMStoreTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSNotification+RMStoreTests.m"; sourceTree = ""; }; 8700D1CF17DCB011005C8F5D /* NSNotificationCenter+OCMAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSNotificationCenter+OCMAdditions.h"; sourceTree = ""; }; 8700D1D017DCB011005C8F5D /* OCMArg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OCMArg.h; sourceTree = ""; }; @@ -147,6 +162,15 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 4C4462071BBB2369003C0D7D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4C4462161BBB241E003C0D7D /* Foundation.framework in Frameworks */, + 4C4462151BBB2403003C0D7D /* StoreKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; A0AF3D0517A802F300D2E836 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -189,6 +213,16 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 4C44620C1BBB2369003C0D7D /* RMStoreFramework */ = { + isa = PBXGroup; + children = ( + 4C44620D1BBB2369003C0D7D /* RMStoreFramework.h */, + 4C44620F1BBB2369003C0D7D /* Info.plist */, + 4CBA896A1BBCA48100913336 /* RMStore.modulemap */, + ); + path = RMStoreFramework; + sourceTree = ""; + }; 8700D1CC17DCB011005C8F5D /* usr */ = { isa = PBXGroup; children = ( @@ -253,6 +287,7 @@ A0AF3D0D17A802F300D2E836 /* RMStore */, A0AF3D2217A802F300D2E836 /* RMStoreTests */, A0AF3D7617A8085900D2E836 /* RMStoreDemo */, + 4C44620C1BBB2369003C0D7D /* RMStoreFramework */, A0AF3D0A17A802F300D2E836 /* Frameworks */, A0AF3D0917A802F300D2E836 /* Products */, ); @@ -264,6 +299,7 @@ A0AF3D0817A802F300D2E836 /* libRMStore.a */, A0AF3D1917A802F300D2E836 /* RMStoreTests.xctest */, A0AF3D7217A8085900D2E836 /* RMStoreDemo.app */, + 4C44620B1BBB2369003C0D7D /* RMStore.framework */, ); name = Products; sourceTree = ""; @@ -361,7 +397,40 @@ }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + 4C4462081BBB2369003C0D7D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 4CBA89611BBC5AE800913336 /* RMStoreUserDefaultsPersistence.h in Headers */, + 4CBA895B1BBC5A8400913336 /* RMStoreKeychainPersistence.h in Headers */, + 4C44620E1BBB2369003C0D7D /* RMStoreFramework.h in Headers */, + 4CBA895E1BBC5ABF00913336 /* RMStoreTransaction.h in Headers */, + 4C4462141BBB2396003C0D7D /* RMStore.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ + 4C44620A1BBB2369003C0D7D /* RMStoreFramework */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4C4462101BBB2369003C0D7D /* Build configuration list for PBXNativeTarget "RMStoreFramework" */; + buildPhases = ( + 4C4462061BBB2369003C0D7D /* Sources */, + 4C4462071BBB2369003C0D7D /* Frameworks */, + 4C4462081BBB2369003C0D7D /* Headers */, + 4C4462091BBB2369003C0D7D /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RMStoreFramework; + productName = RMStoreFramework; + productReference = 4C44620B1BBB2369003C0D7D /* RMStore.framework */; + productType = "com.apple.product-type.framework"; + }; A0AF3D0717A802F300D2E836 /* RMStore */ = { isa = PBXNativeTarget; buildConfigurationList = A0AF3D2D17A802F300D2E836 /* Build configuration list for PBXNativeTarget "RMStore" */; @@ -422,6 +491,11 @@ attributes = { LastUpgradeCheck = 0720; ORGANIZATIONNAME = "Robot Media"; + TargetAttributes = { + 4C44620A1BBB2369003C0D7D = { + CreatedOnToolsVersion = 7.0; + }; + }; }; buildConfigurationList = A0AF3D0317A802F300D2E836 /* Build configuration list for PBXProject "RMStore" */; compatibilityVersion = "Xcode 3.2"; @@ -438,11 +512,19 @@ A0AF3D0717A802F300D2E836 /* RMStore */, A0AF3D1817A802F300D2E836 /* RMStoreTests */, A0AF3D7117A8085900D2E836 /* RMStoreDemo */, + 4C44620A1BBB2369003C0D7D /* RMStoreFramework */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 4C4462091BBB2369003C0D7D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; A0AF3D1617A802F300D2E836 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -466,6 +548,17 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 4C4462061BBB2369003C0D7D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4CBA895D1BBC5AB200913336 /* RMStoreTransaction.m in Sources */, + 4CBA895C1BBC5A8B00913336 /* RMStoreKeychainPersistence.m in Sources */, + 4C4462131BBB2391003C0D7D /* RMStore.m in Sources */, + 4CBA89601BBC5AE400913336 /* RMStoreUserDefaultsPersistence.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; A0AF3D0417A802F300D2E836 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -543,6 +636,92 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 4C4462111BBB2369003C0D7D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + BITCODE_GENERATION_MODE = marker; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + 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; + HEADER_SEARCH_PATHS = ""; + INFOPLIST_FILE = RMStoreFramework/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ""; + MODULEMAP_FILE = RMStoreFramework/RMStore.modulemap; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = net.robotmedia.RMStoreFramework; + PRODUCT_NAME = RMStore; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 4C4462121BBB2369003C0D7D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + BITCODE_GENERATION_MODE = bitcode; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + 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; + HEADER_SEARCH_PATHS = ""; + INFOPLIST_FILE = RMStoreFramework/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ""; + MODULEMAP_FILE = RMStoreFramework/RMStore.modulemap; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = net.robotmedia.RMStoreFramework; + PRODUCT_NAME = RMStore; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; A0AF3D2B17A802F300D2E836 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -756,6 +935,15 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + 4C4462101BBB2369003C0D7D /* Build configuration list for PBXNativeTarget "RMStoreFramework" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4C4462111BBB2369003C0D7D /* Debug */, + 4C4462121BBB2369003C0D7D /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; A0AF3D0317A802F300D2E836 /* Build configuration list for PBXProject "RMStore" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/RMStore.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/RMStore.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 00000000..919434a6 --- /dev/null +++ b/RMStore.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/RMStore.xcodeproj/xcshareddata/xcschemes/RMStoreFramework.xcscheme b/RMStore.xcodeproj/xcshareddata/xcschemes/RMStoreFramework.xcscheme new file mode 100644 index 00000000..24b9df17 --- /dev/null +++ b/RMStore.xcodeproj/xcshareddata/xcschemes/RMStoreFramework.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RMStoreFramework/Info.plist b/RMStoreFramework/Info.plist new file mode 100644 index 00000000..d3de8eef --- /dev/null +++ b/RMStoreFramework/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/RMStoreFramework/RMStore.modulemap b/RMStoreFramework/RMStore.modulemap new file mode 100644 index 00000000..45f3f392 --- /dev/null +++ b/RMStoreFramework/RMStore.modulemap @@ -0,0 +1,6 @@ +framework module RMStore { + umbrella header "RMStoreFramework.h" + + export * + module * { export * } +} \ No newline at end of file diff --git a/RMStoreFramework/RMStoreFramework.h b/RMStoreFramework/RMStoreFramework.h new file mode 100644 index 00000000..1421dd67 --- /dev/null +++ b/RMStoreFramework/RMStoreFramework.h @@ -0,0 +1,19 @@ +// +// RMStoreFramework.h +// RMStoreFramework +// +// Created by Michael Brown on 29/09/2015. +// Copyright © 2015 Robot Media. All rights reserved. +// + +#import + +//! Project version number for RMStoreFramework. +FOUNDATION_EXPORT double RMStoreFrameworkVersionNumber; + +//! Project version string for RMStoreFramework. +FOUNDATION_EXPORT const unsigned char RMStoreFrameworkVersionString[]; + +#import "RMStore.h" +#import "RMStoreKeychainPersistence.h" +#import "RMStoreUserDefaultsPersistence.h"