Vasilis

pasting of SwiftWarplyFramework

Showing 197 changed files with 1500 additions and 50 deletions
No preview for this file type
1 -framework module SwiftWarplyFramework {
2 - umbrella header "SwiftWarplyFramework.h"
3 -
4 - export *
5 - module * { export * }
6 -}
7 -
8 -module SwiftWarplyFramework.Swift {
9 - header "SwiftWarplyFramework-Swift.h"
10 - requires objc
11 -}
1 -Pod::Spec.new do |spec|
2 -
3 - spec.name = "SwiftWarplyFramework"
4 - spec.version = "0.0.32"
5 - spec.summary = "A framework used for several functionalities."
6 -
7 - spec.description = "This is the Warply framework used for react native or swift apps for analytics, push notifications and the functionality of the app."
8 -
9 - spec.homepage = "https://git.warp.ly/open-source/warply_sdk_framework.git"
10 -
11 - spec.license = {
12 -:type => 'MIT',
13 -# :file => 'WarplySDKFrameworkIOS/LICENSE.txt'
14 -}
15 -
16 - spec.author = { "billy" => "skourasbl@gmail.com" }
17 -
18 - spec.platform = :ios, "11.0"
19 -
20 - spec.source = { :git => "https://git.warp.ly/open-source/warply_sdk_framework.git", :tag => "0.0.32" }
21 - spec.public_header_files = "SwiftWarplyFramework.framework/Headers/*.h"
22 - spec.source_files = "SwiftWarplyFramework.framework/headers/*.h"
23 - spec.vendored_frameworks = "SwiftWarplyFramework.framework"
24 - spec.exclude_files = "Classes/Exclude"
25 -
26 - # spec.resource_bundles = {
27 - # 'Resources' => ['WarplySDKFrameworkIOS/*.xcassets', 'WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/*.xcassets']
28 - # }
29 - # spec.preserve_paths = 'WarplySDKFrameworkIOS/myApi.h', 'WarplySDKFrameworkIOS/swiftApi.swift'
30 - # spec.vendored_libraries = 'WarplySDKFrameworkIOS/myApi.h', 'WarplySDKFrameworkIOS/swiftApi.swift'
31 - # spec.ios.deployment_target = '11.0'
32 - # spec.frameworks = 'UIKit', 'Foundation'
33 - # spec.requires_arc = true
34 - # spec.subspec 'WarplySDKFrameworkIOS' do |mylib|
35 - # mylib.source_files = 'WarplySDKFrameworkIOS/*.xcassets', 'WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/*.xcassets', "WarplySDKFrameworkIOS/*.png", "WarplySDKFrameworkIOS/*.xcassets", "WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/*.xcassets","WarplySDKFrameworkIOS/*.xib", "WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/*.xib", "WarplySDKFrameworkIOS/*.{h,m}", "WarplySDKFrameworkIOS/*.{h,m}", "WarplySDKFrameworkIOS/**/*.{h,m}", "WarplySDKFrameworkIOS/**/**/*.{h,m}", "WarplySDKFrameworkIOS/**/**/**/*.{h,m}", "WarplySDKFrameworkIOS/*.swift", "*.swift", "WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/*.swift", "WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/WarplySDKFrameworkIOS/*.swift"
36 - # mylib.vendored_frameworks = 'WarplySDKFrameworkIOS/Frameworks/WarplySDKFrameworkIOS.framework'
37 - # end
38 -
39 -end
1 +# Uncomment the next line to define a global platform for your project
2 +# platform :ios, '9.0'
3 +
4 +target 'SwiftWarplyFramework' do
5 + # Comment the next line if you don't want to use dynamic frameworks
6 + use_frameworks!
7 +
8 + # Pods for SwiftWarplyFramework
9 +
10 +end
1 +PODFILE CHECKSUM: 54752dc113f1a895fde22654f99199950788b81a
2 +
3 +COCOAPODS: 1.11.3
1 +PODFILE CHECKSUM: 54752dc113f1a895fde22654f99199950788b81a
2 +
3 +COCOAPODS: 1.11.3
This diff is collapsed. Click to expand it.
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<Scheme
3 + LastUpgradeVersion = "1240"
4 + version = "1.3">
5 + <BuildAction
6 + parallelizeBuildables = "YES"
7 + buildImplicitDependencies = "YES">
8 + <BuildActionEntries>
9 + <BuildActionEntry
10 + buildForTesting = "YES"
11 + buildForRunning = "YES"
12 + buildForProfiling = "YES"
13 + buildForArchiving = "YES"
14 + buildForAnalyzing = "YES">
15 + <BuildableReference
16 + BuildableIdentifier = "primary"
17 + BlueprintIdentifier = "0779DA8BF8CD56EC67C289108B77221C"
18 + BuildableName = "Pods_SwiftWarplyFramework.framework"
19 + BlueprintName = "Pods-SwiftWarplyFramework"
20 + ReferencedContainer = "container:Pods.xcodeproj">
21 + </BuildableReference>
22 + </BuildActionEntry>
23 + </BuildActionEntries>
24 + </BuildAction>
25 + <TestAction
26 + buildConfiguration = "Debug"
27 + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
28 + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
29 + shouldUseLaunchSchemeArgsEnv = "YES">
30 + <Testables>
31 + </Testables>
32 + </TestAction>
33 + <LaunchAction
34 + buildConfiguration = "Debug"
35 + selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36 + selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37 + launchStyle = "0"
38 + useCustomWorkingDirectory = "NO"
39 + ignoresPersistentStateOnLaunch = "NO"
40 + debugDocumentVersioning = "YES"
41 + debugServiceExtension = "internal"
42 + allowLocationSimulation = "YES">
43 + </LaunchAction>
44 + <ProfileAction
45 + buildConfiguration = "Release"
46 + shouldUseLaunchSchemeArgsEnv = "YES"
47 + savedToolIdentifier = ""
48 + useCustomWorkingDirectory = "NO"
49 + debugDocumentVersioning = "YES">
50 + </ProfileAction>
51 + <AnalyzeAction
52 + buildConfiguration = "Debug">
53 + </AnalyzeAction>
54 + <ArchiveAction
55 + buildConfiguration = "Release"
56 + revealArchiveInOrganizer = "YES">
57 + </ArchiveAction>
58 +</Scheme>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>SchemeUserState</key>
6 + <dict>
7 + <key>Pods-SwiftWarplyFramework.xcscheme</key>
8 + <dict>
9 + <key>isShown</key>
10 + <false/>
11 + <key>orderHint</key>
12 + <integer>0</integer>
13 + </dict>
14 + </dict>
15 + <key>SuppressBuildableAutocreation</key>
16 + <dict/>
17 +</dict>
18 +</plist>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>CFBundleDevelopmentRegion</key>
6 + <string>en</string>
7 + <key>CFBundleExecutable</key>
8 + <string>${EXECUTABLE_NAME}</string>
9 + <key>CFBundleIdentifier</key>
10 + <string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
11 + <key>CFBundleInfoDictionaryVersion</key>
12 + <string>6.0</string>
13 + <key>CFBundleName</key>
14 + <string>${PRODUCT_NAME}</string>
15 + <key>CFBundlePackageType</key>
16 + <string>FMWK</string>
17 + <key>CFBundleShortVersionString</key>
18 + <string>1.0.0</string>
19 + <key>CFBundleSignature</key>
20 + <string>????</string>
21 + <key>CFBundleVersion</key>
22 + <string>${CURRENT_PROJECT_VERSION}</string>
23 + <key>NSPrincipalClass</key>
24 + <string></string>
25 +</dict>
26 +</plist>
1 +# Acknowledgements
2 +This application makes use of the following third party libraries:
3 +Generated by CocoaPods - https://cocoapods.org
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>PreferenceSpecifiers</key>
6 + <array>
7 + <dict>
8 + <key>FooterText</key>
9 + <string>This application makes use of the following third party libraries:</string>
10 + <key>Title</key>
11 + <string>Acknowledgements</string>
12 + <key>Type</key>
13 + <string>PSGroupSpecifier</string>
14 + </dict>
15 + <dict>
16 + <key>FooterText</key>
17 + <string>Generated by CocoaPods - https://cocoapods.org</string>
18 + <key>Title</key>
19 + <string></string>
20 + <key>Type</key>
21 + <string>PSGroupSpecifier</string>
22 + </dict>
23 + </array>
24 + <key>StringsTable</key>
25 + <string>Acknowledgements</string>
26 + <key>Title</key>
27 + <string>Acknowledgements</string>
28 +</dict>
29 +</plist>
1 +#import <Foundation/Foundation.h>
2 +@interface PodsDummy_Pods_SwiftWarplyFramework : NSObject
3 +@end
4 +@implementation PodsDummy_Pods_SwiftWarplyFramework
5 +@end
1 +#ifdef __OBJC__
2 +#import <UIKit/UIKit.h>
3 +#else
4 +#ifndef FOUNDATION_EXPORT
5 +#if defined(__cplusplus)
6 +#define FOUNDATION_EXPORT extern "C"
7 +#else
8 +#define FOUNDATION_EXPORT extern
9 +#endif
10 +#endif
11 +#endif
12 +
13 +
14 +FOUNDATION_EXPORT double Pods_SwiftWarplyFrameworkVersionNumber;
15 +FOUNDATION_EXPORT const unsigned char Pods_SwiftWarplyFrameworkVersionString[];
16 +
1 +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
2 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 +PODS_BUILD_DIR = ${BUILD_DIR}
4 +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
5 +PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
6 +PODS_ROOT = ${SRCROOT}/Pods
7 +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
8 +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
1 +framework module Pods_SwiftWarplyFramework {
2 + umbrella header "Pods-SwiftWarplyFramework-umbrella.h"
3 +
4 + export *
5 + module * { export * }
6 +}
1 +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO
2 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 +PODS_BUILD_DIR = ${BUILD_DIR}
4 +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
5 +PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
6 +PODS_ROOT = ${SRCROOT}/Pods
7 +PODS_XCFRAMEWORKS_BUILD_DIR = $(PODS_CONFIGURATION_BUILD_DIR)/XCFrameworkIntermediates
8 +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<Workspace
3 + version = "1.0">
4 + <FileRef
5 + location = "self:">
6 + </FileRef>
7 +</Workspace>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>IDEDidComputeMac32BitWarning</key>
6 + <true/>
7 +</dict>
8 +</plist>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>SchemeUserState</key>
6 + <dict>
7 + <key>SwiftWarplyFramework.xcscheme_^#shared#^_</key>
8 + <dict>
9 + <key>orderHint</key>
10 + <integer>1</integer>
11 + </dict>
12 + </dict>
13 +</dict>
14 +</plist>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<Workspace
3 + version = "1.0">
4 + <FileRef
5 + location = "group:SwiftWarplyFramework.xcodeproj">
6 + </FileRef>
7 + <FileRef
8 + location = "group:Pods/Pods.xcodeproj">
9 + </FileRef>
10 +</Workspace>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 +<plist version="1.0">
4 +<dict>
5 + <key>IDEDidComputeMac32BitWarning</key>
6 + <true/>
7 +</dict>
8 +</plist>
1 +<?xml version="1.0" encoding="UTF-8"?>
2 +<Bucket
3 + uuid = "345EC41C-58C4-464B-B27A-86C325D23C62"
4 + type = "0"
5 + version = "2.0">
6 + <Breakpoints>
7 + <BreakpointProxy
8 + BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
9 + <BreakpointContent
10 + uuid = "CC62D99B-5AEB-4572-83B5-75E063946307"
11 + shouldBeEnabled = "Yes"
12 + ignoreCount = "0"
13 + continueAfterRunningActions = "No"
14 + filePath = "SwiftWarplyFramework/Warply/Warply.m"
15 + startingColumnNumber = "9223372036854775807"
16 + endingColumnNumber = "9223372036854775807"
17 + startingLineNumber = "1149"
18 + endingLineNumber = "1149"
19 + landmarkName = "-verifyTicketWithSuccessBlock:::failureBlock:"
20 + landmarkType = "7">
21 + </BreakpointContent>
22 + </BreakpointProxy>
23 + </Breakpoints>
24 +</Bucket>
1 +//
2 +// ActiveGiftsViewController.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Βασιλης Σκουρας on 11/5/22.
6 +//
7 +
8 +import Foundation
9 +import UIKit
10 +
11 +@objc public class ActiveGiftsViewController: UIViewController {
12 +
13 + @IBOutlet weak var couponButton: UIButton!
14 +
15 + public override func viewWillAppear(_ animated: Bool) {
16 + super.viewWillAppear(animated)
17 + setBackButton()
18 + setNavigationTitle("Ενεργά δώρα")
19 + }
20 +
21 + @IBAction func navigateToCoupon(_ sender: Any) {
22 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
23 + let vc = storyboard.instantiateViewController(withIdentifier: "CouponViewController") as UIViewController
24 + self.navigationController?.pushViewController(vc, animated: true)
25 + }
26 +
27 +}
1 +//
2 +// CampaignViewController.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Βασιλης Σκουρας on 11/5/22.
6 +//
7 +
8 +import Foundation
9 +import UIKit
10 +
11 +@objc public class CampaignViewController: UIViewController {
12 +
13 + public override func viewWillAppear(_ animated: Bool) {
14 + super.viewWillAppear(animated)
15 + setBackButton()
16 + setNavigationTitle("Καμπάνια")
17 + }
18 +
19 +
20 +}
1 +//
2 +// CouponViewController.swift
3 +// WarplySDKFrameworkIOS
4 +//
5 +// Created by Manos Chorianopoulos on 5/5/22.
6 +//
7 +
8 +import UIKit
9 +
10 +class CouponViewController: UIViewController {
11 + @IBOutlet weak var mainView: UIView!
12 + @IBOutlet weak var scrollContentView: UIView!
13 + @IBOutlet weak var couponImageHeight: NSLayoutConstraint!
14 + @IBOutlet weak var redeemButton: UIButton!
15 + @IBOutlet weak var termsLabel: UILabel!
16 +
17 + let uiscreen: CGRect = UIScreen.main.bounds
18 +
19 + override func viewDidLoad() {
20 + super.viewDidLoad()
21 +
22 + // Do any additional setup after loading the view.
23 + setBackButton()
24 + setNavigationTitle("Εκπτωτικό κουπόνι")
25 +
26 + mainView.clipsToBounds = true
27 + mainView.layer.cornerRadius = 30
28 + mainView.layer.maskedCorners = [ .layerMinXMinYCorner] // Top left corner radius
29 +
30 + couponImageHeight.constant = self.uiscreen.height * 0.25
31 +
32 + redeemButton.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .medium)
33 +
34 + termsLabel.font = UIFont.systemFont(ofSize: 14, weight: UIFont.Weight.medium)
35 + let tap = UITapGestureRecognizer(target: self, action: #selector(CouponViewController.termsTapFunction))
36 + termsLabel.isUserInteractionEnabled = true
37 + termsLabel.addGestureRecognizer(tap)
38 + }
39 +
40 +
41 + // MARK: - Actions
42 +
43 + @objc func termsTapFunction(sender:UITapGestureRecognizer) {
44 + print("Terms tapped!")
45 + }
46 +
47 + @IBAction func redeemButtomAction(_ sender: Any) {
48 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
49 + let vc = storyboard.instantiateViewController(withIdentifier: "MakeItAPresentViewController") as UIViewController
50 + self.navigationController?.pushViewController(vc, animated: true)
51 + }
52 +}
53 +
1 +//
2 +// CouponsViewController.swift
3 +// WarplySDKFrameworkIOS
4 +//
5 +// Created by Βασιλης Σκουρας on 4/5/22.
6 +//
7 +
8 +import Foundation
9 +import UIKit
10 +
11 +@objc public class CouponsViewController: UIViewController {
12 +
13 + @IBOutlet weak var couponButton: UIButton!
14 +
15 + public override func viewWillAppear(_ animated: Bool) {
16 + super.viewWillAppear(animated)
17 + setBackButton()
18 + setNavigationTitle("Εκπτωτικό κουπόνι")
19 + }
20 +
21 +
22 + @IBAction func navigateToCoupon(_ sender: Any) {
23 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
24 + let vc = storyboard.instantiateViewController(withIdentifier: "CouponViewController") as UIViewController
25 + self.navigationController?.pushViewController(vc, animated: true)
26 + }
27 +}
1 +//
2 +// DetailsViewController.swift
3 +// WarplySDKFrameworkIOS
4 +//
5 +// Created by Βασιλης Σκουρας on 5/5/22.
6 +//
7 +
8 +import Foundation
9 +import UIKit
10 +
11 +@objc public class DetailsViewController: UIViewController {
12 + public override func viewWillAppear(_ animated: Bool) {
13 + super.viewWillAppear(animated)
14 + setBackButton()
15 + setNavigationTitle("Ανάλυση")
16 + }
17 +}
1 +//
2 +// GiftsViewController.swift
3 +// WarplySDKFrameworkIOS
4 +//
5 +// Created by Βασιλης Σκουρας on 5/5/22.
6 +//
7 +
8 +import Foundation
9 +import UIKit
10 +
11 +@objc public class GiftsViewController: UIViewController {
12 +
13 + @IBOutlet weak var campaignButton: UIButton!
14 +
15 + @IBOutlet weak var couponButton: UIButton!
16 +
17 + public override func viewWillAppear(_ animated: Bool) {
18 + super.viewWillAppear(animated)
19 + setBackButton()
20 + setNavigationTitle("Gifts for You")
21 + }
22 +
23 + @IBAction func navigateToCampaign(_ sender: Any) {
24 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
25 + let vc = storyboard.instantiateViewController(withIdentifier: "CampaignViewController") as UIViewController
26 + self.navigationController?.pushViewController(vc, animated: true)
27 + }
28 +
29 + @IBAction func navigateToCoupon(_ sender: Any) {
30 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
31 + let vc = storyboard.instantiateViewController(withIdentifier: "CouponViewController") as UIViewController
32 + self.navigationController?.pushViewController(vc, animated: true)
33 + }
34 +}
1 +//
2 +// WarplyEvents.h
3 +// App
4 +//
5 +// Created by Fotios Kalaitzidis on 23/10/2018.
6 +// Copyright © 2018 Facebook. All rights reserved.
7 +//
8 +#import <Foundation/Foundation.h>
9 +
10 +@interface WarplyReactMethods : NSObject
11 +
12 +@end
1 +//
2 +// WarplyEvents.m
3 +// App
4 +//
5 +// Created by Fotios Kalaitzidis on 23/10/2018.
6 +// Copyright © 2018 Facebook. All rights reserved.
7 +//
8 +
9 +#import "WarplyReactMethods.h"
10 +#import "WLUserManager.h"
11 +#import "WLAnalyticsManager.h"
12 +#import "Warply.h"
13 +#import <AdSupport/AdSupport.h>
14 +
15 +@implementation WarplyReactMethods
16 +- (void) sendEvent: (NSString *) eventName priority: (BOOL) priority {
17 + NSString *event_Name = eventName;
18 + NSNumber *time_submitted = [NSNumber numberWithDouble:[[NSDate date] timeIntervalSince1970]];
19 + NSDictionary *inapp_event = [NSDictionary dictionaryWithObjectsAndKeys:event_Name, @"event_id", nil, @"page_id", time_submitted, @"time_submitted", nil, @"action_metadata", nil];
20 + NSDictionary *eventContext = [NSDictionary dictionaryWithObject:inapp_event forKey:@"inapp_analytics"];
21 + WLEventSimple *simpleEvent = [[WLEventSimple alloc] initWithType:@"inapp_analytics" andContext:eventContext];
22 +
23 + [[Warply sharedService] addEvent:simpleEvent priority:priority];
24 +}
25 +
26 +- (NSString *) getUniqueId {
27 + return [[[UIDevice currentDevice] identifierForVendor] UUIDString];
28 +}
29 +
30 +
31 +- (NSString *) getAdvertisementId {
32 + return [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString];
33 +}
34 +
35 +
36 +@end
1 +//
2 +// MFYViewController.swift
3 +// WarplySDKFrameworkIOS
4 +//
5 +// Created by Βασιλης Σκουρας on 5/5/22.
6 +//
7 +
8 +import Foundation
9 +import UIKit
10 +
11 +@objc public class MFYViewController: UIViewController {
12 + public override func viewWillAppear(_ animated: Bool) {
13 + super.viewWillAppear(animated)
14 + setBackButton()
15 + setNavigationTitle("More for you")
16 + }
17 +}
This diff is collapsed. Click to expand it.
1 +//
2 +// MakeItAPresentViewController.swift
3 +// SwiftWarplyFramework
4 +//
5 +// Created by Βασιλης Σκουρας on 11/5/22.
6 +//
7 +
8 +import Foundation
9 +import UIKit
10 +
11 +@objc public class MakeItAPresentViewController: UIViewController {
12 +
13 + public override func viewWillAppear(_ animated: Bool) {
14 + super.viewWillAppear(animated)
15 + setBackButton()
16 + setNavigationTitle("Κάντο δώρο!")
17 + }
18 +
19 +
20 +}
1 +{
2 + "info" : {
3 + "author" : "xcode",
4 + "version" : 1
5 + }
6 +}
1 +{
2 + "images" : [
3 + {
4 + "filename" : "ic_back.png",
5 + "idiom" : "universal",
6 + "scale" : "1x"
7 + },
8 + {
9 + "filename" : "ic_back-1.png",
10 + "idiom" : "universal",
11 + "scale" : "2x"
12 + },
13 + {
14 + "filename" : "ic_back-2.png",
15 + "idiom" : "universal",
16 + "scale" : "3x"
17 + }
18 + ],
19 + "info" : {
20 + "author" : "xcode",
21 + "version" : 1
22 + }
23 +}
This diff is collapsed. Click to expand it.
1 +//
2 +// MyEmptyClass.swift
3 +// WarplySDKFrameworkIOS
4 +//
5 +// Created by Βασιλης Σκουρας on 14/4/22.
6 +//
7 +
8 +import Foundation
9 +
10 +public class MyEmptyClass {
11 +
12 +}
1 +# ``SwiftWarplyFramework``
2 +
3 +<!--@START_MENU_TOKEN@-->Summary<!--@END_MENU_TOKEN@-->
4 +
5 +## Overview
6 +
7 +<!--@START_MENU_TOKEN@-->Text<!--@END_MENU_TOKEN@-->
8 +
9 +## Topics
10 +
11 +### <!--@START_MENU_TOKEN@-->Group<!--@END_MENU_TOKEN@-->
12 +
13 +- <!--@START_MENU_TOKEN@-->``Symbol``<!--@END_MENU_TOKEN@-->
...\ No newline at end of file ...\ No newline at end of file
1 +//
2 +// ViewControllerExtensions.swift
3 +// WarplySDKFrameworkIOS
4 +//
5 +// Created by Manos Chorianopoulos on 5/5/22.
6 +//
7 +
8 +import UIKit
9 +
10 +extension UIViewController {
11 + func setBackButton() {
12 + let uiscreen: CGRect = UIScreen.main.bounds
13 +
14 + let backButton = UIButton(type: UIButton.ButtonType.custom) as UIButton
15 + backButton.frame = CGRect(x: 0, y: 0, width: uiscreen.height * 0.025, height: uiscreen.height * 0.02)
16 + backButton.imageView!.contentMode = .scaleAspectFit
17 + //backButton.setBackgroundImage(UIImage(named:Assets.Navigation.backButton), for: UIControlState())
18 + backButton.setImage(UIImage(named: "ic_back", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil), for: .normal)
19 +// backButton.imageEdgeInsets = UIEdgeInsets(top: 0, left: -20, bottom: 0, right: 0)
20 + backButton.addTarget(self, action: #selector(moveToBack(_:)), for: .touchUpInside)
21 +
22 +
23 + backButton.translatesAutoresizingMaskIntoConstraints = false
24 + // Add width, height constraints
25 + let widthContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.width, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: uiscreen.height * 0.025)
26 + let heightContraints = NSLayoutConstraint(item: backButton, attribute: NSLayoutConstraint.Attribute.height, relatedBy: NSLayoutConstraint.Relation.equal, toItem: nil, attribute: NSLayoutConstraint.Attribute.notAnAttribute, multiplier: 1, constant: uiscreen.height * 0.02)
27 + NSLayoutConstraint.activate([heightContraints,widthContraints])
28 +
29 + let leftBarButtonItem: UIBarButtonItem = UIBarButtonItem(customView: backButton)
30 + self.navigationItem.setLeftBarButton(leftBarButtonItem, animated: false)
31 + self.navigationItem.title = ""
32 + }
33 +
34 +
35 + @objc func moveToBack(_ sender:UIButton){
36 + self.navigationController?.popViewController(animated: true)
37 + }
38 +
39 + func setNavigationTitle(_ title: String) {
40 + let uiscreen: CGRect = UIScreen.main.bounds
41 +
42 + let titleLabel = UILabel(frame: CGRect(x: 0, y: 0, width: uiscreen.width * 0.7, height: uiscreen.height * 0.03))
43 + titleLabel.text = title
44 + titleLabel.textColor = UIColor(red: 0.21, green: 0.32, blue: 0.41, alpha: 1.00)
45 + titleLabel.font = UIFont.systemFont(ofSize: 16, weight: UIFont.Weight.medium)
46 + titleLabel.adjustsFontSizeToFitWidth = true
47 + titleLabel.textAlignment = .center
48 + self.navigationItem.titleView = titleLabel
49 +
50 + }
51 +}
1 +//
2 +// WalletViewController.swift
3 +// WarplySDKFrameworkIOS
4 +//
5 +// Created by Βασιλης Σκουρας on 5/5/22.
6 +//
7 +
8 +import Foundation
9 +import UIKit
10 +
11 +@objc public class WalletViewController: UIViewController {
12 +
13 + @IBOutlet weak var activeGiftsButton: UIButton!
14 +
15 + public override func viewWillAppear(_ animated: Bool) {
16 + super.viewWillAppear(animated)
17 + setBackButton()
18 + setNavigationTitle("My loyalty wallet")
19 + }
20 +
21 + @IBAction func navigateToActiveGifts(_ sender: Any) {
22 + let storyboard = UIStoryboard(name: "Main", bundle: Bundle(for: MyEmptyClass.self))
23 + let vc = storyboard.instantiateViewController(withIdentifier: "ActiveGiftsViewController") as UIViewController
24 + self.navigationController?.pushViewController(vc, animated: true)
25 + }
26 +}
1 +/*
2 + Copyright 2010-2016 Warply Inc. All rights reserved.
3 +
4 + Redistribution and use in source and binary forms, without modification,
5 + are permitted provided that the following conditions are met:
6 +
7 + 1. Redistributions of source code must retain the above copyright notice, this
8 + list of conditions and the following disclaimer.
9 +
10 + 2. Redistributions in binaryform must reproduce the above copyright notice,
11 + this list of conditions and the following disclaimer in the documentation
12 + and/or other materials provided with the distribution.
13 +
14 + THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
15 + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 + EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 + */
25 +
26 +/*!
27 + @header WLEvent.h
28 + The WLEvent provides a functional interface for Warply events.
29 + Use the methods declared here to initialise and create events with arbitrary
30 + context and type.
31 + @copyright Warply Inc.
32 + */
33 +#import <Foundation/Foundation.h>
34 +
35 +/*!
36 + @class WLEvent
37 + @discussion This class provides methods for creating an event with arbitrary
38 + context.
39 + */
40 +@interface WLEvent : NSObject
41 +{
42 +@protected
43 + NSString *_time;
44 + NSMutableDictionary *_data;
45 +}
46 +
47 +/*!
48 + @methodgroup Class Methods
49 + @discussion Convinience class methods for initialising an event.
50 + */
51 +/*!
52 + @abstract Creates an event.
53 + @discussion Initializes and returns a newly allocated WLEvent object.
54 + Initializes and returns a newly allocated WLEvent object.
55 + @return Returns WLEvent object.
56 + */
57 ++ (id)event;
58 +/*!
59 + @abstract Creates an event with arbitrary context.
60 + @discussion Initializes and returns a newly allocated WLEvent object with the
61 + arbitrary context.
62 + @param context A dictionary object with arbitrary key-value entries.
63 + @return Returns WLEvent object.
64 + */
65 ++ (id)eventWithContext:(NSDictionary*)context;
66 +
67 +/*!
68 + @property time
69 + @abstract A string with event created time in epoch format. Read only property.
70 + */
71 +@property (nonatomic, readonly) NSString *time;
72 +/*!
73 + @property data
74 + @abstract A dictionary with event context. Read only property.
75 + */
76 +@property (nonatomic, readonly) NSMutableDictionary *data;
77 +
78 +/*!
79 + @methodgroup Initialising Event
80 + */
81 +/*!
82 + @abstract Initialise an WLevent object.
83 + @discussion Initializes and returns a newly allocated WLEvent object with the
84 + arbitrary context.
85 + @param context A dictionary object with arbitrary key-value entries.
86 + @return Returns WLEvent object.
87 + */
88 +- (id)initWithContext:(NSDictionary*)context;
89 +/*!
90 + @methodgroup Getting Event Type
91 + */
92 +/*!
93 + @abstract Get event type.
94 + @discussion This method returns the type of the event.
95 + @return Returns a string object with event type.
96 + */
97 +- (NSString *)getType;
98 +/*!
99 + @methodgroup Adding Context to Event
100 + */
101 +/*!
102 + @abstract Add context to event.
103 + @discussion This method adds a key-value pair to existing context of an event.
104 + @param value An id object with the value of the key.
105 + @param key A string object with the key of the value.
106 + */
107 +- (void)addDataWithValue:(id)value forKey:(NSString*)key;
108 +
109 +@end
110 +
111 +/*!
112 + @class WLEventSimple
113 + @discussion This class provides methods for creating an event with arbitrary
114 + context and type.
115 + */
116 +@interface WLEventSimple : WLEvent
117 +{
118 +@private
119 + NSString *_type;
120 +}
121 +
122 +/*!
123 + @methodgroup Class Methods
124 + @discussion Convinience class methods for initialising an event.
125 + */
126 +/*!
127 + @abstract Creates an event with arbitrary type.
128 + @discussion Initializes and returns a newly allocated WLEventSimple object
129 + with arbitrary type.
130 + @param aType A string object with the event type.
131 + @return Returns WLEvent object.
132 + */
133 ++ (id)eventWithType:(NSString*)aType;
134 +/*!
135 + @abstract Creates an event with arbitrary type and context.
136 + @discussion Initializes and returns a newly allocated WLEventSimple object
137 + with arbitrary type and context.
138 + @param aType A string object with the event type.
139 + @param context A dictionary with arbitrary context.
140 + @return Returns WLEvent object.
141 + */
142 ++ (id)eventWithType:(NSString*)aType andContext:(NSDictionary*)context;
143 +
144 +/*!
145 + @methodgroup Initialising Event
146 + */
147 +/*!
148 + @abstract Initialise an event with arbitrary type.
149 + @discussion Initializes and returns a newly allocated WLEvent object with the
150 + arbitrary type.
151 + @param aType A string object with the event type.
152 + @return Returns WLEvent object.
153 + */
154 +- (id)initWithType:(NSString*)aType;
155 +/*!
156 + @abstract Initialise an event with arbitrary type and context.
157 + @discussion Initializes and returns a newly allocated WLEvent object with the
158 + arbitrary type and context.
159 + @param aType A string object with the event type.
160 + @param context A dictionary with arbitrary context.
161 + @return Returns WLEvent object.
162 + */
163 +- (id)initWithType:(NSString*)aType andContext:(NSDictionary*)context;
164 +
165 +@end
1 +/*
2 + Copyright 2010-2016 Warply Inc. All rights reserved.
3 +
4 + Redistribution and use in source and binary forms, without modification,
5 + are permitted provided that the following conditions are met:
6 +
7 + 1. Redistributions of source code must retain the above copyright notice, this
8 + list of conditions and the following disclaimer.
9 +
10 + 2. Redistributions in binaryform must reproduce the above copyright notice,
11 + this list of conditions and the following disclaimer in the documentation
12 + and/or other materials provided with the distribution.
13 +
14 + THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
15 + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 + EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 + */
25 +
26 +#import "WLEvent.h"
27 +#import "WLGlobals.h"
28 +
29 +@interface WLEvent()
30 +
31 +- (void)gatherIndividualData:(NSDictionary*)context;
32 +- (void)gatherData:(NSDictionary*)context;
33 +
34 +@end
35 +
36 +@implementation WLEvent
37 +
38 +@synthesize time = _time;
39 +@synthesize data = _data;
40 +
41 +#pragma mark - Static Methods
42 +///////////////////////////////////////////////////////////////////////////////////////////////////
43 ++ (id)event
44 +{
45 +#if ! __has_feature(objc_arc)
46 + return [[[self alloc] init] autorelease];
47 +#else
48 + return [[self alloc] init];
49 +#endif
50 +}
51 +
52 +///////////////////////////////////////////////////////////////////////////////////////////////////
53 ++ (id)eventWithContext:(NSDictionary*)context
54 +{
55 +#if ! __has_feature(objc_arc)
56 + return [[[self alloc] initWithContext:context] autorelease];
57 +#else
58 + return [[self alloc] initWithContext:context];
59 +#endif
60 +}
61 +
62 +#pragma mark - Initialization
63 +///////////////////////////////////////////////////////////////////////////////////////////////////
64 +- (id)init
65 +{
66 + self = [super init];
67 + if (self) {
68 + _data = [NSMutableDictionary new];
69 + }
70 +
71 + return self;
72 +}
73 +
74 +///////////////////////////////////////////////////////////////////////////////////////////////////
75 +- (id)initWithContext:(NSDictionary*)context
76 +{
77 + self = [self init];
78 + if (self) {
79 + [self gatherData:context];
80 + }
81 +
82 + return self;
83 +}
84 +
85 +#pragma mark - Public Methods
86 +///////////////////////////////////////////////////////////////////////////////////////////////////
87 +- (NSString*)getType
88 +{
89 + return @"base";
90 +}
91 +
92 +///////////////////////////////////////////////////////////////////////////////////////////////////
93 +- (void)addDataWithValue:(id)value forKey:(NSString*)key
94 +{
95 + if (value && key)
96 + [_data setObject:value forKey:key];
97 +}
98 +
99 +#pragma mark - Private Methods
100 +///////////////////////////////////////////////////////////////////////////////////////////////////
101 +- (void)gatherIndividualData:(NSDictionary*)context { }
102 +
103 +///////////////////////////////////////////////////////////////////////////////////////////////////
104 +- (void)gatherData:(NSDictionary*)context {
105 + // in case we re-use a event object
106 + _time = [NSString stringWithFormat:@"%f",[[NSDate date] timeIntervalSince1970]];
107 + [_data removeAllObjects];
108 +
109 + // gather individual data
110 + [self gatherIndividualData:context];
111 +}
112 +
113 +@end
114 +
115 +///////////////////////////////////////////////////////////////////////////////////////////////////
116 +@implementation WLEventSimple
117 +
118 +#pragma mark - Static Methods
119 +///////////////////////////////////////////////////////////////////////////////////////////////////
120 ++ (id)eventWithType:(NSString*)aType
121 +{
122 + return [[self alloc] initWithType:aType];
123 +}
124 +
125 +///////////////////////////////////////////////////////////////////////////////////////////////////
126 ++ (id)eventWithType:(NSString*)aType andContext:(NSDictionary*)context
127 +{
128 + return [[self alloc] initWithType:aType andContext:context];
129 +}
130 +
131 +#pragma mark - Initialization
132 +///////////////////////////////////////////////////////////////////////////////////////////////////
133 +- (id)initWithType:(NSString*)aType
134 +{
135 + self=[super init];
136 + if (self) {
137 + _type = aType;
138 + }
139 + return self;
140 +}
141 +
142 +///////////////////////////////////////////////////////////////////////////////////////////////////
143 +- (id)initWithType:(NSString*)aType andContext:(NSDictionary*)context
144 +{
145 + self = [super initWithContext:context];
146 + if (self) {
147 + _type = aType;
148 + }
149 +
150 + return self;
151 +}
152 +
153 +#pragma mark - Public Methods
154 +///////////////////////////////////////////////////////////////////////////////////////////////////
155 +- (NSString*)getType
156 +{
157 + return _type;
158 +}
159 +
160 +#pragma mark - Override Methods
161 +///////////////////////////////////////////////////////////////////////////////////////////////////
162 +- (void)gatherIndividualData:(NSDictionary*)context
163 +{
164 + WLLOG(@"WLEvent Context: %@", context);
165 + [_data addEntriesFromDictionary:context];
166 +}
167 +
168 +@end
1 +/*
2 + Copyright 2010-2016 Warply Inc. All rights reserved.
3 +
4 + Redistribution and use in source and binary forms, without modification,
5 + are permitted provided that the following conditions are met:
6 +
7 + 1. Redistributions of source code must retain the above copyright notice, this
8 + list of conditions and the following disclaimer.
9 +
10 + 2. Redistributions in binaryform must reproduce the above copyright notice,
11 + this list of conditions and the following disclaimer in the documentation
12 + and/or other materials provided with the distribution.
13 +
14 + THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
15 + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 + EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 + */
25 +
26 +///////////////////////////////////////////////////////////////////////////////
27 +// Base URL
28 +//#define WARP_PRODUCTION_BASE_URL @"https://engage-stage.warp.ly"
29 +//#define WARP_HOST @"engage-stage.warp.ly"
30 +//#define WARP_ERROR_DOMAIN @"engage-stage.warp.ly"
31 +extern NSString* WARP_PRODUCTION_BASE_URL;
32 +extern NSString* WARP_HOST;
33 +extern NSString* WARP_ERROR_DOMAIN;
34 +extern NSString* MERCHANT_ID;
35 +extern NSString* LANG;
36 +#define WARP_PAGE_URL_FORMAT @"%@/api/session/%@"
37 +#define WARP_IMAGE_URL_FORMAT @"%@/api/session/logo/%@"
38 +
39 +///////////////////////////////////////////////////////////////////////////////
40 +// Settings
41 +#ifdef _WL_VERSION
42 +#define WL_VERSION @ _WL_VERSION
43 +#else
44 +#define WL_VERSION @ "3.2.0a"
45 +#endif
46 +
47 +#define GEOFENCING_POIS_ENABLED @"GEOFENCING_POIS_ENABLED"
48 +#define WL_IOS_LOCATION_FOREGROUND_MODE @"IOS_LOCATION_FOREGROUND_MODE"
49 +#define WL_IOS_LOCATION_BACKGROUND_MODE @"IOS_LOCATION_BACKGROUND_MODE"
50 +#define WL_IOS_GEOFENCING_ENABLED @"IOS_GEOFENCING_ENABLED"
51 +#define WL_IOS_FOREGROUND_DISTANCE_FILTER @"IOS_FOREGROUND_DISTANCE_FILTER"
52 +#define WL_IOS_BACKGROUND_DISTANCE_FILTER @"IOS_BACKGROUND_DISTANCE_FILTER"
53 +#define WL_DEVICE_INFO_ENABLED @"DEVICE_INFO_ENABLED"
54 +#define WL_OFFERS_ENABLED @"OFFERS_ENABLED"
55 +#define WL_CONSUMER_DATA_ENABLED @"CONSUMER_DATA_ENABLED"
56 +#define WL_USER_SESSION_ENABLED @"USER_SESSION_ENABLED"
57 +#define WL_CUSTOM_ANALYTICS_ENABLED @"CUSTOM_ANALYTICS_ENABLED"
58 +#define WL_USER_TAGGING_ENABLED @"USER_TAGGING_ENABLED"
59 +#define WL_APPLICATION_DATA_ENABLED @"APPLICATION_DATA_ENABLED"
60 +#define WL_WARPLY_ENABLED @"WARPLY_ENABLED"
61 +#define WL_FEATURES_CHECK_INTERVAL @"FEATURES_CHECK_INTERVAL"
62 +#define WL_LIFECYCLE_ANALYTICS_ENABLED @"LIFECYCLE_ANALYTICS_ENABLED"
63 +#define WL_IOS_LOCATION_FOREGROUND_DESIRED_ACCURACY @"IOS_LOCATION_FOREGROUND_DESIRED_ACCURACY"
64 +#define WL_IOS_LOCATION_BACKGROUND_DESIRED_ACCURACY @"IOS_LOCATION_BACKGROUND_DESIRED_ACCURACY"
65 +#define WL_IOS_DEVICE_IS_WARPED @"is_warped"
66 +#define WL_IOS_DEVICE_HAS_DEVICE_INFO @"has_device_info"
67 +#define WL_IOS_DEVICE_HAS_APPLICATION_INFO @"has_application_info"
68 +#define WL_FEATURE_IS_DISABLED_WITH_KEY(KEY) \
69 + ([[NSUserDefaults standardUserDefaults] boolForKey:KEY] == NO \
70 + && [[NSUserDefaults standardUserDefaults] objectForKey:KEY] != nil) \
71 +
72 +#define WL_WARP_NOTIFICATIONS_ENABLED @"warp_enabled"
73 +#define WL_APPLICATION_DATA @"application_data"
74 +#define WL_DEVICE_STATUS @"device_status"
75 +#define WL_BEACON_ENABLED @"BEACON_ENABLED"
76 +#define WL_BEACON_TIME_INTERVAL_TO_RESEND @"BEACON_TIME_INTERVAL_TO_RESEND"
77 +
78 +///////////////////////////////////////////////////////////////////////////////
79 +// Logging
80 +#ifdef DEBUG
81 +#define WLLOG(xx, ...) NSLog(@"%s(%d): " xx, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
82 +#else
83 +#define WLLOG(xx, ...) ((void)0)
84 +#endif // #ifdef DEBUG
85 +
86 +///////////////////////////////////////////////////////////////////////////////
87 +// Version Interface
88 +#define WL_VERSION_INTERFACE() \
89 ++ (NSString *)get;
90 +
91 +#define WL_VERSION_IMPLEMENTATION(VERSION_STR) \
92 ++ (NSString *)get { \
93 + return VERSION_STR; \
94 +} \
95 +
96 +///////////////////////////////////////////////////////////////////////////////
97 +// System Versioning
98 +#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
99 +#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
100 +#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
101 +#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
102 +#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
103 +
104 +///////////////////////////////////////////////////////////////////////////////
105 +// Enum Versioning
106 +#ifdef __IPHONE_6_0 // iOS6 and later
107 +# define WLTextAlignmentCenter NSTextAlignmentCenter
108 +# define WLTextAlignmentLeft NSTextAlignmentLeft
109 +# define WLTextAlignmentRight NSTextAlignmentRight
110 +# define WLTextTruncationTail NSLineBreakByTruncatingTail
111 +# define WLTextTruncationMiddle NSLineBreakByWordWrapping
112 +# define WLLineBreakByWordWrapping NSLineBreakByWordWrapping
113 +#else // older versions
114 +# define WLTextAlignmentCenter UITextAlignmentCenter
115 +# define WLTextAlignmentLeft UITextAlignmentLeft
116 +# define WLTextAlignmentRight UITextAlignmentRight
117 +# define WLTextTruncationTail UILineBreakModeTailTruncation
118 +# define WLTextTruncationMiddle UILineBreakModeMiddleTruncation
119 +# define WLLineBreakByWordWrapping UILineBreakModeWordWrap
120 +#endif
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
1 +/*
2 + Copyright 2010-2016 Warply Inc. All rights reserved.
3 +
4 + Redistribution and use in source and binary forms, without modification,
5 + are permitted provided that the following conditions are met:
6 +
7 + 1. Redistributions of source code must retain the above copyright notice, this
8 + list of conditions and the following disclaimer.
9 +
10 + 2. Redistributions in binaryform must reproduce the above copyright notice,
11 + this list of conditions and the following disclaimer in the documentation
12 + and/or other materials provided with the distribution.
13 +
14 + THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
15 + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 + EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 + */
25 +
26 +#import <Foundation/Foundation.h>
27 +#import <StoreKit/StoreKit.h>
28 +#import "Warply.h"
29 +
30 +@interface WLAPPActionHandler : NSObject <WLActionHandler,SKStoreProductViewControllerDelegate>
31 +
32 +@end
1 +/*
2 + Copyright 2010-2016 Warply Inc. All rights reserved.
3 +
4 + Redistribution and use in source and binary forms, without modification,
5 + are permitted provided that the following conditions are met:
6 +
7 + 1. Redistributions of source code must retain the above copyright notice, this
8 + list of conditions and the following disclaimer.
9 +
10 + 2. Redistributions in binaryform must reproduce the above copyright notice,
11 + this list of conditions and the following disclaimer in the documentation
12 + and/or other materials provided with the distribution.
13 +
14 + THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
15 + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 + EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 + */
25 +
26 +#import "WLAPPActionHandler.h"
27 +#import "WLAnalyticsManager.h"
28 +#import "WLInboxItemViewController.h"
29 +#import "NSString+SSToolkitAdditions.h"
30 +#import "UIViewController+WLAdditions.h"
31 +
32 +@interface WLAPPActionHandler ()
33 +
34 +@property (nonatomic, assign) WLInboxItemViewController *inboxVC;
35 +@property (nonatomic) BOOL *loadingProduct;
36 +@end
37 +
38 +
39 +@implementation WLAPPActionHandler
40 +
41 +#pragma mark - Static Methods
42 +////////////////////////////////////////////////////////////////////////////////
43 +- (BOOL)canHandleActionUrl:(NSURL *)url
44 +{
45 + return [url.scheme isEqualToString: @"itms-apps"];
46 +}
47 +
48 +#pragma mark - Override Methods
49 +////////////////////////////////////////////////////////////////////////////////
50 +- (void)handleActionUrl:(NSURL *)url
51 +{
52 + UINavigationController *inboxNavCon = (UINavigationController *)[([UIApplication sharedApplication].delegate).window.rootViewController topModalViewController];
53 + self.inboxVC = [inboxNavCon.viewControllers objectAtIndex:0];
54 +
55 + NSString *appID = nil;
56 +
57 + if ([SKStoreProductViewController class]) {
58 + __block SKStoreProductViewController *storeViewController = [[SKStoreProductViewController alloc] init];
59 + storeViewController.delegate = self;
60 + NSString *escapedResourceSpecifier = [url.resourceSpecifier stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
61 + NSRange appIDRange = [escapedResourceSpecifier rangeOfString:@"id"];
62 + NSRange appQuestionMarkRange = [escapedResourceSpecifier rangeOfString:@"?"];
63 +
64 + if (appIDRange.location != NSNotFound && appQuestionMarkRange.location != NSNotFound) {
65 + appID = [escapedResourceSpecifier substringWithRange:NSMakeRange(appIDRange.location + 2, appQuestionMarkRange.location - (appIDRange.location + 2))];
66 + }
67 +
68 + NSDictionary *parameters = @{SKStoreProductParameterITunesItemIdentifier:[NSNumber numberWithInteger:[appID intValue]]};
69 + [storeViewController loadProductWithParameters:parameters
70 + completionBlock:^(BOOL result, NSError *error) {
71 + if (result) {
72 + [self.inboxVC presentViewController:storeViewController animated:YES completion:nil];
73 + }
74 + }];
75 + } else {
76 + [[UIApplication sharedApplication] openURL:url];
77 + }
78 +
79 + [WLAnalyticsManager logUrgentEventWithEventId:@"NB_CUSTOM_ACTION" pageId:@"APP_DOWNLOAD" actionMetadata:@{@"result":@[@"APPSTORE"], @"session_uuid":self.inboxVC.session_uuid, @"url": [url absoluteString]}];
80 +}
81 +
82 +#pragma mark - SKStoreProductViewControllerDelegate
83 +////////////////////////////////////////////////////////////////////////////////
84 +-(void)productViewControllerDidFinish:(SKStoreProductViewController *)viewController
85 +{
86 + [viewController dismissViewControllerAnimated:YES completion:nil];
87 +}
88 +
89 +@end
1 +/*
2 + Copyright 2010-2016 Warply Inc. All rights reserved.
3 +
4 + Redistribution and use in source and binary forms, without modification,
5 + are permitted provided that the following conditions are met:
6 +
7 + 1. Redistributions of source code must retain the above copyright notice, this
8 + list of conditions and the following disclaimer.
9 +
10 + 2. Redistributions in binaryform must reproduce the above copyright notice,
11 + this list of conditions and the following disclaimer in the documentation
12 + and/or other materials provided with the distribution.
13 +
14 + THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
15 + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 + EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 + */
25 +
26 +#import <MessageUI/MessageUI.h>
27 +#import "Warply.h"
28 +
29 +@interface WLSMSActionHandlerDeprecated : NSObject <MFMessageComposeViewControllerDelegate, WLActionHandler>
30 +
31 +@end
1 +/*
2 + Copyright 2010-2016 Warply Inc. All rights reserved.
3 +
4 + Redistribution and use in source and binary forms, without modification,
5 + are permitted provided that the following conditions are met:
6 +
7 + 1. Redistributions of source code must retain the above copyright notice, this
8 + list of conditions and the following disclaimer.
9 +
10 + 2. Redistributions in binaryform must reproduce the above copyright notice,
11 + this list of conditions and the following disclaimer in the documentation
12 + and/or other materials provided with the distribution.
13 +
14 + THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
15 + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 + EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 + */
25 +
26 +#import "WLSMSActionHandlerDeprecated.h"
27 +#import "WLGlobals.h"
28 +#import "WLInboxItemViewController.h"
29 +#import "UIViewController+WLAdditions.h"
30 +
31 +@interface WLSMSActionHandlerDeprecated ()
32 +@property (nonatomic , weak) WLInboxItemViewController *inboxVC;
33 +@end
34 +
35 +@implementation WLSMSActionHandlerDeprecated
36 +
37 +#pragma mark - Static Methods
38 +///////////////////////////////////////////////////////////////////////////////////////////////////
39 +- (BOOL)canHandleActionUrl:(NSURL *)url
40 +{
41 + return [[url scheme] isEqualToString: @"rsms"];
42 +}
43 +
44 +#pragma mark - Override Methods
45 +///////////////////////////////////////////////////////////////////////////////////////////////////
46 +- (void)handleActionUrl:(NSURL *)url
47 +{
48 + self.inboxVC = (WLInboxItemViewController *)[([UIApplication sharedApplication].delegate).window.rootViewController topModalViewController];
49 +
50 +
51 + NSArray *args = [url.resourceSpecifier componentsSeparatedByString:@"/"];
52 + if (args == nil)
53 + return;
54 +
55 + if ([args count] < 4)
56 + return;
57 +
58 + MFMessageComposeViewController *smsController = [[MFMessageComposeViewController alloc] init];
59 + @try {
60 + [smsController setRecipients:[NSArray arrayWithObject:[args objectAtIndex:4]]];
61 + //[smsController setBody:[NSString stringWithFormat:@"Hello from %@", BRAND_NAME]];
62 +
63 + if ([args count] > 4) {
64 + NSString *body = [[args objectAtIndex:5] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
65 + [smsController setBody:body];
66 + }
67 +
68 + [smsController setMessageComposeDelegate:self];
69 + [_inboxVC presentViewController:smsController animated:YES completion:nil];
70 + }
71 + @finally {
72 +
73 + }
74 +}
75 +
76 +#pragma mark - MFMessageComposeViewControllerDelegate
77 +///////////////////////////////////////////////////////////////////////////////////////////////////
78 +- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result
79 +{
80 + WLInboxItemViewController *inboxItemViewController = (WLInboxItemViewController *)[([UIApplication sharedApplication].delegate).window.rootViewController topModalViewController];
81 + NSString *resultString;
82 + switch (result) {
83 + case MessageComposeResultCancelled:
84 + resultString = @"sms_cancelled";
85 + break;
86 + case MessageComposeResultFailed:
87 + resultString = @"sms_failed";
88 + break;
89 + case MessageComposeResultSent:
90 + resultString = @"sms_sent";
91 + }
92 + [WLAnalyticsManager logEventWithEventId:@"NB_ACTION" pageId:inboxItemViewController.session_uuid actionMetadata:[NSDictionary dictionaryWithObjectsAndKeys:resultString, @"sms_result", self.inboxVC.requestedUrl.absoluteString, @"action_url", nil]];
93 + [controller dismissViewControllerAnimated:YES completion:nil];
94 +}
95 +
96 +@end
1 +/*
2 + Copyright 2010-2016 Warply Inc. All rights reserved.
3 +
4 + Redistribution and use in source and binary forms, without modification,
5 + are permitted provided that the following conditions are met:
6 +
7 + 1. Redistributions of source code must retain the above copyright notice, this
8 + list of conditions and the following disclaimer.
9 +
10 + 2. Redistributions in binaryform must reproduce the above copyright notice,
11 + this list of conditions and the following disclaimer in the documentation
12 + and/or other materials provided with the distribution.
13 +
14 + THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
15 + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 + EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 + */
25 +
26 +#import <MessageUI/MessageUI.h>
27 +#import "Warply.h"
28 +
29 +@interface WLSMSActionHanlder : NSObject <MFMessageComposeViewControllerDelegate, WLActionHandler>
30 +
31 +@end
...\ No newline at end of file ...\ No newline at end of file
1 +/*
2 + Copyright 2010-2016 Warply Inc. All rights reserved.
3 +
4 + Redistribution and use in source and binary forms, without modification,
5 + are permitted provided that the following conditions are met:
6 +
7 + 1. Redistributions of source code must retain the above copyright notice, this
8 + list of conditions and the following disclaimer.
9 +
10 + 2. Redistributions in binaryform must reproduce the above copyright notice,
11 + this list of conditions and the following disclaimer in the documentation
12 + and/or other materials provided with the distribution.
13 +
14 + THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
15 + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
17 + EVENT SHALL WARPLY LTD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
18 + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 + BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
21 + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
22 + OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 + */
25 +
26 +#import "WLSMSActionHanlder.h"
27 +#import "WLGlobals.h"
28 +#import "WLAnalyticsManager.h"
29 +#import "WLInboxItemViewController.h"
30 +#import "WLBaseItem.h"
31 +#import "UIViewController+WLAdditions.h"
32 +
33 +@interface WLSMSActionHanlder ()
34 +
35 +@property (nonatomic, weak) WLInboxItemViewController *inboxVC;
36 +
37 +@end
38 +
39 +@implementation WLSMSActionHanlder
40 +
41 +#pragma mark - Static Methods
42 +///////////////////////////////////////////////////////////////////////////////////////////////////
43 +- (BOOL)canHandleActionUrl:(NSURL *)url
44 +{
45 + return [url.scheme isEqualToString: @"sms"];
46 +}
47 +
48 +#pragma mark - Override Methods
49 +///////////////////////////////////////////////////////////////////////////////////////////////////
50 +- (void)handleActionUrl:(NSURL *)url
51 +{
52 + UINavigationController *inboxNavCon = (UINavigationController *)[([UIApplication sharedApplication].delegate).window.rootViewController topModalViewController];
53 + self.inboxVC = [inboxNavCon.viewControllers objectAtIndex:0];
54 +
55 + if (![MFMessageComposeViewController canSendText]) {
56 + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"This device does not support text messages", @"Warply") message:nil delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"Warply") otherButtonTitles:nil];
57 + [alert show];
58 +
59 + return;
60 + }
61 +
62 + WLLOG(@"SMS URI: %@", url.absoluteString);
63 + if (url.resourceSpecifier == nil) {
64 + return;
65 + }
66 + NSString *escapedResourceSpecifier = [url.resourceSpecifier stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
67 + NSArray *args = [escapedResourceSpecifier componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"?&"]];
68 + NSString *recipientsString = [args objectAtIndex:0];
69 + NSArray *recipients = [recipientsString componentsSeparatedByString:@","];
70 + NSString *bodyString = nil;
71 +
72 + for (NSString *argument in args) {
73 + if ([argument isEqualToString:recipientsString]) {
74 + continue;
75 + }
76 + NSRange bodyKeyRange = [argument rangeOfString:@"body="];
77 + if (bodyKeyRange.location != NSNotFound) {
78 + bodyString = [argument substringFromIndex:bodyKeyRange.length];
79 + }
80 + }
81 +
82 + MFMessageComposeViewController *smsController = [[MFMessageComposeViewController alloc] init];
83 + [smsController setRecipients:recipients];
84 + [smsController setBody:bodyString];
85 +
86 + [smsController setMessageComposeDelegate:self];
87 + [_inboxVC presentViewController:smsController animated:YES completion:nil];
88 +
89 +}
90 +
91 +#pragma mark - MFMessageComposeViewControllerDelegate
92 +///////////////////////////////////////////////////////////////////////////////////////////////////
93 +- (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result
94 +{
95 + NSArray *results;
96 + switch (result) {
97 + case MessageComposeResultCancelled:
98 + results = @[@"sms_prompt_clicked", @"sms_cancelled"];
99 + break;
100 + case MessageComposeResultFailed:
101 + results = @[@"sms_prompt_clicked", @"sms_failed"];
102 + break;
103 + case MessageComposeResultSent:
104 + results = @[@"sms_prompt_clicked", @"sms_sent"];
105 + }
106 + [WLAnalyticsManager logUrgentEventWithEventId:@"NB_CUSTOM_ACTION" pageId:@"SMS" actionMetadata:@{@"session_uuid": self.inboxVC.session_uuid, @"result":results}];
107 + [controller dismissViewControllerAnimated:YES completion:nil];
108 +}
109 +
110 +@end
This diff is collapsed. Click to expand it.