Commit 467fce6245ee96439c446a4ead2ce254e8cb154c
1 parent
694a99bd
no message
Showing
1 changed file
with
42 additions
and
1 deletions
CNLiveScioLive/Pages/Live/Controller/GraphicLiveViewController.m
| @@ -191,7 +191,48 @@ | @@ -191,7 +191,48 @@ | ||
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | - (void)shareButton:(UIButton *)btn{ | 193 | - (void)shareButton:(UIButton *)btn{ |
| 194 | - | 194 | + NSString *text = [NSString stringWithFormat:@"%@",_dictionary[@"subTitle"]]; |
| 195 | + if ([text isEqualToString:@"<null>"]) { | ||
| 196 | + text = _dictionary[@"title"]; | ||
| 197 | + } | ||
| 198 | + NSMutableDictionary *shareParams = [NSMutableDictionary dictionary]; | ||
| 199 | + [shareParams SSDKSetupShareParamsByText:text | ||
| 200 | + images:nil | ||
| 201 | + url:[NSURL URLWithString:_dictionary[@"pageUrl"]] | ||
| 202 | + title:_dictionary[@"title"] | ||
| 203 | + type:SSDKContentTypeAuto]; | ||
| 204 | + //2、分享(可以弹出我们的分享菜单和编辑界面) | ||
| 205 | + [ShareSDK showShareActionSheet:nil //要显示菜单的视图, iPad版中此参数作为弹出菜单的参照视图,只有传这个才可以弹出我们的分享菜单,可以传分享的按钮对象或者自己创建小的view 对象,iPhone可以传nil不会影响 | ||
| 206 | + items:nil | ||
| 207 | + shareParams:shareParams | ||
| 208 | + onShareStateChanged:^(SSDKResponseState state, SSDKPlatformType platformType, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error, BOOL end) { | ||
| 209 | + | ||
| 210 | + switch (state) { | ||
| 211 | + case SSDKResponseStateSuccess: | ||
| 212 | + { | ||
| 213 | + UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:CustomStr(@"ShareSuccess") | ||
| 214 | + message:nil | ||
| 215 | + delegate:nil | ||
| 216 | + cancelButtonTitle:CustomStr(@"Sure") | ||
| 217 | + otherButtonTitles:nil]; | ||
| 218 | + [alertView show]; | ||
| 219 | + break; | ||
| 220 | + } | ||
| 221 | + case SSDKResponseStateFail: | ||
| 222 | + { | ||
| 223 | + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:CustomStr(@"ShareFailure") | ||
| 224 | + message:[NSString stringWithFormat:@"%@",error] | ||
| 225 | + delegate:nil | ||
| 226 | + cancelButtonTitle:CustomStr(@"Sure") | ||
| 227 | + otherButtonTitles:nil, nil]; | ||
| 228 | + [alert show]; | ||
| 229 | + break; | ||
| 230 | + } | ||
| 231 | + default: | ||
| 232 | + break; | ||
| 233 | + } | ||
| 234 | + } | ||
| 235 | + ]; | ||
| 195 | } | 236 | } |
| 196 | 237 | ||
| 197 | - (void)pausePlayer { | 238 | - (void)pausePlayer { |