質問編集履歴
3
コード編集
title
CHANGED
File without changes
|
body
CHANGED
@@ -69,7 +69,7 @@
|
|
69
69
|
[[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelVerbose];
|
70
70
|
|
71
71
|
// Initialize tracker. Replace with your tracking ID.
|
72
|
-
[[GAI sharedInstance] trackerWithTrackingId:@"
|
72
|
+
[[GAI sharedInstance] trackerWithTrackingId:@"トラッキングコード"];
|
73
73
|
|
74
74
|
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
|
75
75
|
|
2
AppDelegate.mの追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -23,6 +23,117 @@
|
|
23
23
|
自分で関係があるのではないかと思う部分の詳細なコードを記載させていただきます。
|
24
24
|
|
25
25
|
|
26
|
+
AppDelegate.m
|
27
|
+
|
28
|
+
#import "AppDelegate.h"
|
29
|
+
#import "GAI.h"
|
30
|
+
|
31
|
+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
32
|
+
// Override point for customization after application launch.
|
33
|
+
|
34
|
+
//insert value for variables
|
35
|
+
tabIndexCurrent = 1 ; //the first tab of tabbar
|
36
|
+
tabIndexBefore = -1 ;
|
37
|
+
contest_type = 0; // none contest
|
38
|
+
contest_id = @""; // none contest
|
39
|
+
catID_flag = false; //tap on button catagories in tab My Page (true: tapped - false: not be tapped)
|
40
|
+
catID = @"";
|
41
|
+
catName = @"";
|
42
|
+
strDeviceToken = @""; //none device token
|
43
|
+
JxI = @"";
|
44
|
+
JxUIX = @"";
|
45
|
+
path = @""; //path for copy file configInfo.plist to Document folder
|
46
|
+
isUpdate = @"NO"; //NO = has not been updated yet
|
47
|
+
numberOfNotifications = @"0";
|
48
|
+
isFirstRunContestTab = @"";
|
49
|
+
_isFirstRunApp = @"";
|
50
|
+
strURLTemp = tabContest;
|
51
|
+
isPostingContest = false;
|
52
|
+
isLeavedTab = false;
|
53
|
+
imageName = @"icon_dissableCrow.png";
|
54
|
+
isExistiOSTwitterAccount = false; //True: user already logined on system iOS twitter;
|
55
|
+
screenNameTwitter = @"";
|
56
|
+
twitter_enable = @"";
|
57
|
+
twitter_text = @"";
|
58
|
+
pushNotification_alert = @"";
|
59
|
+
|
60
|
+
//Connect to GrowthPush Notification
|
61
|
+
[EasyGrowthPush setApplicationId:2922 secret:@"QJrUUHQGHtDx9LpKcHiouPtEY4dRVIHg" environment:kGrowthPushEnvironment debug:YES];
|
62
|
+
// Optional: automatically send uncaught exceptions to Google Analytics.
|
63
|
+
[GAI sharedInstance].trackUncaughtExceptions = YES;
|
64
|
+
|
65
|
+
// Optional: set Google Analytics dispatch interval to e.g. 20 seconds.
|
66
|
+
[GAI sharedInstance].dispatchInterval = 20;
|
67
|
+
|
68
|
+
// Optional: set Logger to VERBOSE for debug information.
|
69
|
+
[[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelVerbose];
|
70
|
+
|
71
|
+
// Initialize tracker. Replace with your tracking ID.
|
72
|
+
[[GAI sharedInstance] trackerWithTrackingId:@"UA-57375643-3"];
|
73
|
+
|
74
|
+
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
|
75
|
+
|
76
|
+
|
77
|
+
// Check to see if this is an iOS 8 device.
|
78
|
+
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
|
79
|
+
{
|
80
|
+
// Register for push in iOS 8.
|
81
|
+
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
|
82
|
+
[[UIApplication sharedApplication] registerForRemoteNotifications];
|
83
|
+
}
|
84
|
+
else
|
85
|
+
{
|
86
|
+
// Register for push in iOS 7 and under.
|
87
|
+
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
|
88
|
+
}
|
89
|
+
|
90
|
+
//Check version for HTML Source
|
91
|
+
[self copyPlist];
|
92
|
+
|
93
|
+
configInfoDict = [NSMutableDictionary dictionaryWithContentsOfFile:path];
|
94
|
+
|
95
|
+
NSLog(@"configInfoDict: %@", configInfoDict);
|
96
|
+
|
97
|
+
JxI = [configInfoDict objectForKey:@"JxI"];
|
98
|
+
JxUIX = [configInfoDict objectForKey:@"JxUIX"];
|
99
|
+
isUpdate = [configInfoDict objectForKey:@"isUpdate"];
|
100
|
+
_currentVersionHTMLFromFile = [configInfoDict objectForKey:@"Version"];
|
101
|
+
isFirstRunContestTab = [configInfoDict objectForKey:@"isFirstRunContestTab"];
|
102
|
+
_isFirstRunApp = [configInfoDict objectForKey:@"isFirstRunApp"];
|
103
|
+
|
104
|
+
//Create a fake UDID for device
|
105
|
+
NSString *domain = @"www.aaatest.com";
|
106
|
+
NSString *key = @"auaatest";
|
107
|
+
secrect_udid = [SecureUDID UDIDForDomain:domain usingKey:key];
|
108
|
+
|
109
|
+
//Get number of notifications
|
110
|
+
[self.implementAPIBussiness getNumberOfNotificationsWithJxI:JxI];
|
111
|
+
|
112
|
+
//update SecureUDID for server numbers of download aaa app
|
113
|
+
if ([_isFirstRunApp isEqualToString:@"NO"])
|
114
|
+
{
|
115
|
+
[self newDownload:secrect_udid];
|
116
|
+
|
117
|
+
[configInfoDict setValue:@"YES" forKey:@"isFirstRunApp"];
|
118
|
+
|
119
|
+
_isFirstRunApp = @"YES";
|
120
|
+
|
121
|
+
if ([configInfoDict writeToFile:path atomically:YES])
|
122
|
+
{
|
123
|
+
NSLog(@"Edit file plist successfull");
|
124
|
+
}
|
125
|
+
}
|
126
|
+
|
127
|
+
//Get version HTML from server
|
128
|
+
[self.implementAPIBussiness checkVersionHTML];
|
129
|
+
|
130
|
+
[self performSelector:@selector(loadScreen) withObject:nil afterDelay:1.0];
|
131
|
+
|
132
|
+
return YES;
|
133
|
+
}
|
134
|
+
|
135
|
+
|
136
|
+
|
26
137
|
TimelineViewController.h
|
27
138
|
#import "GAITrackedViewController.h"
|
28
139
|
|
1
詳細なコード追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -15,4 +15,62 @@
|
|
15
15
|
|
16
16
|
②については
|
17
17
|
ページごとに名前を設定するself.screenName部分がクラスになるのでしょうか?
|
18
|
-
もしこれだとしてもまだテストで1ファイルにしかこのコードをいれていないので重複はしていないので困っています
|
18
|
+
もしこれだとしてもまだテストで1ファイルにしかこのコードをいれていないので重複はしていないので困っています
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
自分で関係があるのではないかと思う部分の詳細なコードを記載させていただきます。
|
24
|
+
|
25
|
+
|
26
|
+
TimelineViewController.h
|
27
|
+
#import "GAITrackedViewController.h"
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
@interface TimelineViewController : GAITrackedViewController <UIWebViewDelegate, UISearchBarDelegate, UIAlertViewDelegate, UIScrollViewDelegate, EGORefreshTableHeaderDelegate>
|
33
|
+
|
34
|
+
{
|
35
|
+
AppDelegate *mainDelegate;
|
36
|
+
|
37
|
+
EGORefreshTableHeaderView *_refreshHeaderView;
|
38
|
+
|
39
|
+
UIScrollView *webScroller;
|
40
|
+
|
41
|
+
BOOL _reloading;
|
42
|
+
}
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
TimelineViewController.m
|
47
|
+
|
48
|
+
#import "GAITrackedViewController.h"
|
49
|
+
@interface TimelineViewController (){
|
50
|
+
CGRect originalFrame;
|
51
|
+
}
|
52
|
+
|
53
|
+
@end
|
54
|
+
|
55
|
+
|
56
|
+
@implementation TimelineViewController
|
57
|
+
-(void)viewWillAppear:(BOOL)animated
|
58
|
+
{
|
59
|
+
_webView.delegate = self;
|
60
|
+
|
61
|
+
[[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationNone];
|
62
|
+
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];
|
63
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
64
|
+
selector:@selector(receiveNotification:)
|
65
|
+
name:@"numberNotification"
|
66
|
+
object:nil];
|
67
|
+
|
68
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
69
|
+
selector:@selector(receiveNotification:)
|
70
|
+
name:@"tapTabTimelineAgain"
|
71
|
+
object:nil];
|
72
|
+
[super viewWillAppear:animated];
|
73
|
+
self.screenName = [NSString stringWithFormat:@"%@", NSStringFromClass([self class])];
|
74
|
+
self.screenName = @"timeline";
|
75
|
+
|
76
|
+
}
|