Skip to content

Commit

Permalink
ios: fix thumbImage crash (yorkie#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard-Cao authored and yorkie committed Aug 16, 2016
1 parent eb11f96 commit 91d1e4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ios/RCTWeChat.m
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ - (void)shareToWeixinWithData:(NSDictionary *)aData scene:(int)aScene callback:(
{
NSString *imageUrl = aData[RCTWXShareTypeThumbImageUrl];
if (imageUrl.length && _bridge.imageLoader) {
NSURLRequest *imageRequest = [NSURLRequest requestWithURL:aData[RCTWXShareTypeThumbImageUrl]];
NSURL *url = [NSURL URLWithString:imageUrl];
NSURLRequest *imageRequest = [NSURLRequest requestWithURL:url];
[_bridge.imageLoader loadImageWithURLRequest:imageRequest size:CGSizeMake(100, 100) scale:1 clipped:FALSE resizeMode:RCTResizeModeStretch progressBlock:nil completionBlock:^(NSError *error, UIImage *image) {
[self shareToWeixinWithData:aData thumbImage:image scene:aScene callBack:aCallBack];
}];
Expand Down

0 comments on commit 91d1e4f

Please sign in to comment.