diff --git a/.travis.yml b/.travis.yml index 3358058..f387165 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ language: objective-c matrix: include: - osx_image: xcode7.3 - - osx_image: xcode8.2 + - osx_image: xcode9.2 before_install: - rvm install 2.4.0 diff --git a/BMSPush.podspec b/BMSPush.podspec index d00d9f2..0f77d7b 100644 --- a/BMSPush.podspec +++ b/BMSPush.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |s| s.name = 'BMSPush' - s.version = '3.2.6' + s.version = '3.2.7' s.summary = 'Swift client side Push SDK for IBM Bluemix Push notifications services' s.homepage = 'https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-swift-push' diff --git a/BMSPush.xcodeproj/project.pbxproj b/BMSPush.xcodeproj/project.pbxproj index c37e753..f19ff09 100644 --- a/BMSPush.xcodeproj/project.pbxproj +++ b/BMSPush.xcodeproj/project.pbxproj @@ -443,7 +443,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0810; - LastUpgradeCheck = 0810; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = "IBM Corp"; TargetAttributes = { 561BFE321C6C855300CDB375 = { @@ -773,14 +773,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 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_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_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -825,14 +831,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 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_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_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -884,7 +896,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -908,7 +920,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.worklight.BMSPush; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -922,7 +934,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.IBM.BMSPushTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -936,7 +948,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.IBM.BMSPushTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -957,7 +969,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -978,7 +990,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -1028,7 +1040,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1045,7 +1057,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.bms.push.NotificationInterceptor; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/BMSPush.xcodeproj/xcshareddata/xcschemes/BMSPush.xcscheme b/BMSPush.xcodeproj/xcshareddata/xcschemes/BMSPush.xcscheme index a741c4d..50f4968 100644 --- a/BMSPush.xcodeproj/xcshareddata/xcschemes/BMSPush.xcscheme +++ b/BMSPush.xcodeproj/xcshareddata/xcschemes/BMSPush.xcscheme @@ -1,6 +1,6 @@ @@ -31,6 +32,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Podfile.lock b/Podfile.lock index 3850cea..f2dcd76 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,14 +1,14 @@ PODS: - - BMSAnalyticsAPI (2.2.2) - - BMSCore (2.3.4): + - BMSAnalyticsAPI (2.2.3) + - BMSCore (2.3.5): - BMSAnalyticsAPI (~> 2.2) DEPENDENCIES: - BMSCore (~> 2.0) SPEC CHECKSUMS: - BMSAnalyticsAPI: 10c9301b13f0ae1d4ef5c219ddf4dee50fdc5513 - BMSCore: 860b5fbc3d49978e49f23c769e7fc4c5a36cce50 + BMSAnalyticsAPI: d259379069bb11d2ff365bf5b796a2677dfc3849 + BMSCore: 446c16a7dbe14b5019751617a00dd947c65cca82 PODFILE CHECKSUM: d373590e70152d7be414811178c89b483ae77b5b diff --git a/Pods/BMSAnalyticsAPI/Source/RequestMetadata.swift b/Pods/BMSAnalyticsAPI/Source/RequestMetadata.swift index b76552d..2ce3a46 100644 --- a/Pods/BMSAnalyticsAPI/Source/RequestMetadata.swift +++ b/Pods/BMSAnalyticsAPI/Source/RequestMetadata.swift @@ -58,7 +58,7 @@ public struct RequestMetadata { var roundTripTime: Int64 = 0 // If this is not true, that means some BMSCore developer forgot to set the endTime somewhere if endTime > startTime { - (roundTripTime, _) = Int64.subtractWithOverflow(endTime, startTime) + roundTripTime = endTime &- startTime } // Data for analytics logging diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 3850cea..f2dcd76 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -1,14 +1,14 @@ PODS: - - BMSAnalyticsAPI (2.2.2) - - BMSCore (2.3.4): + - BMSAnalyticsAPI (2.2.3) + - BMSCore (2.3.5): - BMSAnalyticsAPI (~> 2.2) DEPENDENCIES: - BMSCore (~> 2.0) SPEC CHECKSUMS: - BMSAnalyticsAPI: 10c9301b13f0ae1d4ef5c219ddf4dee50fdc5513 - BMSCore: 860b5fbc3d49978e49f23c769e7fc4c5a36cce50 + BMSAnalyticsAPI: d259379069bb11d2ff365bf5b796a2677dfc3849 + BMSCore: 446c16a7dbe14b5019751617a00dd947c65cca82 PODFILE CHECKSUM: d373590e70152d7be414811178c89b483ae77b5b diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index e4a9576..3964744 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -743,39 +743,6 @@ }; name = Release; }; - 1D1ADF82DF513D41BC7B050E4CB067A5 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B4A992F16151952621C6DB062253B633 /* BMSAnalyticsAPI.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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_PREFIX_HEADER = "Target Support Files/BMSAnalyticsAPI/BMSAnalyticsAPI-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/BMSAnalyticsAPI/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/BMSAnalyticsAPI/BMSAnalyticsAPI.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = BMSAnalyticsAPI; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; 1E1EF4EBD798610C8F9C8B67CF5E4E79 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = BA0608AA2ADC377AB8B83A0EAB661EA0 /* Pods-BMSPush.debug.xcconfig */; @@ -812,71 +779,6 @@ }; name = Debug; }; - 2FCD5F4F4CD65B3EF92190F8D8589DFC /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 1B0DDF1CB32E99A0530C3562C156315D /* BMSCore.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/BMSCore/BMSCore-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/BMSCore/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/BMSCore/BMSCore.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = BMSCore; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - 314A51703B0CF99047552487A212EEED /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 1B0DDF1CB32E99A0530C3562C156315D /* BMSCore.xcconfig */; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - 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_PREFIX_HEADER = "Target Support Files/BMSCore/BMSCore-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/BMSCore/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/BMSCore/BMSCore.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = BMSCore; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; 3507318E2FDFB349B97872699DB9C890 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 5855E6541CE12A0608D127522589D6B9 /* Pods-BMSPush.release.xcconfig */; @@ -992,6 +894,71 @@ }; name = Debug; }; + 76E4618E007F8EA7AA7B32125E670405 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B4A992F16151952621C6DB062253B633 /* BMSAnalyticsAPI.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + 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_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREFIX_HEADER = "Target Support Files/BMSAnalyticsAPI/BMSAnalyticsAPI-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/BMSAnalyticsAPI/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/BMSAnalyticsAPI/BMSAnalyticsAPI.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = BMSAnalyticsAPI; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 93D5DCBEE5E1AEED9907C40053B30F16 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B4A992F16151952621C6DB062253B633 /* BMSAnalyticsAPI.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + 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_PREFIX_HEADER = "Target Support Files/BMSAnalyticsAPI/BMSAnalyticsAPI-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/BMSAnalyticsAPI/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/BMSAnalyticsAPI/BMSAnalyticsAPI.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = BMSAnalyticsAPI; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; B7324857C38B065FEB1EEE3105C2367A /* Release */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1032,9 +999,45 @@ }; name = Release; }; - B95D3E24FF11A3F754797C46381DDC42 /* Release */ = { + BA58AB718214035303E377D53FDC9E91 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = B4A992F16151952621C6DB062253B633 /* BMSAnalyticsAPI.xcconfig */; + baseConfigurationReference = 7A71AEAA8B5513C5D5B2A2F14E0F43B0 /* Pods-BMSPushHostApp.debug.xcconfig */; + buildSettings = { + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + 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; + INFOPLIST_FILE = "Target Support Files/Pods-BMSPushHostApp/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-BMSPushHostApp/Pods-BMSPushHostApp.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_BMSPushHostApp; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + CF5276047813E752405B053AF2B85B95 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 1B0DDF1CB32E99A0530C3562C156315D /* BMSCore.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -1047,26 +1050,26 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/BMSAnalyticsAPI/BMSAnalyticsAPI-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/BMSAnalyticsAPI/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/BMSCore/BMSCore-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/BMSCore/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/BMSAnalyticsAPI/BMSAnalyticsAPI.modulemap"; + MODULEMAP_FILE = "Target Support Files/BMSCore/BMSCore.modulemap"; MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = BMSAnalyticsAPI; + PRODUCT_NAME = BMSCore; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; - BA58AB718214035303E377D53FDC9E91 /* Debug */ = { + D541BBE5BF9F4E0866D72E4244DB5A2F /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7A71AEAA8B5513C5D5B2A2F14E0F43B0 /* Pods-BMSPushHostApp.debug.xcconfig */; + baseConfigurationReference = 1B0DDF1CB32E99A0530C3562C156315D /* BMSCore.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; @@ -1079,21 +1082,18 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-BMSPushHostApp/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/BMSCore/BMSCore-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/BMSCore/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-BMSPushHostApp/Pods-BMSPushHostApp.modulemap"; + MODULEMAP_FILE = "Target Support Files/BMSCore/BMSCore.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_BMSPushHostApp; + PRODUCT_NAME = BMSCore; SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1124,8 +1124,8 @@ D35E39BDE8C4A3C107D6932C36AC97F8 /* Build configuration list for PBXNativeTarget "BMSAnalyticsAPI" */ = { isa = XCConfigurationList; buildConfigurations = ( - 1D1ADF82DF513D41BC7B050E4CB067A5 /* Debug */, - B95D3E24FF11A3F754797C46381DDC42 /* Release */, + 93D5DCBEE5E1AEED9907C40053B30F16 /* Debug */, + 76E4618E007F8EA7AA7B32125E670405 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1133,8 +1133,8 @@ D6F819E6B1A52B2D2BA36181DB4508F9 /* Build configuration list for PBXNativeTarget "BMSCore" */ = { isa = XCConfigurationList; buildConfigurations = ( - 314A51703B0CF99047552487A212EEED /* Debug */, - 2FCD5F4F4CD65B3EF92190F8D8589DFC /* Release */, + D541BBE5BF9F4E0866D72E4244DB5A2F /* Debug */, + CF5276047813E752405B053AF2B85B95 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Pods/Target Support Files/BMSAnalyticsAPI/Info.plist b/Pods/Target Support Files/BMSAnalyticsAPI/Info.plist index 7c53795..086f7e6 100644 --- a/Pods/Target Support Files/BMSAnalyticsAPI/Info.plist +++ b/Pods/Target Support Files/BMSAnalyticsAPI/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.2.2 + 2.2.3 CFBundleSignature ???? CFBundleVersion diff --git a/Pods/Target Support Files/BMSCore/Info.plist b/Pods/Target Support Files/BMSCore/Info.plist index 97e435d..4beee3e 100644 --- a/Pods/Target Support Files/BMSCore/Info.plist +++ b/Pods/Target Support Files/BMSCore/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.3.4 + 2.3.5 CFBundleSignature ???? CFBundleVersion diff --git a/README.md b/README.md index f8d0aa6..c886c78 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ This package contains the Push components of the Swift SDK. * iOS 8.0+ * Xcode 7.3, 8.0 -* Swift 2.3 - 3.0 +* Swift 2.3 - 4.0 * Cocoapods or Carthage ## Installation @@ -51,11 +51,11 @@ pod install Before running the `pod install` command, make sure to use Cocoapods version [1.1.0.beta.1](https://github.com/CocoaPods/CocoaPods/releases/tag/1.1.0.beta.1). -#### Swift 3.0 +#### Swift 3/ Swift 4 Before running the `pod install` command, make sure to use Cocoapods version [1.1.0.beta.1](https://github.com/CocoaPods/CocoaPods/releases/tag/1.1.0.beta.1). -For apps built with Swift 3.0, you may receive a prompt saying "Convert to Current Swift Syntax?" when opening your project in Xcode 8 (following the installation of BMSCore) do not convert BMSPush, BMSCore or BMSAnalyticsAPI +For apps built with Swift 3.0/Swift 4.0, you may receive a prompt saying "Convert to Current Swift Syntax?" when opening your project in Xcode 8 (following the installation of BMSCore) do not convert BMSPush, BMSCore or BMSAnalyticsAPI This will installs your dependencies and creates a new Xcode workspace. ***Note:*** Ensure that you always open the new Xcode workspace, instead of the original Xcode project file: @@ -92,7 +92,7 @@ import BMSCore ``` let myBMSClient = BMSClient.sharedInstance -//Swift3 +//Swift 3/Swift 4.0 myBMSClient.initialize(bluemixRegion: "Location where your app Hosted") @@ -114,7 +114,7 @@ myBMSClient.initialize(bluemixRegion: "Location where your app Hosted") ``` let push = BMSPushClient.sharedInstance -//Swift 3 +//Swift 3/ Swift 4.0 push.initializeWithAppGUID(appGUID: "your push appGUID", clientSecret:"your push client secret") @@ -163,7 +163,7 @@ For `userId` based notification, the register method will accept one more parame ``` -//Swift3 +//Swift3/Swift 4.0 func application (_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data){ @@ -215,7 +215,7 @@ device can subscribe. ``` -//Swift3 +//Swift3/Swift 4.0 push.retrieveAvailableTagsWithCompletionHandler(completionHandler: { (response, statusCode, error) -> Void in @@ -245,7 +245,7 @@ push.retrieveAvailableTagsWithCompletionHandler({ (response, statusCode, error) ``` -//Swift3 +//Swift3/Swift 4.0 push.subscribeToTags(tagsArray: response!, completionHandler: { (response, statusCode, error) -> Void in @@ -276,7 +276,7 @@ push.subscribeToTags(response, completionHandler: { (response, statusCode, error ``` -//Swift3 +//Swift3/Swift 4.0 push.retrieveSubscriptionsWithCompletionHandler(completionHandler: { (response, statusCode, error) -> Void in if error.isEmpty { @@ -307,7 +307,7 @@ from a tag. ``` -//Swift3 +//Swift3/Swift 4.0 push.unsubscribeFromTags(tagsArray: response!, completionHandler: { (response, statusCode, error) -> Void in if error.isEmpty { @@ -341,7 +341,7 @@ Use the following code snippets to Unregister the device from IBM Cloud Push Not ``` -//Swift3 +//Swift3/Swift 4.0 push.unregisterDevice(completionHandler: { (response, statusCode, error) -> Void in @@ -403,7 +403,7 @@ override func didReceive(_ request: UNNotificationRequest, withContentHandler co ## Enable Monitoring.

To see the push notification monitoring status for iOS you have add the following code snippets.

-Swift 3 +Swift 3/Swift 4.0 ``` // Send notification status when app is opened by clicking the notifications func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) { diff --git a/Source/BMSPushClient.swift b/Source/BMSPushClient.swift index 6408bad..3b0bb0f 100644 --- a/Source/BMSPushClient.swift +++ b/Source/BMSPushClient.swift @@ -18,7 +18,7 @@ import BMSCore public protocol BMSPushObserver{ func onChangePermission(status:Bool); } -// MARK: - Swift 3 +// MARK: - Swift 3 & Swift 4 #if swift(>=3.0) @@ -127,7 +127,13 @@ public class BMSPushClient: NSObject { UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound], completionHandler: { (granted, error) in if(granted) { - UIApplication.shared.registerForRemoteNotifications() + #if swift(>=4.0) + DispatchQueue.main.async { + UIApplication.shared.registerForRemoteNotifications() + } + #else + UIApplication.shared.registerForRemoteNotifications() + #endif self.delegate?.onChangePermission(status: true) } else { print("Error while registering with APNS server : \(String(describing: error))") @@ -206,7 +212,13 @@ public class BMSPushClient: NSObject { center.requestAuthorization(options: [.alert, .badge, .sound], completionHandler: { (granted, error) in if(granted) { - UIApplication.shared.registerForRemoteNotifications() + #if swift(>=4.0) + DispatchQueue.main.async { + UIApplication.shared.registerForRemoteNotifications() + } + #else + UIApplication.shared.registerForRemoteNotifications() + #endif self.delegate?.onChangePermission(status: true) } else { print("Error while registering with APNS server : \(String(describing: error))") @@ -692,7 +704,7 @@ public class BMSPushClient: NSObject { let getRequest = Request(url: resourceURL, method: method, headers: headers, queryParameters: nil, timeout: 60, cachePolicy: .useProtocolCachePolicy) - let mappedArray = tagsArray.flatMap{"\($0)"}.description; + let mappedArray = tagsArray.map{"\($0)"}.description; let data = "{\"\(IMFPUSH_TAGNAMES)\":\(mappedArray), \"\(IMFPUSH_DEVICE_ID)\":\"\(devId)\"}".data(using: .utf8) @@ -829,7 +841,7 @@ public class BMSPushClient: NSObject { let getRequest = Request(url: resourceURL, method: method, headers: headers, queryParameters: nil, timeout: 60, cachePolicy: .useProtocolCachePolicy) - let mappedArray = tagsArray.flatMap{"\($0)"}.description; + let mappedArray = tagsArray.map{"\($0)"}.description; let data = "{\"\(IMFPUSH_TAGNAMES)\":\(mappedArray), \"\(IMFPUSH_DEVICE_ID)\":\"\(devId)\"}".data(using: .utf8) @@ -1043,7 +1055,13 @@ public class BMSPushClient: NSObject { } else { print("Push Enabled") self.delegate?.onChangePermission(status: true) - UIApplication.shared.registerForRemoteNotifications() + #if swift(>=4.0) + DispatchQueue.main.async { + UIApplication.shared.registerForRemoteNotifications() + } + #else + UIApplication.shared.registerForRemoteNotifications() + #endif } } else { UserDefaults.standard.set(true, forKey: BMSPUSH_APP_INSTALL) @@ -1059,7 +1077,13 @@ public class BMSPushClient: NSObject { } else { print("Push Enabled") self.delegate?.onChangePermission(status: true) - UIApplication.shared.registerForRemoteNotifications() + #if swift(>=4.0) + DispatchQueue.main.async { + UIApplication.shared.registerForRemoteNotifications() + } + #else + UIApplication.shared.registerForRemoteNotifications() + #endif } } diff --git a/Source/BMSPushClientOptions.swift b/Source/BMSPushClientOptions.swift index 5a6af6f..afbfe32 100644 --- a/Source/BMSPushClientOptions.swift +++ b/Source/BMSPushClientOptions.swift @@ -14,7 +14,7 @@ import Foundation -// MARK: - Swift 3 +// MARK: - Swift 3 & Swift 4 #if swift(>=3.0) diff --git a/Source/BMSPushUrlBuilder.swift b/Source/BMSPushUrlBuilder.swift index 9f4a54b..319d30e 100644 --- a/Source/BMSPushUrlBuilder.swift +++ b/Source/BMSPushUrlBuilder.swift @@ -14,6 +14,7 @@ import UIKit import BMSCore +// MARK: - Swift 3 & Swift 4 #if swift(>=3.0) internal class BMSPushUrlBuilder: NSObject { diff --git a/Source/BMSPushUtils.swift b/Source/BMSPushUtils.swift index d762155..3058d02 100644 --- a/Source/BMSPushUtils.swift +++ b/Source/BMSPushUtils.swift @@ -14,7 +14,7 @@ import UIKit import BMSCore -// MARK: - Swift 3 +// MARK: - Swift 3 & Swift 4 #if swift(>=3.0) diff --git a/Source/BMSResponse.swift b/Source/BMSResponse.swift index 581d7a4..cf041ee 100644 --- a/Source/BMSResponse.swift +++ b/Source/BMSResponse.swift @@ -14,7 +14,7 @@ import UIKit import BMSCore -// MARK: - Swift 3 +// MARK: - Swift 3 & Swift 4 #if swift(>=3.0) @@ -32,35 +32,18 @@ public extension Response { This will use the public property `responseText` in the `Response` Class. */ public func subscriptions() -> NSMutableArray { - - - // let finalSubscription = NSMutableDictionary() - + let subscription = NSMutableArray() if let subscriptionDictionary = convertStringToDictionary(text: self.responseText!) as NSDictionary? { - if let subscriptionArray:NSArray = subscriptionDictionary.object(forKey: IMFPUSH_SUBSCRIPTIONS) as? NSArray { - - - var subscriptionResponsDic:NSDictionary? + if let subscriptionArray:[[String:String]] = subscriptionDictionary.object(forKey: IMFPUSH_SUBSCRIPTIONS) as? [[String:String]] { - for i in 0..=3.0) import UserNotifications import UserNotificationsUI