質問編集履歴

3

コード編集

2015/05/01 02:14

投稿

hirahira10
hirahira10

スコア50

test CHANGED
File without changes
test CHANGED
@@ -140,7 +140,7 @@
140
140
 
141
141
  // Initialize tracker. Replace with your tracking ID.
142
142
 
143
- [[GAI sharedInstance] trackerWithTrackingId:@"UA-57375643-3"];
143
+ [[GAI sharedInstance] trackerWithTrackingId:@"トラッキングコード"];
144
144
 
145
145
 
146
146
 

2

AppDelegate.mの追加

2015/05/01 02:14

投稿

hirahira10
hirahira10

スコア50

test CHANGED
File without changes
test CHANGED
@@ -48,6 +48,228 @@
48
48
 
49
49
 
50
50
 
51
+ AppDelegate.m
52
+
53
+
54
+
55
+ #import "AppDelegate.h"
56
+
57
+ #import "GAI.h"
58
+
59
+
60
+
61
+ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
62
+
63
+ // Override point for customization after application launch.
64
+
65
+
66
+
67
+ //insert value for variables
68
+
69
+ tabIndexCurrent = 1 ; //the first tab of tabbar
70
+
71
+ tabIndexBefore = -1 ;
72
+
73
+ contest_type = 0; // none contest
74
+
75
+ contest_id = @""; // none contest
76
+
77
+ catID_flag = false; //tap on button catagories in tab My Page (true: tapped - false: not be tapped)
78
+
79
+ catID = @"";
80
+
81
+ catName = @"";
82
+
83
+ strDeviceToken = @""; //none device token
84
+
85
+ JxI = @"";
86
+
87
+ JxUIX = @"";
88
+
89
+ path = @""; //path for copy file configInfo.plist to Document folder
90
+
91
+ isUpdate = @"NO"; //NO = has not been updated yet
92
+
93
+ numberOfNotifications = @"0";
94
+
95
+ isFirstRunContestTab = @"";
96
+
97
+ _isFirstRunApp = @"";
98
+
99
+ strURLTemp = tabContest;
100
+
101
+ isPostingContest = false;
102
+
103
+ isLeavedTab = false;
104
+
105
+ imageName = @"icon_dissableCrow.png";
106
+
107
+ isExistiOSTwitterAccount = false; //True: user already logined on system iOS twitter;
108
+
109
+ screenNameTwitter = @"";
110
+
111
+ twitter_enable = @"";
112
+
113
+ twitter_text = @"";
114
+
115
+ pushNotification_alert = @"";
116
+
117
+
118
+
119
+ //Connect to GrowthPush Notification
120
+
121
+ [EasyGrowthPush setApplicationId:2922 secret:@"QJrUUHQGHtDx9LpKcHiouPtEY4dRVIHg" environment:kGrowthPushEnvironment debug:YES];
122
+
123
+ // Optional: automatically send uncaught exceptions to Google Analytics.
124
+
125
+ [GAI sharedInstance].trackUncaughtExceptions = YES;
126
+
127
+
128
+
129
+ // Optional: set Google Analytics dispatch interval to e.g. 20 seconds.
130
+
131
+ [GAI sharedInstance].dispatchInterval = 20;
132
+
133
+
134
+
135
+ // Optional: set Logger to VERBOSE for debug information.
136
+
137
+ [[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelVerbose];
138
+
139
+
140
+
141
+ // Initialize tracker. Replace with your tracking ID.
142
+
143
+ [[GAI sharedInstance] trackerWithTrackingId:@"UA-57375643-3"];
144
+
145
+
146
+
147
+ id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
148
+
149
+
150
+
151
+
152
+
153
+ // Check to see if this is an iOS 8 device.
154
+
155
+ if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
156
+
157
+ {
158
+
159
+ // Register for push in iOS 8.
160
+
161
+ [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
162
+
163
+ [[UIApplication sharedApplication] registerForRemoteNotifications];
164
+
165
+ }
166
+
167
+ else
168
+
169
+ {
170
+
171
+ // Register for push in iOS 7 and under.
172
+
173
+ [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
174
+
175
+ }
176
+
177
+
178
+
179
+ //Check version for HTML Source
180
+
181
+ [self copyPlist];
182
+
183
+
184
+
185
+ configInfoDict = [NSMutableDictionary dictionaryWithContentsOfFile:path];
186
+
187
+
188
+
189
+ NSLog(@"configInfoDict: %@", configInfoDict);
190
+
191
+
192
+
193
+ JxI = [configInfoDict objectForKey:@"JxI"];
194
+
195
+ JxUIX = [configInfoDict objectForKey:@"JxUIX"];
196
+
197
+ isUpdate = [configInfoDict objectForKey:@"isUpdate"];
198
+
199
+ _currentVersionHTMLFromFile = [configInfoDict objectForKey:@"Version"];
200
+
201
+ isFirstRunContestTab = [configInfoDict objectForKey:@"isFirstRunContestTab"];
202
+
203
+ _isFirstRunApp = [configInfoDict objectForKey:@"isFirstRunApp"];
204
+
205
+
206
+
207
+ //Create a fake UDID for device
208
+
209
+ NSString *domain = @"www.aaatest.com";
210
+
211
+ NSString *key = @"auaatest";
212
+
213
+ secrect_udid = [SecureUDID UDIDForDomain:domain usingKey:key];
214
+
215
+
216
+
217
+ //Get number of notifications
218
+
219
+ [self.implementAPIBussiness getNumberOfNotificationsWithJxI:JxI];
220
+
221
+
222
+
223
+ //update SecureUDID for server numbers of download aaa app
224
+
225
+ if ([_isFirstRunApp isEqualToString:@"NO"])
226
+
227
+ {
228
+
229
+ [self newDownload:secrect_udid];
230
+
231
+
232
+
233
+ [configInfoDict setValue:@"YES" forKey:@"isFirstRunApp"];
234
+
235
+
236
+
237
+ _isFirstRunApp = @"YES";
238
+
239
+
240
+
241
+ if ([configInfoDict writeToFile:path atomically:YES])
242
+
243
+ {
244
+
245
+ NSLog(@"Edit file plist successfull");
246
+
247
+ }
248
+
249
+ }
250
+
251
+
252
+
253
+ //Get version HTML from server
254
+
255
+ [self.implementAPIBussiness checkVersionHTML];
256
+
257
+
258
+
259
+ [self performSelector:@selector(loadScreen) withObject:nil afterDelay:1.0];
260
+
261
+
262
+
263
+ return YES;
264
+
265
+ }
266
+
267
+
268
+
269
+
270
+
271
+
272
+
51
273
  TimelineViewController.h
52
274
 
53
275
  #import "GAITrackedViewController.h"

1

詳細なコード追加

2015/05/01 01:50

投稿

hirahira10
hirahira10

スコア50

test CHANGED
File without changes
test CHANGED
@@ -33,3 +33,119 @@
33
33
  ページごとに名前を設定するself.screenName部分がクラスになるのでしょうか?
34
34
 
35
35
  もしこれだとしてもまだテストで1ファイルにしかこのコードをいれていないので重複はしていないので困っています
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+ 自分で関係があるのではないかと思う部分の詳細なコードを記載させていただきます。
46
+
47
+
48
+
49
+
50
+
51
+ TimelineViewController.h
52
+
53
+ #import "GAITrackedViewController.h"
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+ @interface TimelineViewController : GAITrackedViewController <UIWebViewDelegate, UISearchBarDelegate, UIAlertViewDelegate, UIScrollViewDelegate, EGORefreshTableHeaderDelegate>
64
+
65
+
66
+
67
+ {
68
+
69
+ AppDelegate *mainDelegate;
70
+
71
+
72
+
73
+ EGORefreshTableHeaderView *_refreshHeaderView;
74
+
75
+
76
+
77
+ UIScrollView *webScroller;
78
+
79
+
80
+
81
+ BOOL _reloading;
82
+
83
+ }
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+ TimelineViewController.m
92
+
93
+
94
+
95
+ #import "GAITrackedViewController.h"
96
+
97
+ @interface TimelineViewController (){
98
+
99
+ CGRect originalFrame;
100
+
101
+ }
102
+
103
+
104
+
105
+ @end
106
+
107
+
108
+
109
+
110
+
111
+ @implementation TimelineViewController
112
+
113
+ -(void)viewWillAppear:(BOOL)animated
114
+
115
+ {
116
+
117
+ _webView.delegate = self;
118
+
119
+
120
+
121
+ [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
122
+
123
+ [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
124
+
125
+ [[NSNotificationCenter defaultCenter] addObserver:self
126
+
127
+ selector:@selector(receiveNotification:)
128
+
129
+ name:@"numberNotification"
130
+
131
+ object:nil];
132
+
133
+
134
+
135
+ [[NSNotificationCenter defaultCenter] addObserver:self
136
+
137
+ selector:@selector(receiveNotification:)
138
+
139
+ name:@"tapTabTimelineAgain"
140
+
141
+ object:nil];
142
+
143
+ [super viewWillAppear:animated];
144
+
145
+ self.screenName = [NSString stringWithFormat:@"%@", NSStringFromClass([self class])];
146
+
147
+ self.screenName = @"timeline";
148
+
149
+
150
+
151
+ }