Commit 3717beab authored by vae's avatar vae 🚴

init demo project

parent 682de250
Pipeline #107 canceled with stages

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output
# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode
iOSInjectionProject/
*.xcworkspacedata
*.lock
IDEWorkspaceChecks.plist
# outPut file
outPut/
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>aps-environment</key>
<string>development</string>
</dict>
</plist>
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "AppIcon-20h@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "AppIcon-20h@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "AppIcon-29h@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "AppIcon-29h@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "AppIcon-40h@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "AppIcon-40h@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "AppIcon-60h@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "AppIcon-60h@3x.png",
"scale" : "3x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "AppIcon-1024h.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "2436h",
"filename" : "LaunchImage-812h@3x.png",
"minimum-system-version" : "11.0",
"orientation" : "portrait",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "LaunchImage-736h@3x.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "667h",
"filename" : "LaunchImage-667h@2x.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"filename" : "LaunchImage-480h@2x.png",
"minimum-system-version" : "7.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "retina4",
"filename" : "LaunchImage-568h@2x.png",
"minimum-system-version" : "7.0",
"orientation" : "portrait",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "iphone",
"filename" : "Logo-Style2.png",
"scale" : "1x"
},
{
"idiom" : "iphone",
"filename" : "Logo-Style2@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"filename" : "Logo-Style2@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
#import <Foundation/Foundation.h>
#import "BusConfig.h"
#define FEATURE_OF_BusTrackLocalNotification 1
@interface Vars : BusConfig
@end
#import "Vars.h"
@implementation Vars
#pragma mark - <MainSiteConfig>
+ (NSString *)domain {
return @"http://www.aabus.com/";
}
+ (NSString *)site_name {
return @"AABus";
}
+ (NSString *)site_title {
return @"AABus.com";
}
+ (NSString *)support_email {
return @"aabus@gotobus.com";
}
+ (NSString *)phone {
return @"+1-617-354-2101";
}
+ (NSString *)appId {
return @"1357577299";
}
#pragma mark - <ClientSiteConfig>
+ (NSInteger)clientDomainId {
return 2136953;
}
+ (NSString *)clientServiceProvider {
return @"GotoBus";
}
#pragma mark - <AWSConfig>
+ (NSString *)AWSSNSSandboxPlatformApplicationArn {
return nil;
}
+ (NSString *)AWSSNSLivePlatformApplicationArn {
return @"arn:aws:sns:us-west-2:993645619544:app/APNS/AABus";
}
#pragma mark - <DebugConfig>
+ (BOOL)is_testing_server {
return NO;
}
+ (BOOL)is_develop {
return NO;
}
+ (BOOL)isJavaSearchLocalhost {
return NO;
}
+ (BOOL)isJavaAppLocalhost {
return NO;
}
+ (NSInteger)autoLoginUserId {
return 0;
}
+ (BOOL)isPaypalSandbox {
return YES;
}
+ (BOOL)isUnionpaySandbox {
return YES;
}
@end
AABus offers daily bus schedules on the State College, New York, Las Vegas, Los Angeles between the most popular cities in Nevada, California, Pennsylvania, New York, Florida and New Jersey. Find bus schedules from JFK Airport, State College, Kissimmee, Miami, Las Vegas, Los Angeles, Orlando, New York, Harrisburg and Bloomsburg. Whether you are travelling for business or for fun look no further than AABus! You'll find great amenities aboard our buses: enjoy Free Power Plug, Fully Air Conditioned, Mobile Tickets and Restroom Equipped on each row. When you travel, why not choose the best? Book your seats online with confidence today!
Say AABus to travel, with AABus!
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0.3</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
<string>236a8b989b212b0a7fb77078df45a765bc0c4e32</string>
<key>Kits</key>
<array>
<dict>
<key>KitInfo</key>
<dict/>
<key>KitName</key>
<string>Crashlytics</string>
</dict>
</array>
</dict>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>com.paypal.ppclient.touch.v1</string>
<string>com.paypal.ppclient.touch.v2</string>
<string>org-appextension-feature-password-management</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>amazonaws.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>amazonaws.com.cn</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSThirdPartyExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>appdev.taketours.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>haibara.taketours.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>hz249.gotobus.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>java.taketours.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>testwww.gotobus.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
<key>vae.taketours.com</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>
<key>NSCalendarsUsageDescription</key>
<string>$(PRODUCT_NAME)</string>
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME)</string>
<key>NSContactsUsageDescription</key>
<string>$(PRODUCT_NAME)</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>The app receive location-related data (like street/city/state/country associated with the placemark, postal address, latitude/longitude information) of your current location to improve user experience and self service (like filling some fields, selecting some options, tracking some changes) whenever is running and while is in the foreground.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>The app receive location-related data (like street/city/state/country associated with the placemark, postal address, latitude/longitude information) of your current location to improve user experience and self service (like filling some fields, selecting some options, tracking some changes) whenever is running.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>The app receive location-related data (like street/city/state/country associated with the placemark, postal address, latitude/longitude information) of your current location to improve user experience and self service (like filling some fields, selecting some options, tracking some changes) while is in the foreground.</string>
<key>NSMainNibFile</key>
<string>MainWindow</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME)</string>
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "iphone",
"filename" : "icon_passport.png",
"scale" : "1x"
},
{
"idiom" : "iphone",
"filename" : "icon_passport@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"filename" : "icon_passport@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "iphone",
"filename" : "icon_unionpay.png",
"scale" : "1x"
},
{
"idiom" : "iphone",
"filename" : "icon_unionpay@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"filename" : "icon_unionpay@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "iphone",
"filename" : "icon_unionpay_cloud_quickpass.png",
"scale" : "1x"
},
{
"idiom" : "iphone",
"filename" : "icon_unionpay_cloud_quickpass@2x.png",
"scale" : "2x"
},
{
"idiom" : "iphone",
"filename" : "icon_unionpay_cloud_quickpass@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "close@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "close@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "close@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "delete@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "delete@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "delete@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "explore.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "icon-facebook.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "icon-facebook@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "icon-facebook@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "icon-google.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "icon-google@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "icon-google@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "iphone",
"filename" : "icon_inbox1.pdf"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "location@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "location@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "location@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "support_error@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "support_error@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "support_error@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "tt_help_err@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "tt_help_err@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "tt_help_err@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UIApplication">
<connections>
<outlet property="delegate" destination="bYg-Ix-Cfg" id="h4M-LL-qlT"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<customObject id="bYg-Ix-Cfg" userLabel="App Delegate" customClass="AppDelegate">
<connections>
<outlet property="window" destination="Na2-4i-xf1" id="6fJ-YP-cF0"/>
</connections>
</customObject>
<window opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" visibleAtLaunch="YES" id="Na2-4i-xf1">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<point key="canvasLocation" x="140" y="155"/>
</window>
</objects>
</document>
//
// Config.h
// Project
//
// Created by haibara on 1/21/16.
//
//
#import <Foundation/Foundation.h>
#import "AppDelegate.h"
FOUNDATION_EXPORT NSString *const PUNCTUATION_EXCLAMATION_MARK;
FOUNDATION_EXPORT NSString *const PUNCTUATION_COMMA;
FOUNDATION_EXPORT NSString *const PUNCTUATION_QUESTION_MARK;
FOUNDATION_EXPORT NSString *const PUNCTUATION_PERIOD;
FOUNDATION_EXPORT NSString *const PUNCTUATION_COLON;
FOUNDATION_EXPORT NSString *const PUNCTUATION_ELLIPSIS;
FOUNDATION_EXPORT NSString *const PUNCTUATION_PARENTHESES_LEFT;
FOUNDATION_EXPORT NSString *const PUNCTUATION_PARENTHESES_RIGHT;
FOUNDATION_EXPORT NSString *const PUNCTUATION_BRACKETS_LEFT;
FOUNDATION_EXPORT NSString *const PUNCTUATION_BRACKETS_RIGHT;
FOUNDATION_EXPORT NSString *const WORD_DIVIDER_SPACE;
FOUNDATION_EXPORT CGFloat const kDefaultRoundedCornerRadius;
typedef NS_ENUM (NSInteger, StandardColor) {
StandardColorOrange = 0XFF6600,
StandardColorBlue = 0X0033CC,
};
FOUNDATION_EXPORT NSString *const UserDefaultsKeyEAIntroViewSkipped;
FOUNDATION_EXPORT NSString *const UserDefaultsKeyUserID;
FOUNDATION_EXPORT NSString *const UserDefaultsKeyUserName;
FOUNDATION_EXPORT NSString *const UserDefaultsKeyUserPassword;
FOUNDATION_EXPORT NSString *const UserDefaultsKeyUserRegisterNotification;
FOUNDATION_EXPORT NSString *const UserDefaultsKeyCalendarEventsEnabled;
FOUNDATION_EXPORT NSString *const UserDefaultsKeyCalendarEventIdentifiersForUpcomingItineraries;
FOUNDATION_EXPORT NSString *const UserDefaultsKeyUserNotificationsEnabled;
FOUNDATION_EXPORT NSString *const UserDefaultsKeyAmazonSNSEndpointArn;
FOUNDATION_EXPORT NSString *const UserDefaultsKeyHistoryBusSearchDepartureList;
FOUNDATION_EXPORT NSString *const UserDefaultsKeyHistoryHotelSearchDestinationList;
FOUNDATION_EXPORT NSString *const UserDefaultsKeyHistoryTourSearchDestinationList;
FOUNDATION_EXPORT NSString *const UserDefaultsKeyHistoryNotificationList;
FOUNDATION_EXPORT NSString *const UserDefaultsKeyNotificationErrorList;
FOUNDATION_EXPORT NSString *const LoginStatusDidChangeNotification;
FOUNDATION_EXPORT NSString *const SegueDidPerformNotification;
FOUNDATION_EXPORT NSString *const UpcomingItinerariesCountDidChangeNotification;
FOUNDATION_EXPORT NSString *const BookingFinishNotification;
FOUNDATION_EXPORT NSString *const UnreadMessageNotification;
FOUNDATION_EXPORT NSString *const WXPayRespNotification;
FOUNDATION_EXPORT NSString *const UPPaymentResultNotification;
FOUNDATION_EXPORT NSString *const AlipayOrderPaymentResultNotification;
@protocol AppearanceConfig <NSObject>
+ (UIColor *)defaultTintColor;
@end
@protocol MainSiteConfig <NSObject>
+ (NSString *)domain;
+ (NSString *)site_name;
+ (NSString *)site_title;
+ (NSString *)support_email;
+ (NSString *)phone;
+ (BOOL)is_bus_site;
+ (BOOL)is_tours_site;
+ (BOOL)is_cn_website;
+ (NSStringEncoding)charset;
+ (NSString *)tollFreePhone;
+ (NSString *)liveZillaUrl;
+ (NSDictionary *)rangedPhones;
@end
@protocol ClientSiteConfig <NSObject>
+ (NSInteger)clientDomainId;
+ (NSString *)clientServiceProvider;
@end
@protocol WebServiceConfig <NSObject>
+ (NSString *)liveServer;
+ (NSString *)testingServer;
+ (NSString *)javaSearchLiveEndpoint;
+ (NSString *)javaAppLiveEndpoint;
@end
@protocol AWSConfig <NSObject>
+ (NSInteger)AWSRegionType;
+ (NSString *)AWSStaticCredentialsAccessKey;
+ (NSString *)AWSStaticCredentialsSecretKey;
+ (NSString *)AWSSNSSandboxPlatformApplicationArn;
+ (NSString *)AWSSNSLivePlatformApplicationArn;
@end
@protocol PayPalConfig <NSObject>
+ (NSString *)paypalSandboxClientId;
+ (NSString *)paypalSandboxSecret;
+ (NSString *)paypalLiveClientId;
+ (NSString *)paypalLiveSecret;
@end
@protocol WeChatConfig <NSObject>
+ (NSString *)wechatAppId;
@end
@protocol ThirdPartyPaymentConfig <NSObject>
+ (NSString *)alipayUrlScheme;
+ (NSString *)unionpayUrlScheme;
@end
@protocol PiwikConfig <NSObject>
+ (NSString *)piwikSiteId;
+ (NSString *)piwikBaseUrl;
@end
@protocol DebugConfig <NSObject>
+ (BOOL)is_testing_server;
+ (BOOL)is_develop;
+ (BOOL)isJavaSearchLocalhost;
+ (BOOL)isJavaAppLocalhost;
+ (NSInteger)autoLoginUserId;
+ (BOOL)isPaypalSandbox;
+ (BOOL)isUnionpaySandbox;
@end
@interface AllConfig : NSObject <AppearanceConfig, MainSiteConfig, ClientSiteConfig, WebServiceConfig, AWSConfig, PayPalConfig, WeChatConfig, ThirdPartyPaymentConfig, PiwikConfig, DebugConfig>
+ (AppDelegate *)appDelegate;
+ (NSString *)responseException;
+ (BOOL)isLiveServer;
+ (BOOL)isAffiliate;
+ (NSString *)developServer;
+ (NSString *)javaSearchLocalhost;
+ (NSString *)javaAppLocalhost;
+ (NSString *)javaSearchEndpoint;
+ (NSString *)javaAppEndpoint;
+ (NSString *)paypalClientId;
+ (NSString *)paypalSecret;
+ (NSString *)AWSSNSPlatformApplicationArn;
+ (NSString *)appId;
@end
//
// Config.m
// Project
//
// Created by haibara on 1/21/16.
//
//
#import "AllConfig.h"
#import "SDK.h"
#import "CocoaUtils.h"
NSString *const PUNCTUATION_EXCLAMATION_MARK = @"!";
NSString *const PUNCTUATION_COMMA = @",";
NSString *const PUNCTUATION_QUESTION_MARK = @"?";
NSString *const PUNCTUATION_PERIOD = @".";
NSString *const PUNCTUATION_COLON = @":";
NSString *const PUNCTUATION_ELLIPSIS = @"...";
NSString *const PUNCTUATION_PARENTHESES_LEFT = @"(";
NSString *const PUNCTUATION_PARENTHESES_RIGHT = @")";
NSString *const PUNCTUATION_BRACKETS_LEFT = @"[";
NSString *const PUNCTUATION_BRACKETS_RIGHT = @"]";
NSString *const WORD_DIVIDER_SPACE = @" ";
CGFloat const kDefaultRoundedCornerRadius = 4;
NSString *const UserDefaultsKeyEAIntroViewSkipped = @"showIntroWithCustomView";
NSString *const UserDefaultsKeyUserID = @"userId";
NSString *const UserDefaultsKeyUserName = @"loginUsername";
NSString *const UserDefaultsKeyUserPassword = @"loginPassword";
NSString *const UserDefaultsKeyUserRegisterNotification = @"registerNotification";
NSString *const UserDefaultsKeyCalendarEventsEnabled = @"storeEvent";
NSString *const UserDefaultsKeyCalendarEventIdentifiersForUpcomingItineraries = @"ItineraryDepartureCalendarEventIdentifiers";
NSString *const UserDefaultsKeyDeviceToken = @"deviceToken";
NSString *const UserDefaultsKeyUserNotificationsEnabled = @"UserNotificationsEnabled";
NSString *const UserDefaultsKeyAmazonSNSEndpointArn = @"AmazonSNSEndpointArn";
NSString *const UserDefaultsKeyNotificationErrorList = @"NotificationErrorList";
NSString *const UserDefaultsKeyHistoryBusSearchDepartureList = @"HistoryBusSearchDepartureList";
NSString *const UserDefaultsKeyHistoryHotelSearchDestinationList = @"HistoryHotelSearchDestinationList";
NSString *const UserDefaultsKeyHistoryTourSearchDestinationList = @"HistoryTourSearchDestinationList";
NSString *const UserDefaultsKeyHistoryNotificationList = @"HistoryNotificationList";
NSString *const LoginStatusDidChangeNotification = @"LoginStatusDidChangeNotification";
NSString *const SegueDidPerformNotification = @"SegueDidPerformNotification";
NSString *const UpcomingItinerariesCountDidChangeNotification = @"UpcomingItinerariesCountDidChangeNotification";
NSString *const BookingFinishNotification = @"BookingFinishNotification";
NSString *const UnreadMessageNotification = @"unreadMessage";
NSString *const WXPayRespNotification = @"WXPayRespNotification";
NSString *const UPPaymentResultNotification = @"UPPaymentResultNotification";
NSString *const AlipayOrderPaymentResultNotification = @"AlipayOrderPaymentResultNotification";
#pragma clang diagnostic ignored "-Wprotocol"
@implementation AllConfig
#pragma mark - Public
+ (AppDelegate *)appDelegate {
return (AppDelegate *)[UIApplication sharedApplication].delegate;
}
+ (NSString *)responseException {
return IMLocalizedString(@"An error occurred, please try again later.");
}
+(NSString *)appId{
return nil;
}
+ (BOOL)isLiveServer {
#if DEBUG
return ![self is_develop] && ![self is_testing_server];
#else
return YES;
#endif
}
+ (NSString *)developServer {
#if TARGET_IPHONE_SIMULATOR
return [NSString stringWithFormat:@"http://%@.taketours.com", [[CocoaUtils userName] isEqualToString:@"haibara"] ? @"haibara" : @"vae"];
#else
return @"http://appdev.taketours.com:9999";
#endif
}
+ (NSString *)javaSearchLocalhost {
return @"http://192.168.20.64:8080/search";
}
+ (NSString *)javaAppLocalhost {
#if TARGET_IPHONE_SIMULATOR
return @"http://java.taketours.com:9988/app";
#else
return @"http://hz249.gotobus.com:9964/app";
#endif
}
+ (NSString *)javaSearchEndpoint {
#if DEBUG
return [self isJavaSearchLocalhost] ? [self javaSearchLocalhost] : [self javaSearchLiveEndpoint];
#else
return [self javaSearchLiveEndpoint];
#endif
}
+ (NSString *)javaAppEndpoint {
#if DEBUG
return [self isJavaAppLocalhost] ? [self javaAppLocalhost] : [self javaAppLiveEndpoint];
#else
return [self javaAppLiveEndpoint];
#endif
}
+ (NSString *)paypalClientId {
#if DEBUG
return [self isPaypalSandbox] ? [self paypalSandboxClientId] : [self paypalLiveClientId];
#else
return [self paypalLiveClientId];
#endif
}
+ (NSString *)paypalSecret {
#if DEBUG
return [self isPaypalSandbox] ? [self paypalSandboxSecret] : [self paypalLiveSecret];
#else
return [self paypalLiveSecret];
#endif
}
+ (NSString *)AWSSNSPlatformApplicationArn {
#if DEBUG
return [self AWSSNSSandboxPlatformApplicationArn];
#else
return [self AWSSNSLivePlatformApplicationArn];
#endif
}
+ (BOOL)isAffiliate{
return YES;
}
#pragma mark - <MainSiteConfig>
+ (BOOL)is_bus_site {
return NO;
}
+ (BOOL)is_tours_site {
return NO;
}
+ (NSDictionary *)rangedPhones {
return nil;
}
#pragma mark - <ClientSiteConfig>
+ (NSInteger)clientDomainId {
return 0;
}
+ (NSString *)clientServiceProvider {
return nil;
}
#pragma mark - <WebServiceConfig>
+ (NSString *)javaSearchLiveEndpoint {
return [[self liveServer] stringByAppendingString:@"/search"];
}
+ (NSString *)javaAppLiveEndpoint {
return [[self liveServer] stringByAppendingString:@"/app"];
}
#pragma mark - <AWSConfig>
+ (NSString *)AWSStaticCredentialsAccessKey {
return @"AKIAJZEPUM4RZYFJS4RA";
}
+ (NSString *)AWSStaticCredentialsSecretKey {
return @"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";
}
+ (NSString *)AWSSNSSandboxPlatformApplicationArn {
return nil;
}
+ (NSString *)AWSSNSLivePlatformApplicationArn {
return nil;
}
#pragma mark - <PiwikConfig>
+ (NSString *)piwikBaseUrl {
return @"https://owa.taketours.com/piwik/piwik.php";
}
+ (NSString *)piwikSiteId {
return nil;
}
#pragma mark - <WeChatConfig>
+ (NSString *)wechatAppId {
return nil;
}
#pragma mark - <ThirdPartyPaymentConfig>
+ (NSString *)alipayUrlScheme {
return nil;
}
+ (NSString *)unionpayUrlScheme {
return nil;
}
@end
//
// AppDelegate+UserNotifications.h
// Project
//
// Created by haibara on 5/25/18.
//
#import "AppDelegate.h"
@interface AppDelegate (UserNotifications)
@property (nonatomic, strong, readwrite) NSDictionary *remoteNotificationUserInfo;
@end
//
// AppDelegate+UserNotifications.m
// Project
//
// Created by haibara on 5/25/18.
//
#import "AppDelegate+UserNotifications.h"
#import <BlocksKit/NSObject+BKAssociatedObjects.h>
#import <EBBannerView/EBBannerView.h>
#import "Utility.h"
#import "AppNotification.h"
#import "AppLocalConfig.h"
@implementation AppDelegate (UserNotifications)
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
[Utility registerRemoteNotificationWithDeviceToken:deviceToken];
}
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
// foreground & background -- ios7~ios9
application.applicationIconBadgeNumber = 0;
if (application.applicationState == UIApplicationStateActive) {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(performNotificationForEBBannerViewDidClick) name:EBBannerViewDidClickNotification object:nil];
});
self.remoteNotificationUserInfo = userInfo;
[Utility presentRemoteNotificationInActiveWithPayload:userInfo];
} else {
[AppNotification handleNotification:userInfo];
}
[[NSNotificationCenter defaultCenter] postNotificationName:UnreadMessageNotification object:nil];
[AppLocalConfig sharedInstance].hasUnreadMessage = YES;
}
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {
application.applicationIconBadgeNumber = 0;
}
-(void)performNotificationForEBBannerViewDidClick {
[AppNotification handleNotification:self.remoteNotificationUserInfo];
}
- (NSDictionary *)remoteNotificationUserInfo {
return [self bk_associatedValueForKey:@selector(remoteNotificationUserInfo)];
}
- (void)setRemoteNotificationUserInfo:(NSDictionary *)remoteNotificationUserInfo {
[self bk_associateValue:remoteNotificationUserInfo withKey:@selector(remoteNotificationUserInfo)];
}
@end
//
// AppLocalConfig.h
// Project
//
// Created by Vae on 2019/1/11.
//
#import <Foundation/Foundation.h>
#import "AllConfig.h"
@interface AppLocalConfig : NSObject
@property(nonatomic, assign) BOOL userNotificationsRegister;
@property(nonatomic, assign) BOOL userNotificationEnable;
@property(nonatomic, strong) NSString *userDeviceToken;
@property(nonatomic, assign) BOOL hasUnreadMessage;
+ (instancetype)sharedInstance;
@end
//
// AppLocalConfig.m
// Project
//
// Created by Vae on 2019/1/11.
//
#import "AppLocalConfig.h"
#import "Vars.h"
static NSString * const kUserConfig = @"userconfig";
static NSString * const kNotificationEnable = @"notificationEnable";
static NSString * const kNotificationRegister = @"notificationRegister";
static NSString * const kDeviceToken = @"deviceToken";
static NSString * const kNotificationUnreadMessage = @"unreadMessage";
@implementation AppLocalConfig
+ (instancetype)sharedInstance {
static dispatch_once_t onceToken;
static AppLocalConfig *instance = nil;
dispatch_once(&onceToken,^{
instance = [[super allocWithZone:NULL] init];
});
return instance;
}
+ (id)allocWithZone:(struct _NSZone *)zone{
return [self sharedInstance];
}
-(void)setUserDeviceToken:(NSString *)userDeviceToken{
NSMutableDictionary *userConfig = [[self userConfig] mutableCopy];
if (!userConfig) {
userConfig = [NSMutableDictionary dictionary];
}
[userConfig setValue:userDeviceToken forKey:kDeviceToken];
[self updateUserConfig:userConfig];
}
-(NSString *)userDeviceToken{
NSDictionary *userConfig = [self userConfig];
return [userConfig valueForKey:kDeviceToken];
}
-(void)setUserNotificationsRegister:(BOOL)userNotificationsRegister{
NSMutableDictionary *userConfig = [[self userConfig] mutableCopy];
if (!userConfig) {
userConfig = [NSMutableDictionary dictionary];
}
[userConfig setValue:[NSNumber numberWithBool:userNotificationsRegister] forKey:kNotificationRegister];
[self updateUserConfig:userConfig];
}
- (BOOL)userNotificationsRegister{
NSDictionary *userConfig = [self userConfig];
return [[userConfig valueForKey:kNotificationRegister] boolValue];
}
-(void)setUserNotificationsEnable:(BOOL)userNotificationsEnable{
NSMutableDictionary *userConfig = [[self userConfig] mutableCopy];
if (!userConfig) {
userConfig = [NSMutableDictionary dictionary];
}
[userConfig setValue:[NSNumber numberWithBool:userNotificationsEnable] forKey:kNotificationEnable];
[self updateUserConfig:userConfig];
}
-(BOOL)userNotificationsEnable{
NSDictionary *userConfig = [self userConfig];
return [[userConfig valueForKey:kNotificationEnable] boolValue];
}
-(void)setHasUnreadMessage:(BOOL)hasUnreadMessage{
NSMutableDictionary *userConfig = [[self userConfig] mutableCopy];
if (!userConfig) {
userConfig = [NSMutableDictionary dictionary];
}
[userConfig setValue:[NSNumber numberWithBool:hasUnreadMessage] forKey:kNotificationUnreadMessage];
[self updateUserConfig:userConfig];
}
-(BOOL)hasUnreadMessage{
NSDictionary *userConfig = [self userConfig];
return [[userConfig valueForKey:kNotificationUnreadMessage] boolValue];
}
-(NSDictionary *)userConfig{
NSUserDefaults *userdefaults = [NSUserDefaults standardUserDefaults];
NSDictionary *userConfig = [userdefaults objectForKey:kUserConfig];
NSDictionary *localUserConfig = [userConfig valueForKey:[NSString stringWithFormat:@"%d",[Vars appDelegate].loginUser.id]];
return localUserConfig;
}
-(void)updateUserConfig:(NSMutableDictionary *)dic{
NSUserDefaults *userdefaults = [NSUserDefaults standardUserDefaults];
NSMutableDictionary *userconfig = [[userdefaults objectForKey:kUserConfig] mutableCopy];
if (!userconfig) {
userconfig = [NSMutableDictionary dictionary];
}
[userconfig setValue:dic forKey:[NSString stringWithFormat:@"%d",[Vars appDelegate].loginUser.id]];
[userdefaults setObject:userconfig forKey:kUserConfig];
}
@end
//
// AppNotification.h
// Project
//
// Created by haibara on 5/25/18.
//
#import <Foundation/Foundation.h>
@interface AppNotification : NSObject
+ (void)handleNotification:(NSDictionary *)userInfo;
@end
//
// AppNotification.m
// Project
//
// Created by haibara on 5/25/18.
//
#import "AppNotification.h"
#import <UserNotifications/UserNotifications.h>
#import "Lang.h"
#import "SDK.h"
#import "CocoaUtils.h"
#import "UserNotificationsManager.h"
#import "MessageListViewController.h"
#import "SalesEntryDetailViewController.h"
#import "Message.h"
#import "AppLocalConfig.h"
#import "Vars.h"
#import "InterceptionManager.h"
@implementation AppNotification
+(void)load{
if (NSClassFromString(@"UNUserNotificationCenter")) {
[UserNotificationsManager sharedManager].handler = ^(UNNotificationResponse *response) {
if ([response.notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]) {
NSDictionary *userInfo = response.notification.request.content.userInfo;
[self handleNotification:userInfo];
}
};
}
}
+ (void)handleNotification:(NSDictionary *)userInfo {
NSString *adUrlString = userInfo[@"data"][@"absolute_url"];
UIViewController *this = [CocoaUtils topMostViewController];
if ([StringUtils isEmpty:adUrlString]) {
MessageListViewController *messageListViewController = [[MessageListViewController alloc] init];
Message *message = [[Message alloc] init];
if ([userInfo[@"aps"][@"alert"] isKindOfClass:[NSDictionary class]]) {
message.title = userInfo[@"aps"][@"alert"][@"title"];
message.content = userInfo[@"aps"][@"alert"][@"body"];
}else if([userInfo[@"aps"][@"alert"] isKindOfClass:[NSString class]]){
message.title = userInfo[@"aps"][@"alert"];
}else{
if (userInfo) {
[AppLocalConfig sharedInstance].hasUnreadMessage = YES;
}
return;
}
[AppLocalConfig sharedInstance].hasUnreadMessage = NO;
message.notificationTime = [[DateFormatUtils ISO_DATETIME_FORMAT] format:[NSDate date]];
messageListViewController.message = message;
[this.navigationController pushViewController:messageListViewController animated:YES];
}else{
BOOL isHandle = [[InterceptionManager sharedManager] handleUrlString:adUrlString];
[AppLocalConfig sharedInstance].hasUnreadMessage = NO;
if (!isHandle) {
IMWebViewController *webviewController = [[IMWebViewController alloc] initWithURLString:adUrlString];
webviewController.hidesBottomBarWhenPushed = YES;
[this.navigationController pushViewController:webviewController animated:YES];
}
}
[[NSNotificationCenter defaultCenter] postNotificationName:UnreadMessageNotification object:nil];
}
@end
//
// AppTracker.h
// Project
//
// Created by haibara on 11/16/18.
//
#import <PiwikTracker/PiwikTracker.h>
#import "WebService.h"
NS_ASSUME_NONNULL_BEGIN
@interface AppTracker : PiwikTracker
- (void)sendCartUpdateTransactionWithResponse:(CheckAvailabilityAndPricesResponse *)response;
- (void)sendTrackOrderTransactionWithResponse:(CheckAvailabilityAndPricesResponse *)response orderCode:(NSString *)orderCode;
@end
NS_ASSUME_NONNULL_END
//
// AppTracker.m
// Project
//
// Created by haibara on 11/16/18.
//
#import "AppTracker.h"
#import <CoreData/CoreData.h>
#import "Lang.h"
#import "SDK.h"
#import <PiwikTracker/PiwikTransaction.h>
#import <PiwikTracker/PiwikTransactionBuilder.h>
#import <PiwikTracker/PiwikTransactionItem.h>
#import "WebService.h"
#import "Vars.h"
@interface PiwikTracker ()
@property (nonatomic, readonly, strong) NSManagedObjectModel *managedObjectModel;
- (instancetype)initWithSiteID:(NSString*)siteID dispatcher:(id<PiwikDispatcher>)dispatcher;
@end
@implementation AppTracker
@synthesize managedObjectModel = _managedObjectModel;
static PiwikTracker *_sharedInstance;
#pragma mark - Protected
+ (instancetype)sharedInstanceWithSiteID:(NSString*)siteID dispatcher:(id<PiwikDispatcher>)dispatcher {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_sharedInstance = [[[self class] alloc] initWithSiteID:siteID dispatcher:dispatcher];
});
_sharedInstance.isPrefixingEnabled = NO;
_sharedInstance.sessionTimeout = 0;
_sharedInstance.dispatchInterval = 0;
_sharedInstance.appName = [NSBundle mainBundle].bundleIdentifier;
return _sharedInstance;
}
+ (instancetype)sharedInstance {
if (_sharedInstance) {
return _sharedInstance;
}
return [super sharedInstance];
}
- (NSString *)siteID {
#if DEBUG
return @"31" ;
#else
return [Vars piwikSiteId];
#endif
}
- (NSManagedObjectModel*)managedObjectModel {
if (_managedObjectModel) {
return _managedObjectModel;
}
_managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:[[NSBundle bundleForClass:[PiwikTracker class]] URLForResource:@"piwiktracker" withExtension:@"momd"]];
return _managedObjectModel;
}
- (NSString*)platformName {
return [IMDeviceHardware platformString];
}
#pragma mark - Protected
- (void)sendCartUpdateTransactionWithResponse:(CheckAvailabilityAndPricesResponse *)response {
if (!response) {
return;
}
if ([Vars appDelegate].shopCarts.entries.count == 0) {
return;
}
PiwikTransactionBuilder *builder = [[PiwikTransactionBuilder alloc] init];
builder.grandTotal = @(response.default_currency_charge);
if ([Vars appDelegate].shopCarts.entries.count == response.entries.count) {
for (int i = 0; i < [Vars appDelegate].shopCarts.entries.count; i++) {
CartEntry *entry = [Vars appDelegate].shopCarts.entries[i];
_Entry *_entry = response.entries[i];
[builder addItemWithSku:[NSString stringWithFormat:@"%d", entry.product.product_id] name:entry.product.name category:entry.product.piwikCategory price:_entry.total_charge quantity:1];
}
} else {
CartEntry *cartEntry = [Vars appDelegate].shopCarts.entries[0];
[builder addItemWithSku:[NSString stringWithFormat:@"%d", cartEntry.product.product_id] name:cartEntry.product.name category:cartEntry.product.piwikCategory price:response.default_currency_charge quantity:1];
}
PiwikTransaction *transaction = [[PiwikTransaction alloc] initWithBuilder:builder];
[self sendTransaction:transaction];
}
- (void)sendTrackOrderTransactionWithResponse:(CheckAvailabilityAndPricesResponse *)response orderCode:(NSString *)orderCode {
if (!response || [StringUtils isEmpty:orderCode]) {
return;
}
if ([Vars appDelegate].shopCarts.entries.count == 0) {
return;
}
PiwikTransaction *transaction = [PiwikTransaction transactionWithBuilder:^(PiwikTransactionBuilder *builder) {
builder.identifier = orderCode;
builder.grandTotal = @(response.default_currency_charge);
if ([Vars appDelegate].shopCarts.entries.count == response.entries.count) {
for (int i = 0; i < [Vars appDelegate].shopCarts.entries.count; i++) {
CartEntry *entry = [Vars appDelegate].shopCarts.entries[i];
_Entry *_entry = response.entries[i];
[builder addItemWithSku:[NSString stringWithFormat:@"%d", entry.product.product_id] name:entry.product.name category:entry.product.piwikCategory price:_entry.total_charge quantity:1];
}
} else {
CartEntry *cartEntry = [Vars appDelegate].shopCarts.entries[0];
[builder addItemWithSku:[NSString stringWithFormat:@"%d", cartEntry.product.product_id] name:cartEntry.product.name category:cartEntry.product.piwikCategory price:response.default_currency_charge quantity:1];
}
}];
[self sendTransaction:transaction];
}
@end
//
// AppUnit.h
// Project
//
// Created by 杨殷杭 on 17/3/12.
//
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface AppUnit : NSObject
@end
//
// AppUnit.m
// Project
//
// Created by 杨殷杭 on 17/3/12.
//
//
#import "AppUnit.h"
#if DEBUG
#import "CocoaUtils.h"
#import "DrawUtils.h"
#import "RandomUtils.h"
#import <BlocksKit/BlocksKit+UIKit.h>
#import <LoremIpsum/LoremIpsum.h>
#import <OHHTTPStubs/OHHTTPStubs.h>
#import <PureLayout/PureLayout.h>
#import "Utility.h"
#import "AppUnitSubclass.h"
#import "Vars.h"
#endif
@implementation AppUnit
#if DEBUG
+ (UITabBarController *)wrappingTabBarControllerOnNavigationPushingViewController:(UIViewController *)viewController atTop:(BOOL)atTop {
UITabBarController *tabbarController = [UITabBarController new];
viewController.tabBarItem.image = [DrawUtils imageWithFAKIcon:[RandomUtils nextIcon:24] fillColor:[UIColor blackColor]];
viewController.tabBarItem.title = [LoremIpsum word];
tabbarController.viewControllers = @[[self wrappingNavigationControllerPushingViewController:viewController atTop:atTop]];
return tabbarController;
}
+ (UINavigationController *)wrappingNavigationControllerPushingViewController:(UIViewController *)viewController atTop:(BOOL)atTop {
UIViewController *vc = nil;
if (atTop) {
vc = viewController;
} else {
vc = [UIViewController new];
// vc add button bk_blcok
UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
[button setTitle:NSStringFromClass(viewController.class) forState:UIControlStateNormal];
[button bk_addEventHandler:^(id sender) {
[vc.navigationController pushViewController:viewController animated:YES];
} forControlEvents:UIControlEventTouchUpInside];
[vc.view addSubview:button];
[button autoCenterInSuperview];
}
return [CocoaUtils wrappingNavigationControllerAroundViewController:vc];
}
+ (void)stubRequest {
[OHHTTPStubs stubRequestsPassingTest:^BOOL (NSURLRequest *request) {
NSLog(@"%@", request);
return NO;
} withStubResponse:^OHHTTPStubsResponse * (NSURLRequest *request) {
return nil;
}];
}
#endif
@end
//
// AppUnitSubclass.h
// Project
//
// Created by haibara on 3/13/17.
//
//
@interface AppUnit (Protected)
+ (void)stubRequest;
+ (UITabBarController *)wrappingTabBarControllerOnNavigationPushingViewController:(UIViewController *)viewController atTop:(BOOL)atTop;
+ (UINavigationController *)wrappingNavigationControllerPushingViewController:(UIViewController *)viewController atTop:(BOOL)atTop;
@end
//
// CoreData.h
// Project
//
// Created by Vae on 2018/11/2.
//
#import <Foundation/Foundation.h>
@class GetPageContentResponse;
@interface CacheData : NSObject
-(id)getpageContentWithKey:(NSString *)key;
-(void)setpageContent:(GetPageContentResponse *)response key:(NSString *)key;
- (void)removeAllCache;
@end
//
// CoreData.m
// Project
//
// Created by Vae on 2018/11/2.
//
#import "CacheData.h"
#import "WebService.h"
#import <PINCache/PINCache.h>
@interface CacheData ()
@property(nonatomic, strong) NSString *routerUrlOrHtmlString;
@property(nonatomic, strong) PINDiskCache *htmlStringCache;
@end
@implementation CacheData
-(PINDiskCache *)htmlStringCache{
if (!_htmlStringCache) {
_htmlStringCache = [[PINDiskCache alloc] initWithName:NSStringFromSelector(@selector(htmlStringCache))];
_htmlStringCache.ageLimit = 24 * 3600;
_htmlStringCache.ttlCache = YES;
}
return _htmlStringCache;
}
-(id)getpageContentWithKey:(NSString *)key{
GetPageContentResponse *response = (GetPageContentResponse *) [self.htmlStringCache objectForKey:key];
return response;
}
-(void)setpageContent:(GetPageContentResponse *)response key:(NSString *)key{
if (response) {
[self.htmlStringCache setObject:(id)response forKey:key];
}else{
[self.htmlStringCache removeObjectForKey:key];
}
}
- (void)removeAllCache {
[self.htmlStringCache removeAllObjects];
}
@end
//
// CustomIcons.h
// Project
//
// Created by ziv on 2017/7/4.
//
//
#import <FontAwesomeKit/FontAwesomeKit.h>
@interface CustomIcons : FAKIcon
+ (instancetype)nextDayIconWithSize:(CGFloat)size;
+ (instancetype)nextDayTwoIconWithSize:(CGFloat)size;
+ (instancetype)abbrOrderIconWithSize:(CGFloat)size;
+ (instancetype)mapMarkerZoomInIconWithSize:(CGFloat)size;
+ (instancetype)refreshmentIconWithSize:(CGFloat)size;
+ (instancetype)reviewIconWithSize:(CGFloat)size;
+ (instancetype)abbrSalesIconWithSize:(CGFloat)size;
+ (instancetype)selfCheckInIconWithSize:(CGFloat)size;
+ (instancetype)seniorIconWithSize:(CGFloat)size;
+ (instancetype)skipLineIconWithSize:(CGFloat)size;
+ (instancetype)poolIconWithSize:(CGFloat)size;
+ (instancetype)takeoffArrowIconWithSize:(CGFloat)size;
+ (instancetype)toiletIconWithSize:(CGFloat)size;
+ (instancetype)taketourslogoIconWithSize:(CGFloat)size;
+ (instancetype)tvIconWithSize:(CGFloat)size;
+ (instancetype)quarterStarIconWithSize:(CGFloat)size;
+ (instancetype)threeQuarterStarIconWithSize:(CGFloat)size;
+ (instancetype)abbrAccountingIconWithSize:(CGFloat)size;
+ (instancetype)audioGuideIconWithSize:(CGFloat)size;
+ (instancetype)airConditionerIconWithSize:(CGFloat)size;
+ (instancetype)abbrBookingIconWithSize:(CGFloat)size;
+ (instancetype)recliningSeatIconWithSize:(CGFloat)size;
+ (instancetype)driverIconWithSize:(CGFloat)size;
+ (instancetype)dynamicPriceIconWithSize:(CGFloat)size;
+ (instancetype)extraLegroomSeatIconWithSize:(CGFloat)size;
+ (instancetype)flexiTicketIconWithSize:(CGFloat)size;
+ (instancetype)gotobuslogoIconWithSize:(CGFloat)size;
+ (instancetype)infantIconWithSize:(CGFloat)size;
+ (instancetype)insertBeforeIconWithSize:(CGFloat)size;
+ (instancetype)landingArrowIconWithSize:(CGFloat)size;
+ (instancetype)liveGuideIconWithSize:(CGFloat)size;
+ (instancetype)mapMarkerIconWithSize:(CGFloat)size;
+ (instancetype)mapIconWithSize:(CGFloat)size;
+ (instancetype)meetingRoomIconWithSize:(CGFloat)size;
+ (instancetype)mobileTicketIconWithSize:(CGFloat)size;
+ (instancetype)fitnessCenterIconWithSize:(CGFloat)size;
@end
//
// CustomIcons.m
// Project
//
// Created by ziv on 2017/7/4.
//
//
#import "CustomIcons.h"
@implementation CustomIcons
+ (UIFont *)iconFontWithSize:(CGFloat)size {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self registerIconFontWithURL:[[NSBundle bundleForClass:[CustomIcons class]] URLForResource:@"CustomIcons" withExtension:@"ttf"]];
});
UIFont *font = [UIFont fontWithName:@"fontello" size:size];
NSAssert(font, @"UIFont object should not be nil, check if the font file is added to the application bundle and you're using the correct font name.");
return font;
}
+ (instancetype)nextDayIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue800" size:size];
}
+ (instancetype)nextDayTwoIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue801" size:size];
}
+ (instancetype)abbrOrderIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue802" size:size];
}
+ (instancetype)mapMarkerZoomInIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue803" size:size];
}
+ (instancetype)refreshmentIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue804" size:size];
}
+ (instancetype)reviewIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue805" size:size];
}
+ (instancetype)abbrSalesIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue806" size:size];
}
+ (instancetype)selfCheckInIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue807" size:size];
}
+ (instancetype)seniorIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue808" size:size];
}
+ (instancetype)skipLineIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue809" size:size];
}
+ (instancetype)poolIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue80a" size:size];
}
+ (instancetype)takeoffArrowIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue80b" size:size];
}
+ (instancetype)toiletIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue80c" size:size];
}
+ (instancetype)taketourslogoIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue80d" size:size];
}
+ (instancetype)tvIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue80e" size:size];
}
+ (instancetype)quarterStarIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue810" size:size];
}
+ (instancetype)threeQuarterStarIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue811" size:size];
}
+ (instancetype)abbrAccountingIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue812" size:size];
}
+ (instancetype)audioGuideIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue813" size:size];
}
+ (instancetype)airConditionerIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue814" size:size];
}
+ (instancetype)abbrBookingIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue815" size:size];
}
+ (instancetype)recliningSeatIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue816" size:size];
}
+ (instancetype)driverIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue817" size:size];
}
+ (instancetype)dynamicPriceIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue818" size:size];
}
+ (instancetype)extraLegroomSeatIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue819" size:size];
}
+ (instancetype)flexiTicketIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue81a" size:size];
}
+ (instancetype)gotobuslogoIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue81b" size:size];
}
+ (instancetype)infantIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue81c" size:size];
}
+ (instancetype)insertBeforeIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue81d" size:size];
}
+ (instancetype)landingArrowIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue81e" size:size];
}
+ (instancetype)liveGuideIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue81f" size:size];
}
+ (instancetype)mapMarkerIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue820" size:size];
}
+ (instancetype)mapIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue821" size:size];
}
+ (instancetype)meetingRoomIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue822" size:size];
}
+ (instancetype)mobileTicketIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue823" size:size];
}
+ (instancetype)fitnessCenterIconWithSize:(CGFloat)size {
return [self iconWithCode:@"\ue825" size:size];
}
@end
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef NS_ENUM (NSInteger, AddressType) {
AddressTypeShipping = 0,
AddressTypeBilling,
AddressTypeContactInfo,
};
@interface Address : NSObject <NSCopying>
@property (nonatomic, assign) NSInteger aid;
@property (nonatomic, assign) CGFloat latitude;
@property (nonatomic, assign) CGFloat longitude;
@property (nonatomic, strong) NSString *street;
@property (nonatomic, strong) NSString *street2;
@property (nonatomic, strong) NSString *city;
@property (nonatomic, strong) NSString *state;
@property (nonatomic, strong) NSString *other_state;
@property (nonatomic, strong) NSString *zipcode;
@property (nonatomic, strong) NSString *country;
@property (nonatomic, strong) NSString *first_name;
@property (nonatomic, strong) NSString *last_name;
@property (nonatomic, strong) NSString *phone;
@property (nonatomic, strong) NSString *phone2;
@property (nonatomic, strong) NSString *email;
@property (nonatomic, assign) BOOL isDefault;
@property (nonatomic, assign) BOOL transient;
@property (nonatomic, strong, readonly) NSString *fullName;
@property (nonatomic, strong, readonly) NSAttributedString *attributedEmailIfDefaultAppending;
- (instancetype)initWithType:(AddressType)type;
- (NSString *)innerXML;
+ (NSArray *)availableCountryCodes;
+ (NSArray *)availableCountryNames;
+ (NSArray *)knownStates;
+ (NSString *)preferredCountryCode;
+ (Address *)primaryOfAddresses:(NSArray *)addresses;
+ (Address *)defaultOfAddresses:(NSArray *)addresses;
+ (Address *)randomAddressWithType:(AddressType)type;
@end
This diff is collapsed.
//
// Airport.h
// Project
//
// Created by haibara on 11/19/15.
//
//
#import <Foundation/Foundation.h>
#import "Address.h"
@interface Airport : Address
@property (nonatomic, strong) NSString *name;
@end
//
// Airport.m
// Project
//
// Created by haibara on 11/19/15.
//
//
#import "Airport.h"
@implementation Airport
@end
//
// AirportStop.h
// Project
//
// Created by haibara on 11/19/15.
//
//
#import <Foundation/Foundation.h>
#import "Airport.h"
@interface AirportStop : NSObject
@property (nonatomic, assign) NSInteger airport_id;
@property (nonatomic, assign) BOOL is_return;
@property (nonatomic, strong) Airport *airport;
@end
//
// AirportStop.m
// Project
//
// Created by haibara on 11/19/15.
//
//
#import "AirportStop.h"
@implementation AirportStop
@end
//
// Aliase.h
// TakeTours
//
// Created by 包光清 on 2019/2/18.
//
#import <Foundation/Foundation.h>
@interface Aliase : NSObject
@property (nonatomic, strong) NSString *aliase_id;
@property (nonatomic, strong) NSString *label;
@end
//
// Aliase.m
// TakeTours
//
// Created by 包光清 on 2019/2/18.
//
#import "Aliase.h"
@implementation Aliase
@end
//
// Area.h
// Project
//
// Created by 包光清 on 2019/1/26.
//
#import <Foundation/Foundation.h>
#import "Aliase.h"
@interface Area : NSObject
@property (nonatomic, assign) NSInteger tier;
@property (nonatomic, strong) NSString *area_id;
@property (nonatomic, assign) NSInteger type;
@property (nonatomic, strong) NSString *label;
@property (nonatomic, strong) NSArray *aliases;
@property (nonatomic, strong) NSString *parent_id;
@end
//
// Area.m
// Project
//
// Created by 包光清 on 2019/1/26.
//
#import "Area.h"
@implementation Area
@end
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment