Skip to content

Commit

Permalink
Merge pull request #6 from Cee/master
Browse files Browse the repository at this point in the history
Fix a crash when calling Alipay or Wechat on iOS 7

Thank you very much, @Cee
  • Loading branch information
100apps committed Jun 15, 2015
2 parents a1b2a9d + a75c754 commit cb46728
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion openshare/OpenShare+Alipay.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ +(void)AliPay:(NSString*)link Success:(paySuccess)success Fail:(payFail)fail{
}
+(BOOL)Alipay_handleOpenURL{
NSURL* url=[self returnedURL];
if ([url.absoluteString containsString:@"//safepay/"] ) {
if ([url.absoluteString rangeOfString:@"//safepay/"].location != NSNotFound) {
NSError *err;
NSDictionary *ret=[NSJSONSerialization JSONObjectWithData:[[self urlDecode:url.query]dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:&err];
if (err||ret[@"memo"]==[NSNull null]||[ret[@"memo"][@"ResultStatus"] intValue]!=9000) {
Expand Down
4 changes: 2 additions & 2 deletions openshare/OpenShare+Weixin.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ +(BOOL)Weixin_handleOpenURL{
if ([url.scheme hasPrefix:@"wx"]) {
NSDictionary *retDic=[NSPropertyListSerialization propertyListWithData:[[UIPasteboard generalPasteboard] dataForPasteboardType:@"content"]?:[[NSData alloc] init] options:0 format:0 error:nil][[self keyFor:schema][@"appid"]];
NSLog(@"retDic\n%@",retDic);
if ([url.absoluteString containsString:@"://oauth"]) {
if ([url.absoluteString rangeOfString:@"://oauth"].location != NSNotFound) {
//login succcess
if ([self authSuccessCallback]) {
[self authSuccessCallback]([self parseUrl:url]);
}
}else if([url.absoluteString containsString:@"://pay/"]){
}else if([url.absoluteString rangeOfString:@"://pay/"].location != NSNotFound){
NSDictionary *urlMap=[self parseUrl:url];
if ([urlMap[@"ret"] intValue]==0) {
if ([self paySuccessCallback]) {
Expand Down

0 comments on commit cb46728

Please sign in to comment.