diff --git a/NearITSDK.framework/Info.plist b/NearITSDK.framework/Info.plist index 60d1592..2994d88 100644 Binary files a/NearITSDK.framework/Info.plist and b/NearITSDK.framework/Info.plist differ diff --git a/NearITSDK.framework/NITEnrollDeviceViewController.nib b/NearITSDK.framework/NITEnrollDeviceViewController.nib index 7434e81..dd0801b 100644 Binary files a/NearITSDK.framework/NITEnrollDeviceViewController.nib and b/NearITSDK.framework/NITEnrollDeviceViewController.nib differ diff --git a/NearITSDK.framework/NearITSDK b/NearITSDK.framework/NearITSDK index 47ac7c2..eb4bd8e 100755 Binary files a/NearITSDK.framework/NearITSDK and b/NearITSDK.framework/NearITSDK differ diff --git a/NearITSDK.framework/PrivateHeaders/NITManager.h b/NearITSDK.framework/PrivateHeaders/NITManager.h index 8d77298..ae00295 100644 --- a/NearITSDK.framework/PrivateHeaders/NITManager.h +++ b/NearITSDK.framework/PrivateHeaders/NITManager.h @@ -48,40 +48,57 @@ @property (nonatomic) BOOL showBackgroundNotification; @property (nonatomic) BOOL showForegroundNotification; +// Setup + (void)setupWithApiKey:(NSString* _Nonnull)apiKey; + (NITManager* _Nonnull)defaultManager; + (void)setFrameworkName:(NSString* _Nonnull)frameworkName; - -- (void)start; -- (void)stop; -- (void)refreshConfigWithCompletionHandler:(void (^_Nullable)(NSError * _Nullable error))completionHandler DEPRECATED_ATTRIBUTE; +- (BOOL)application:(UIApplication* _Nonnull)application openURL:(NSURL* _Nonnull)url options:(NSDictionary* _Nullable)options; +- (void)application:(UIApplication* _Nonnull)application performFetchWithCompletionHandler:(void (^_Nonnull)(UIBackgroundFetchResult))completionHandler; - (void)setDeviceTokenWithData:(NSData* _Nonnull)token; -- (BOOL)processRecipeSimpleWithUserInfo:(NSDictionary * _Nullable)userInfo; -- (void)sendTrackingWithTrackingInfo:(NITTrackingInfo * _Nullable)trackingInfo event:(NSString* _Nullable)event; -- (void)setUserDataWithKey:(NSString* _Nonnull)key value:(NSString* _Nullable)value completionHandler:(void (^_Nullable)(NSError* _Nullable error))handler DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use setUserData(\"MY_KEY\", value:\"MY_VALUE\")"); -- (void)setBatchUserDataWithDictionary:(NSDictionary* _Nonnull)valuesDictiornary completionHandler:(void (^_Nullable)(NSError* _Nullable error))handler DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use setUserData(\"MY_KEY\", value:\"MY_VALUE\")"); -- (void)setDeferredUserDataWithKey:(NSString * _Nonnull)key value:(NSString * _Nullable)value -DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use setUserDataWithKey(\"MY_KEY\", value:\"MY_VALUE\")"); + +// Profile - (void)setUserDataWithKey:(NSString* _Nonnull)key value:(NSString* _Nullable)value; - (void)setUserDataWithKey:(NSString* _Nonnull)key multiValue:(NSDictionary* _Nullable)value; -- (void)sendEventWithEvent:(NITEvent* _Nonnull)event completionHandler:(void (^_Nullable)(NSError* _Nullable error))handler; +- (void)setProfileId:(NSString * _Nonnull)profileId; +- (void)profileIdWithCompletionHandler:(void (^_Nonnull)(NSString* _Nullable profileId, NSError* _Nullable error))handler; +- (void)resetProfileWithCompletionHandler:(void (^_Nonnull)(NSString* _Nullable profileId, NSError* _Nullable error))handler; +- (void)optOutWithCompletionHandler:(void (^_Nonnull)(BOOL success))handler; +- (void)resetProfile DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use resetProfileWithCompletionHandler"); +- (void)setDeferredUserDataWithKey:(NSString * _Nonnull)key value:(NSString * _Nullable)value +DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use setUserDataWithKey(\"MY_KEY\", value:\"MY_VALUE\")"); +- (void)setUserDataWithKey:(NSString* _Nonnull)key value:(NSString* _Nullable)value completionHandler:(void (^_Nullable)(NSError* _Nullable error))handler DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use setUserData(\"MY_KEY\", value:\"MY_VALUE\")"); +- (void)setBatchUserDataWithDictionary:(NSDictionary* _Nonnull)valuesDictiornary completionHandler:(void (^_Nullable)(NSError* _Nullable error))handler DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use setUserData(\"MY_KEY\", value:\"MY_VALUE\")"); +- (NSString* _Nullable)profileId DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use profileIdWithCompletionHandler"); + +// Radar +- (void)start; +- (void)stop; + +// Content +- (void)userNotificationCenter:(UNUserNotificationCenter* _Nonnull)center willPresent:(UNNotification* _Nonnull)notification withCompletionHandler:(void (^_Nonnull)(UNNotificationPresentationOptions options))handler; +- (BOOL)getContentFrom:(UNNotificationResponse* _Nonnull)response completion:(void (^_Nullable)(NITReactionBundle* _Nullable object, NITTrackingInfo * _Nullable trackingInfo, NSError* _Nullable error))completionHandler; +- (BOOL)processRecipeWithResponse:(UNNotificationResponse* _Nonnull)response completion:(void (^_Nullable)(NITReactionBundle* _Nullable object, NITTrackingInfo * _Nullable trackingInfo, NSError* _Nullable error))completionHandler +DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use getContentFrom"); - (void)couponsWithCompletionHandler:(void (^ _Nullable)(NSArray* _Nullable, NSError* _Nullable))handler; + +// Manual configuration +- (BOOL)processRecipeSimpleWithUserInfo:(NSDictionary * _Nullable)userInfo; - (void)recipesWithCompletionHandler:(void (^_Nullable)(NSArray* _Nullable recipes, NSError * _Nullable error))completionHandler; - (void)processRecipeWithId:(NSString* _Nonnull)recipeId; - (BOOL)processRecipeWithUserInfo:(NSDictionary * _Nonnull)userInfo completion:(void (^_Nullable)(NITReactionBundle* _Nullable object, NITTrackingInfo * _Nullable trackingInfo, NSError* _Nullable error))completionHandler; -- (BOOL)processRecipeWithResponse:(UNNotificationResponse*)response completion:(void (^_Nullable)(NITReactionBundle* _Nullable object, NITTrackingInfo * _Nullable trackingInfo, NSError* _Nullable error))completionHandler; -- (void)resetProfile DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use resetProfileWithCompletionHandler"); -- (void)resetProfileWithCompletionHandler:(void (^_Nonnull)(NSString* _Nullable profileId, NSError* _Nullable error))handler; -- (NSString* _Nullable)profileId DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use profileIdWithCompletionHandler"); -- (void)profileIdWithCompletionHandler:(void (^_Nonnull)(NSString* _Nullable profileId, NSError* _Nullable error))handler; -- (void)setProfileId:(NSString * _Nonnull)profileId; -- (void)optOutWithCompletionHandler:(void (^_Nonnull)(BOOL success))handler; +- (void)refreshConfigWithCompletionHandler:(void (^_Nullable)(NSError * _Nullable error))completionHandler DEPRECATED_ATTRIBUTE; +- (void)sendTrackingWithTrackingInfo:(NITTrackingInfo * _Nullable)trackingInfo event:(NSString* _Nullable)event; +- (void)sendEventWithEvent:(NITEvent* _Nonnull)event completionHandler:(void (^_Nullable)(NSError* _Nullable error))handler; + +// Custom trigger - (void)processCustomTriggerWithKey:(NSString* _Nonnull)key DEPRECATED_ATTRIBUTE DEPRECATED_MSG_ATTRIBUTE("Use triggerInAppEventWithKey"); - (void)triggerInAppEventWithKey:(NSString* _Nonnull)key; -- (void)application:(UIApplication* _Nonnull)application performFetchWithCompletionHandler:(void (^_Nonnull)(UIBackgroundFetchResult))completionHandler; + +// Util - (void)parseContent:(id _Nonnull)content trackingInfo:(NITTrackingInfo* _Nonnull)trackingInfo contentDelegate:(id _Nonnull)contentDelegate; -- (BOOL)application:(UIApplication* _Nonnull)application openURL:(NSURL* _Nonnull)url options:(NSDictionary* _Nullable)options; + +// Notification History - (void)historyWithCompletion:(void(^_Nonnull)(NSArray* _Nullable items, NSError* _Nullable error))completion; - (void)updateWithNotification:(UNNotification* _Nonnull)notification; - (void)markNotificationHistoryAsOld; diff --git a/NearITSDK.framework/PrivateHeaders/NITTrackingInfo.h b/NearITSDK.framework/PrivateHeaders/NITTrackingInfo.h index cdcc88c..3e61327 100644 --- a/NearITSDK.framework/PrivateHeaders/NITTrackingInfo.h +++ b/NearITSDK.framework/PrivateHeaders/NITTrackingInfo.h @@ -21,6 +21,6 @@ + (NITTrackingInfo* _Nonnull)trackingInfoFromRecipeId:(NSString* _Nonnull)recipeId; + (NITTrackingInfo* _Nonnull)trackingInfoFromRecipeId:(NSString* _Nonnull)recipeId deliveryId:(NSString* _Nullable)deliveryId; -+ (NITTrackingInfo* _Nonnull)trackingInfoFromRecipeId:(NSString* _Nonnull)recipeId extras:(NSDictionary *)extras; ++ (NITTrackingInfo* _Nonnull)trackingInfoFromRecipeId:(NSString* _Nonnull)recipeId extras:(NSDictionary *_Nonnull)extras; @end diff --git a/NearITSDK.podspec b/NearITSDK.podspec index b69534b..bbabdc0 100644 --- a/NearITSDK.podspec +++ b/NearITSDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'NearITSDK' -s.version = '2.11.2' +s.version = '2.11.3' s.summary = 'nearit.com iOS SDK' s.description = 'nearit.com iOS SDK for Objective-C' @@ -10,7 +10,7 @@ s.license = 'MIT' s.author = { 'Francesco Leoni' => 'francesco@nearit.com', -'Cattaneo Stefano' => 'stefano@nearit.com', +'Stefano Cattaneo' => 'stefano@nearit.com', 'Boschini Federico' => 'federico@nearit.com' } s.source = { :git => "https://github.com/nearit/iOS-SDK.git", :tag => s.version.to_s } diff --git a/NearITSDKSwift.podspec b/NearITSDKSwift.podspec index 2a935c2..f15271c 100644 --- a/NearITSDKSwift.podspec +++ b/NearITSDKSwift.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'NearITSDKSwift' -s.version = '2.11.2' +s.version = '2.11.3' s.summary = 'nearit.com iOS SDK' s.description = 'nearit.com iOS SDK for Swift' @@ -19,7 +19,7 @@ s.ios.deployment_target = '9.0' s.requires_arc = true s.source_files = 'NearITSDKSwift/*.{h,swift}' -s.dependency 'NearITSDK', '= 2.11.2' +s.dependency 'NearITSDK', '= 2.11.3' s.swift_version = '4.2' end diff --git a/NearITSDKSwift/NearManager.swift b/NearITSDKSwift/NearManager.swift index 353996e..4a592c4 100644 --- a/NearITSDKSwift/NearManager.swift +++ b/NearITSDKSwift/NearManager.swift @@ -96,11 +96,23 @@ public final class NearManager: NSObject, NITManagerDelegate, NITNotificationUpd } @available(iOS 10.0, *) - public func processRecipeFrom(_ response: UNNotificationResponse, completion: ((NITReactionBundle?, NITTrackingInfo?, Error?) -> Void)?) -> Bool { + public func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { + manager.userNotificationCenter(center, willPresent: notification) { (options) in + completionHandler(options) + } + } + + @available(iOS 10.0, *) + public func getContentFrom(_ response: UNNotificationResponse, completion: ((NITReactionBundle?, NITTrackingInfo?, Error?) -> Void)?) -> Bool { let userInfo = response.notification.request.content.userInfo return self.processRecipe(userInfo, completion: completion) } + @available(iOS, introduced: 10.0, deprecated, message: "use getContent instead") + public func processRecipeFrom(_ response: UNNotificationResponse, completion: ((NITReactionBundle?, NITTrackingInfo?, Error?) -> Void)?) -> Bool { + return getContentFrom(response, completion: completion) + } + public func processRecipe(_ userInfo: [AnyHashable : Any], completion: ((NITReactionBundle?, NITTrackingInfo?, Error?) -> Void)?) -> Bool { if let ui = userInfo as? [String : Any] { return manager.processRecipe(userInfo: ui, completion: { (content, trackingInfo, error) in diff --git a/samples/NearSample/NearSample.xcodeproj/project.pbxproj b/samples/NearSample/NearSample.xcodeproj/project.pbxproj index d9e9466..a527e44 100644 --- a/samples/NearSample/NearSample.xcodeproj/project.pbxproj +++ b/samples/NearSample/NearSample.xcodeproj/project.pbxproj @@ -7,13 +7,13 @@ objects = { /* Begin PBXBuildFile section */ - 1913D3530FA1C06ABAE916B2 /* Pods_NearSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9BDD6CF262C301E504AAB1DE /* Pods_NearSample.framework */; }; 2694A71A1FB99E160053AD19 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2694A7191FB99E160053AD19 /* AppDelegate.swift */; }; 2694A7211FB99E160053AD19 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2694A71F1FB99E160053AD19 /* Main.storyboard */; }; 2694A7231FB99E160053AD19 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2694A7221FB99E160053AD19 /* Assets.xcassets */; }; 2694A7261FB99E160053AD19 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2694A7241FB99E160053AD19 /* LaunchScreen.storyboard */; }; 2694A7301FB9A0BA0053AD19 /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2694A72F1FB9A0BA0053AD19 /* HomeViewController.swift */; }; 26AC2A7B1FC837C300EC400D /* NearButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26AC2A7A1FC837C300EC400D /* NearButton.swift */; }; + 620DF6AF82809FEB5B0E437E /* Pods_NearSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD97747CA16DD20EA30B2871 /* Pods_NearSample.framework */; }; D778EBEF20A4B0A700B1BF45 /* Podfile in Resources */ = {isa = PBXBuildFile; fileRef = D778EBEE20A4B0A400B1BF45 /* Podfile */; }; /* End PBXBuildFile section */ @@ -26,11 +26,11 @@ 2694A7271FB99E160053AD19 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 2694A72F1FB9A0BA0053AD19 /* HomeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = ""; }; 26AC2A7A1FC837C300EC400D /* NearButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NearButton.swift; sourceTree = ""; }; - 9BDD6CF262C301E504AAB1DE /* Pods_NearSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NearSample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A6B4125871FD301FA804A80D /* Pods-NearSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NearSample.release.xcconfig"; path = "Pods/Target Support Files/Pods-NearSample/Pods-NearSample.release.xcconfig"; sourceTree = ""; }; + 306DC0247F84AF16C747ABFE /* Pods-NearSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NearSample.debug.xcconfig"; path = "Target Support Files/Pods-NearSample/Pods-NearSample.debug.xcconfig"; sourceTree = ""; }; D778EBEE20A4B0A400B1BF45 /* Podfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Podfile; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; D7B71B7F21CBFA7500BAB9EC /* NearSample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NearSample.entitlements; sourceTree = ""; }; - F80D34C636857BE7712E274E /* Pods-NearSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NearSample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-NearSample/Pods-NearSample.debug.xcconfig"; sourceTree = ""; }; + DD97747CA16DD20EA30B2871 /* Pods_NearSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NearSample.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E8AF31AA5FA6DB13D42CCDEA /* Pods-NearSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-NearSample.release.xcconfig"; path = "Target Support Files/Pods-NearSample/Pods-NearSample.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -38,7 +38,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 1913D3530FA1C06ABAE916B2 /* Pods_NearSample.framework in Frameworks */, + 620DF6AF82809FEB5B0E437E /* Pods_NearSample.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -51,8 +51,8 @@ D778EBEE20A4B0A400B1BF45 /* Podfile */, 2694A7181FB99E160053AD19 /* NearSample */, 2694A7171FB99E160053AD19 /* Products */, - B19D537226CC981263BF4C51 /* Pods */, - 7ECE464BA93FBEE2D45A36A8 /* Frameworks */, + 4897E06E4BED329B7BED287E /* Pods */, + B59AE42B8DFF781E57009C18 /* Frameworks */, ); sourceTree = ""; }; @@ -87,21 +87,22 @@ path = Views; sourceTree = ""; }; - 7ECE464BA93FBEE2D45A36A8 /* Frameworks */ = { + 4897E06E4BED329B7BED287E /* Pods */ = { isa = PBXGroup; children = ( - 9BDD6CF262C301E504AAB1DE /* Pods_NearSample.framework */, + 306DC0247F84AF16C747ABFE /* Pods-NearSample.debug.xcconfig */, + E8AF31AA5FA6DB13D42CCDEA /* Pods-NearSample.release.xcconfig */, ); - name = Frameworks; + name = Pods; + path = Pods; sourceTree = ""; }; - B19D537226CC981263BF4C51 /* Pods */ = { + B59AE42B8DFF781E57009C18 /* Frameworks */ = { isa = PBXGroup; children = ( - F80D34C636857BE7712E274E /* Pods-NearSample.debug.xcconfig */, - A6B4125871FD301FA804A80D /* Pods-NearSample.release.xcconfig */, + DD97747CA16DD20EA30B2871 /* Pods_NearSample.framework */, ); - name = Pods; + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ @@ -111,11 +112,11 @@ isa = PBXNativeTarget; buildConfigurationList = 2694A72A1FB99E160053AD19 /* Build configuration list for PBXNativeTarget "NearSample" */; buildPhases = ( - 3780FF61E45F9B955DCCB2DE /* [CP] Check Pods Manifest.lock */, + A788D59DFE5C4061C494762D /* [CP] Check Pods Manifest.lock */, 2694A7121FB99E160053AD19 /* Sources */, 2694A7131FB99E160053AD19 /* Frameworks */, 2694A7141FB99E160053AD19 /* Resources */, - 262A49739F73329D0B423E6B /* [CP] Embed Pods Frameworks */, + 114A6980CA62D72EF9EB3AA5 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -183,7 +184,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 262A49739F73329D0B423E6B /* [CP] Embed Pods Frameworks */ = { + 114A6980CA62D72EF9EB3AA5 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -191,8 +192,7 @@ inputFileListPaths = ( ); inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-NearSample/Pods-NearSample-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Hex/Hex.framework", + "${PODS_ROOT}/Target Support Files/Pods-NearSample/Pods-NearSample-frameworks.sh", "${PODS_ROOT}/NearITSDK/NearITSDK.framework", "${BUILT_PRODUCTS_DIR}/NearITSDKSwift/NearITSDKSwift.framework", "${BUILT_PRODUCTS_DIR}/NearUIBinding/NearUIBinding.framework", @@ -201,17 +201,16 @@ outputFileListPaths = ( ); outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Hex.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NearITSDK.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NearITSDKSwift.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NearUIBinding.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-NearSample/Pods-NearSample-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-NearSample/Pods-NearSample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 3780FF61E45F9B955DCCB2DE /* [CP] Check Pods Manifest.lock */ = { + A788D59DFE5C4061C494762D /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -377,7 +376,7 @@ }; 2694A72B1FB99E160053AD19 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = F80D34C636857BE7712E274E /* Pods-NearSample.debug.xcconfig */; + baseConfigurationReference = 306DC0247F84AF16C747ABFE /* Pods-NearSample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = NearSample/NearSample.entitlements; @@ -395,7 +394,7 @@ }; 2694A72C1FB99E160053AD19 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A6B4125871FD301FA804A80D /* Pods-NearSample.release.xcconfig */; + baseConfigurationReference = E8AF31AA5FA6DB13D42CCDEA /* Pods-NearSample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = NearSample/NearSample.entitlements; diff --git a/samples/NearSample/NearSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/NearSample/NearSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/samples/NearSample/NearSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/samples/NearSample/NearSample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/samples/NearSample/NearSample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/samples/NearSample/NearSample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/samples/NearSample/NearSample/AppDelegate.swift b/samples/NearSample/NearSample/AppDelegate.swift index 42c70e0..334a8fa 100644 --- a/samples/NearSample/NearSample/AppDelegate.swift +++ b/samples/NearSample/NearSample/AppDelegate.swift @@ -74,16 +74,20 @@ class AppDelegate: UIResponder, UIApplicationDelegate { extension AppDelegate: UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { - completionHandler(.alert) - NearManager.shared.update(with: notification) + NearManager.shared.userNotificationCenter(center, willPresent: notification, withCompletionHandler: completionHandler) } func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { - let isNearNotification = NearManager.shared.processRecipeFrom(response) { (content, trackingInfo, error) in - if let content = content, let trackingInfo = trackingInfo { - self.handleNearContent(content, trackingInfo: trackingInfo) + let isNearNotification = NearUIBinding.showContentFrom(response) { (content, trackingInfo, error) in + if error != nil { + // there was an error + } + + if let customJson = content as? NITCustomJSON { + // handle custom json } } + completionHandler() } } diff --git a/samples/NearSample/NearSample/Views/NearButton.swift b/samples/NearSample/NearSample/Views/NearButton.swift index 6bddac9..1d1380f 100644 --- a/samples/NearSample/NearSample/Views/NearButton.swift +++ b/samples/NearSample/NearSample/Views/NearButton.swift @@ -7,12 +7,11 @@ // import UIKit -import Hex class NearButton: UIButton { override func awakeFromNib() { - backgroundColor = UIColor(hex:"#333333") + backgroundColor = UIColor.init(red: 51.0/255.0, green: 51.0/255.0, blue: 51.0/255.0, alpha: 1) layer.cornerRadius = 18 contentEdgeInsets = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10) } diff --git a/samples/NearSample/Podfile b/samples/NearSample/Podfile index e5878c4..25eb91c 100644 --- a/samples/NearSample/Podfile +++ b/samples/NearSample/Podfile @@ -9,7 +9,4 @@ target 'NearSample' do pod 'NearITSDKSwift' pod 'NearUIBinding' -# Utility pod -pod 'Hex' - -end \ No newline at end of file +end diff --git a/samples/NearSample/Podfile.lock b/samples/NearSample/Podfile.lock index cea88ea..d835bf5 100644 --- a/samples/NearSample/Podfile.lock +++ b/samples/NearSample/Podfile.lock @@ -1,29 +1,25 @@ PODS: - - Hex (6.0.0) - - NearITSDK (2.10.4) - - NearITSDKSwift (2.10.4): - - NearITSDK (= 2.10.4) - - NearUIBinding (2.10.6): - - NearITSDK (~> 2.10.3) + - NearITSDK (2.11.2) + - NearITSDKSwift (2.11.2): + - NearITSDK (= 2.11.2) + - NearUIBinding (2.11.6): + - NearITSDK (~> 2.11.2) DEPENDENCIES: - - Hex - NearITSDKSwift - NearUIBinding SPEC REPOS: https://github.com/cocoapods/specs.git: - - Hex - NearITSDK - NearITSDKSwift - NearUIBinding SPEC CHECKSUMS: - Hex: 3888e06c29fe725b12e33d434e31b06beb4112db - NearITSDK: f0f2329c0d5104c9691f6b4f53e0e956913b9c9e - NearITSDKSwift: 80891431f24a26d92a4c139cd7abb26708dad775 - NearUIBinding: 50d5c9dc008b72c6f973474bbfae1dc5b0ffdc8e + NearITSDK: 2b8e2cd7fc57bbd2d9ccbeab3505c2fb7a6b21b9 + NearITSDKSwift: 0a4432a9a2189c8743e2547c0a1d68f7f58ea4e9 + NearUIBinding: 9e944c25c513689b3c43648a0a2efb8e9d7584c6 -PODFILE CHECKSUM: a482ea61a9d4f309134e51edca5a3abed3dead30 +PODFILE CHECKSUM: f8de3a8491608fd9519554e90f41108e356e855e -COCOAPODS: 1.5.3 +COCOAPODS: 1.6.0