Skip to content

Commit ba034bc

Browse files
Vijay ViswasVijay Viswas
Vijay Viswas
authored and
Vijay Viswas
committed
Added new method to check admin of company
1 parent fa61ed8 commit ba034bc

File tree

1 file changed

+41
-32
lines changed

1 file changed

+41
-32
lines changed

TestLK/TestLK/ShareViewController.m

+41-32
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
//
88

99
#import "ShareViewController.h"
10-
#import <LIExplorer/LIRestAPIHandlers.h>
11-
#import <LIExplorer/LITokenHandler.h>
10+
#import "LIRestAPIHandlers.h"
11+
#import "LITokenHandler.h"
1212
@interface ShareViewController ()
1313

1414
@end
@@ -17,7 +17,7 @@ @implementation ShareViewController
1717

1818
- (void)viewDidLoad {
1919
[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];
2121
// Do any additional setup after loading the view.
2222
}
2323

@@ -48,13 +48,13 @@ -(void)callAPIAtIndex:(int)index
4848
{
4949
if (index==0) {
5050

51-
[LIRestAPIHandlers shareComment:@"TEST API" withVisibity:LICommentVisibilityConnectionsOnly
51+
[LIRestAPIHandlers shareComment:@"TEST share API" withVisibity:LICommentVisibilityConnectionsOnly
5252
withCompletionBlock:^(NSDictionary *dic, NSURLResponse *response) {
5353
NSLog(@"%@",dic);
5454
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
5555
NSLog(@"response status code: %ld", (long)[httpResponse statusCode]);
5656
} failure:^(NSError *error) {
57-
57+
NSLog(@"Error: check error object");
5858
}];
5959
}
6060
else if (index==1)
@@ -63,29 +63,29 @@ -(void)callAPIAtIndex:(int)index
6363
[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) {
6464
NSLog(@"%@",dic);
6565
} failure:^(NSError *error) {
66-
66+
NSLog(@"Error: check error object");
6767
}];
6868
}
6969
else if (index==2)
7070
{
71-
[LIRestAPIHandlers shareComment:@"TEST API" forCompanyID:@"2414183" withVisibity:LICommentVisibilityConnectionsOnly
71+
[LIRestAPIHandlers shareComment:@"TEST API" forCompanyID:@"2414183" withVisibity:LICommentVisibilityAnyone
7272
withCompletionBlock:^(NSDictionary *dic, NSURLResponse *response) {
7373
NSLog(@"%@",dic);
7474
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
7575
NSLog(@"response status code: %ld", (long)[httpResponse statusCode]);
7676
} failure:^(NSError *error) {
77-
77+
NSLog(@"Error: check error object");
7878
}];
79-
79+
8080
}
8181
else if (index==3)
8282
{
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) {
8484
NSLog(@"%@",dic);
8585
} failure:^(NSError *error) {
86-
86+
NSLog(@"Error: check error object");
8787
}];
88-
88+
8989
}
9090
else if (index==4)
9191
{
@@ -94,81 +94,89 @@ -(void)callAPIAtIndex:(int)index
9494
NSLog(@"%@",dic);
9595

9696
} failure:^(NSError *error) {
97-
97+
NSLog(@"Error: check error object");
9898
}];
9999
}
100100
else if (index==5)
101101
{
102102
[LIRestAPIHandlers checkSharingEnabledForCompanyID:@"2414183" withCompletionBlock:^(NSDictionary *dic, NSURLResponse *response) {
103103
NSLog(@"%@",dic);
104104
} failure:^(NSError *error) {
105-
105+
NSLog(@"Error: check error object");
106106
}];
107107
}
108108
else if (index==6)
109109
{
110110
[LIRestAPIHandlers companyProfileForCompanyID:@"2414183" withCompletionBlock:^(NSDictionary *dic, NSURLResponse *response) {
111111
NSLog(@"%@",dic);
112112
} failure:^(NSError *error) {
113-
113+
NSLog(@"Error: check error object");
114114
}];
115115
}
116116
else if (index==7)
117117
{
118118
[LIRestAPIHandlers getStatisticsForCompanyID:@"2414183" withCompletionBlock:^(NSDictionary *dic, NSURLResponse *response) {
119119
NSLog(@"%@",dic);
120120
} failure:^(NSError *error) {
121-
121+
NSLog(@"Error: check error object");
122122
}];
123123
}
124124
else if (index==8)
125125
{
126126
[LIRestAPIHandlers getHistoricalStatisticsForCompanyID:@"2414183" withTimeGranularity:LIGranularityDay withTimestamp:@"1434856518"withCompletionBlock:^(NSDictionary *dic, NSURLResponse *response) {
127127
NSLog(@"%@",dic);
128128
} failure:^(NSError *error) {
129-
129+
NSLog(@"Error: check error object");
130130
}];
131-
131+
132132
}
133133
else if (index==9)
134134
{
135135
[LIRestAPIHandlers getHistoricalFollowerStatisticsForCompanyID:@"2414183" withTimeGranularity:LIGranularityDay withTimestamp:@"1434856518" withCompletionBlock:^(NSDictionary *dic, NSURLResponse *response) {
136136
NSLog(@"%@",dic);
137137
} failure:^(NSError *error) {
138-
138+
NSLog(@"Error: check error object");
139139
}];
140140
}
141141
else if (index==10)
142142
{
143143
[LIRestAPIHandlers getCompanyUpdatesForCompanyID:@"2414183" withCompletionBlock:^(NSDictionary *dic, NSURLResponse *response) {
144144
NSLog(@"%@",dic);
145145
} failure:^(NSError *error) {
146-
146+
NSLog(@"Error: check error object");
147147
}];
148-
148+
149149
}
150150
else if (index==11)
151151
{
152152
[LIRestAPIHandlers getSpecificCompanyUpdatesForCompanyID:@"2414183" andUpdateKEy:@"" withCompletionBlock:^(NSDictionary *dic, NSURLResponse *response) {
153153
NSLog(@"%@",dic);
154154
} failure:^(NSError *error) {
155-
155+
NSLog(@"Error: check error object");
156156
}];
157157
}
158158
else if (index==12)
159159
{
160160
[LIRestAPIHandlers getCommentsOfSpecificCompanyUpdatesForCompanyID:@"2414183" andUpdateKEy:@"" withCompletionBlock:^(NSDictionary *dic, NSURLResponse *response) {
161161
NSLog(@"%@",dic);
162162
} failure:^(NSError *error) {
163-
163+
NSLog(@"Error: check error object");
164164
}];
165165
}
166166
else if (index==13)
167167
{
168168
[LIRestAPIHandlers getLikesOfSpecificCompanyUpdatesForCompanyID:@"2414183" andUpdateKEy:@"" withCompletionBlock:^(NSDictionary *dic, NSURLResponse *response) {
169169
NSLog(@"%@",dic);
170170
} 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");
172180
}];
173181
}
174182
else{
@@ -178,16 +186,17 @@ -(void)callAPIAtIndex:(int)index
178186

179187
}
180188
/*
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+
*/
189197
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
190198
[self callAPIAtIndex:indexPath.row];
191199
}
192200

193201
@end
202+

0 commit comments

Comments
 (0)