7
7
//
8
8
9
9
#import " ShareViewController.h"
10
- #import < LIExplorer/ LIRestAPIHandlers.h>
11
- #import < LIExplorer/ LITokenHandler.h>
10
+ #import " LIRestAPIHandlers.h"
11
+ #import " LITokenHandler.h"
12
12
@interface ShareViewController ()
13
13
14
14
@end
@@ -17,7 +17,7 @@ @implementation ShareViewController
17
17
18
18
- (void )viewDidLoad {
19
19
[super viewDidLoad ];
20
- self.titleNames =[[NSMutableArray alloc ] initWithObjects: @" Share comment" ,@" Share with specific values" ,@" Company share comment" ,@" Company Share with specific values" ,@" Get profile" ,@" Check if sharing is enabled for a company" ,@" Company profile" ,@" Statistics for a company page" ,@" Historical status update statistics about a company" ,@" Historical follower statistics about a company" ,@" Company's updates" ,@" single specific company update record for the company" ,@" Comments for a specific company update" ,@" Likes for a specific company update" ,@" Logout" , nil ];
20
+ self.titleNames =[[NSMutableArray alloc ] initWithObjects: @" Share comment" ,@" Share with specific values" ,@" Company share comment" ,@" Company Share with specific values" ,@" Get profile" ,@" Check if sharing is enabled for a company" ,@" Company profile" ,@" Statistics for a company page" ,@" Historical status update statistics about a company" ,@" Historical follower statistics about a company" ,@" Company's updates" ,@" single specific company update record for the company" ,@" Comments for a specific company update" ,@" Likes for a specific company update" ,@" Check member admin of company " , @" Logout" , nil ];
21
21
// Do any additional setup after loading the view.
22
22
}
23
23
@@ -48,13 +48,13 @@ -(void)callAPIAtIndex:(int)index
48
48
{
49
49
if (index ==0 ) {
50
50
51
- [LIRestAPIHandlers shareComment: @" TEST API" withVisibity: LICommentVisibilityConnectionsOnly
51
+ [LIRestAPIHandlers shareComment: @" TEST share API" withVisibity: LICommentVisibilityConnectionsOnly
52
52
withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
53
53
NSLog (@" %@ " ,dic);
54
54
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
55
55
NSLog (@" response status code: %ld " , (long )[httpResponse statusCode ]);
56
56
} failure: ^(NSError *error) {
57
-
57
+ NSLog ( @" Error: check error object " );
58
58
}];
59
59
}
60
60
else if (index ==1 )
@@ -63,29 +63,29 @@ -(void)callAPIAtIndex:(int)index
63
63
[LIRestAPIHandlers shareComment: @" Test APi" withTitle: @" LinkedIn Developers Resources" withDescription: @" Leverage LinkedIn's APIs to maximize engagement" withSubmittedUrl: @" https://developer.linkedin.com" withImageURL: @" " withVisibity: LICommentVisibilityConnectionsOnly withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
64
64
NSLog (@" %@ " ,dic);
65
65
} failure: ^(NSError *error) {
66
-
66
+ NSLog ( @" Error: check error object " );
67
67
}];
68
68
}
69
69
else if (index ==2 )
70
70
{
71
- [LIRestAPIHandlers shareComment: @" TEST API" forCompanyID: @" 2414183" withVisibity: LICommentVisibilityConnectionsOnly
71
+ [LIRestAPIHandlers shareComment: @" TEST API" forCompanyID: @" 2414183" withVisibity: LICommentVisibilityAnyone
72
72
withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
73
73
NSLog (@" %@ " ,dic);
74
74
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
75
75
NSLog (@" response status code: %ld " , (long )[httpResponse statusCode ]);
76
76
} failure: ^(NSError *error) {
77
-
77
+ NSLog ( @" Error: check error object " );
78
78
}];
79
-
79
+
80
80
}
81
81
else if (index ==3 )
82
82
{
83
- [LIRestAPIHandlers shareComment: @" Test APi" forCompanyID: @" 2414183" withTitle: @" LinkedIn Developers Resources" withDescription: @" Leverage LinkedIn's APIs to maximize engagement" withSubmittedUrl: @" https://developer.linkedin.com" withImageURL: @" " withVisibity: LICommentVisibilityConnectionsOnly withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
83
+ [LIRestAPIHandlers shareComment: @" Test APi" forCompanyID: @" 2414183" withTitle: @" LinkedIn Developers Resources" withDescription: @" Leverage LinkedIn's APIs to maximize engagement" withSubmittedUrl: @" https://developer.linkedin.com" withImageURL: @" " withVisibity: LICommentVisibilityAnyone withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
84
84
NSLog (@" %@ " ,dic);
85
85
} failure: ^(NSError *error) {
86
-
86
+ NSLog ( @" Error: check error object " );
87
87
}];
88
-
88
+
89
89
}
90
90
else if (index ==4 )
91
91
{
@@ -94,81 +94,89 @@ -(void)callAPIAtIndex:(int)index
94
94
NSLog (@" %@ " ,dic);
95
95
96
96
} failure: ^(NSError *error) {
97
-
97
+ NSLog ( @" Error: check error object " );
98
98
}];
99
99
}
100
100
else if (index ==5 )
101
101
{
102
102
[LIRestAPIHandlers checkSharingEnabledForCompanyID: @" 2414183" withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
103
103
NSLog (@" %@ " ,dic);
104
104
} failure: ^(NSError *error) {
105
-
105
+ NSLog ( @" Error: check error object " );
106
106
}];
107
107
}
108
108
else if (index ==6 )
109
109
{
110
110
[LIRestAPIHandlers companyProfileForCompanyID: @" 2414183" withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
111
111
NSLog (@" %@ " ,dic);
112
112
} failure: ^(NSError *error) {
113
-
113
+ NSLog ( @" Error: check error object " );
114
114
}];
115
115
}
116
116
else if (index ==7 )
117
117
{
118
118
[LIRestAPIHandlers getStatisticsForCompanyID: @" 2414183" withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
119
119
NSLog (@" %@ " ,dic);
120
120
} failure: ^(NSError *error) {
121
-
121
+ NSLog ( @" Error: check error object " );
122
122
}];
123
123
}
124
124
else if (index ==8 )
125
125
{
126
126
[LIRestAPIHandlers getHistoricalStatisticsForCompanyID: @" 2414183" withTimeGranularity: LIGranularityDay withTimestamp: @" 1434856518" withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
127
127
NSLog (@" %@ " ,dic);
128
128
} failure: ^(NSError *error) {
129
-
129
+ NSLog ( @" Error: check error object " );
130
130
}];
131
-
131
+
132
132
}
133
133
else if (index ==9 )
134
134
{
135
135
[LIRestAPIHandlers getHistoricalFollowerStatisticsForCompanyID: @" 2414183" withTimeGranularity: LIGranularityDay withTimestamp: @" 1434856518" withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
136
136
NSLog (@" %@ " ,dic);
137
137
} failure: ^(NSError *error) {
138
-
138
+ NSLog ( @" Error: check error object " );
139
139
}];
140
140
}
141
141
else if (index ==10 )
142
142
{
143
143
[LIRestAPIHandlers getCompanyUpdatesForCompanyID: @" 2414183" withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
144
144
NSLog (@" %@ " ,dic);
145
145
} failure: ^(NSError *error) {
146
-
146
+ NSLog ( @" Error: check error object " );
147
147
}];
148
-
148
+
149
149
}
150
150
else if (index ==11 )
151
151
{
152
152
[LIRestAPIHandlers getSpecificCompanyUpdatesForCompanyID: @" 2414183" andUpdateKEy: @" " withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
153
153
NSLog (@" %@ " ,dic);
154
154
} failure: ^(NSError *error) {
155
-
155
+ NSLog ( @" Error: check error object " );
156
156
}];
157
157
}
158
158
else if (index ==12 )
159
159
{
160
160
[LIRestAPIHandlers getCommentsOfSpecificCompanyUpdatesForCompanyID: @" 2414183" andUpdateKEy: @" " withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
161
161
NSLog (@" %@ " ,dic);
162
162
} failure: ^(NSError *error) {
163
-
163
+ NSLog ( @" Error: check error object " );
164
164
}];
165
165
}
166
166
else if (index ==13 )
167
167
{
168
168
[LIRestAPIHandlers getLikesOfSpecificCompanyUpdatesForCompanyID: @" 2414183" andUpdateKEy: @" " withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
169
169
NSLog (@" %@ " ,dic);
170
170
} failure: ^(NSError *error) {
171
-
171
+ NSLog (@" Error: check error object" );
172
+ }];
173
+ }
174
+ else if (index ==14 )
175
+ {
176
+ [LIRestAPIHandlers checkMemberIsAdminForCompanyID: @" 2414183" withCompletionBlock: ^(NSDictionary *dic, NSURLResponse *response) {
177
+ NSLog (@" %@ " ,dic);
178
+ } failure: ^(NSError *error) {
179
+ NSLog (@" Error: check error object" );
172
180
}];
173
181
}
174
182
else {
@@ -178,16 +186,17 @@ -(void)callAPIAtIndex:(int)index
178
186
179
187
}
180
188
/*
181
- #pragma mark - Navigation
182
-
183
- // In a storyboard-based application, you will often want to do a little preparation before navigation
184
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
185
- // Get the new view controller using [segue destinationViewController].
186
- // Pass the selected object to the new view controller.
187
- }
188
- */
189
+ #pragma mark - Navigation
190
+
191
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
192
+ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
193
+ // Get the new view controller using [segue destinationViewController].
194
+ // Pass the selected object to the new view controller.
195
+ }
196
+ */
189
197
-(void )tableView : (UITableView *)tableView didSelectRowAtIndexPath : (NSIndexPath *)indexPath {
190
198
[self callAPIAtIndex: indexPath.row];
191
199
}
192
200
193
201
@end
202
+
0 commit comments