-
Notifications
You must be signed in to change notification settings - Fork 519
Expand file tree
/
Copy pathAppDelegate.m
More file actions
155 lines (126 loc) · 4.85 KB
/
Copy pathAppDelegate.m
File metadata and controls
155 lines (126 loc) · 4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
//
// __
// /\ \ _
// ____ ____ ___\ \ \_/ \ _____ ___ ___
// / _ \ / __ \ / __ \ \ < __ /\__ \ / __ \ / __ \
// /\ \_\ \/\ __//\ __/\ \ \\ \ /\_\ \/_/ / /\ \_\ \/\ \_\ \
// \ \____ \ \____\ \____\\ \_\\_\ \/_/ /\____\\ \____/\ \____/
// \/____\ \/____/\/____/ \/_//_/ \/____/ \/___/ \/___/
// /\____/
// \/___/
//
// Powered by BeeFramework
//
#import "AppDelegate.h"
#import "AppBoard_iPad.h"
#import "AppBoard_iPhone.h"
#import "controller.h"
#import "model.h"
#import "ecmobile.h"
#import "MobClick.h"
#import "bee.services.alipay.h"
#import "bee.services.location.h"
#import "bee.services.share.weixin.h"
#import "bee.services.share.sinaweibo.h"
#import "bee.services.share.tencentweibo.h"
#import "bee.services.wizard.h"
#import "bee.services.siri.h"
#import "bee.services.uppayplugin.h"
@implementation AppDelegate
#pragma mark -
- (void)load
{
[[UIApplication sharedApplication] setStatusBarHidden:NO];
bee.ui.config.ASR = YES; // Signal自动路由
bee.ui.config.iOS6Mode = YES; // iOS6.0界面布局
[[BeeUITemplateManager sharedInstance] preloadResources];
[[BeeUITemplateManager sharedInstance] preloadPackages];
[ArticleGroupModel sharedInstance];
[BannerModel sharedInstance];
[CartModel sharedInstance];
[CategoryModel sharedInstance];
[ConfigModel sharedInstance];
[UserModel sharedInstance];
// 配置ECSHOP
[ServerConfig sharedInstance].url = @"http://shop.ecmobile.cn/ecmobile/?url=";
// 配置闪屏
bee.services.wizard.config.showBackground = YES;
bee.services.wizard.config.showPageControl = YES;
bee.services.wizard.config.backgroundImage = [UIImage imageNamed:@"tuitional_bg.jpg"];
bee.services.wizard.config.pageDotSize = CGSizeMake( 11.0f, 11.0f );
bee.services.wizard.config.pageDotNormal = [UIImage imageNamed:@"tuitional-carousel-active-btn.png"];
bee.services.wizard.config.pageDotHighlighted = [UIImage imageNamed:@"tuitional-carousel-btn.png"];
bee.services.wizard.config.pageDotLast = [UIImage imageNamed:@"tuitional-carousel-btn-last.png"];
bee.services.wizard.config.splashes[0] = @"wizard_1.xml";
bee.services.wizard.config.splashes[1] = @"wizard_2.xml";
bee.services.wizard.config.splashes[2] = @"wizard_3.xml";
bee.services.wizard.config.splashes[3] = @"wizard_4.xml";
bee.services.wizard.config.splashes[4] = @"wizard_5.xml";
// 配置提示框
{
[BeeUITipsCenter setDefaultContainerView:self.window];
[BeeUITipsCenter setDefaultBubble:[UIImage imageNamed:@"alertBox.png"]];
[BeeUITipsCenter setDefaultMessageIcon:[UIImage imageNamed:@"icon.png"]];
[BeeUITipsCenter setDefaultSuccessIcon:[UIImage imageNamed:@"icon.png"]];
[BeeUITipsCenter setDefaultFailureIcon:[UIImage imageNamed:@"icon.png"]];
}
// 配置导航条
{
[BeeUINavigationBar setTitleColor:[UIColor whiteColor]];
[BeeUINavigationBar setBackgroundColor:[UIColor blackColor]];
if ( IOS7_OR_LATER )
{
[BeeUINavigationBar setBackgroundImage:[UIImage imageNamed:@"nav_bg_iphone5.png"]];
}
else
{
[BeeUINavigationBar setBackgroundImage:[UIImage imageNamed:@"nav_bg.png"]];
}
}
[self updateConfig];
self.window.rootViewController = [AppBoard_iPhone sharedInstance];
[MobClick appLaunched];
}
- (void)unload
{
[self unobserveAllNotifications];
[MobClick appTerminated];
}
#pragma mark -
- (void)updateConfig
{
ALIAS( bee.services.share.weixin, weixin );
ALIAS( bee.services.share.tencentweibo, tweibo );
ALIAS( bee.services.share.sinaweibo, sweibo );
ALIAS( bee.services.alipay, alipay );
ALIAS( bee.services.siri, siri );
ALIAS( bee.services.location, lbs );
// 配置微信
weixin.config.appId = @"Your weixinID";
weixin.config.appKey = @"Your weixinKey";
// 配置新浪
sweibo.config.appKey = @"Your sinaWeiboKey";
sweibo.config.appSecret = @"Your sinaWeiboSecret";
sweibo.config.redirectURI = @"Your sinaWeiboCallback";
// 配置腾讯
tweibo.config.appKey = @"Your tencentWeiboKey";
tweibo.config.appSecret = @"Your tencentWeiboSecret";
tweibo.config.redirectURI = @"Your tencentWeiboCallback";
// 配置支付宝
alipay.config.parnter = @"Your alipayPartnerID";
alipay.config.seller = @"Your alipaySeller";
alipay.config.privateKey = @"Your alipayPrivateKey";
alipay.config.publicKey = @"Your alipayPublicKey";
alipay.config.notifyURL = @"Your alipayCallback";
alipay.config.wapCallBackURL = @"http://shop.ecmobile.cn/ecmobile/payment/app_callback.php?err=";
// 配置语音识别
siri.config.showUI = NO;
siri.config.appID = @"Your iflyKey";
// 配置友盟
[MobClick setAppVersion:[BeeSystemInfo appShortVersion]];
[MobClick setCrashReportEnabled:YES];
[MobClick setLatitude:lbs.location.coordinate.latitude longitude:lbs.location.coordinate.longitude];
[MobClick setLocation:lbs.location];
[MobClick startWithAppkey:@"Your umengKey" reportPolicy:BATCH channelId:nil];
}
@end