Commit 04803a56 authored by wind.wang's avatar wind.wang

alipay upgrade

parent 3fbc92d0
......@@ -126,7 +126,6 @@ static NSString *state = @"terminus_snsapi_userinfo";
NSArray* permissions = [NSArray arrayWithObjects:
kOPEN_PERMISSION_GET_USER_INFO,
kOPEN_PERMISSION_GET_SIMPLE_USER_INFO,
kOPEN_PERMISSION_ADD_SHARE,
nil];
[self.tencentOAuth authorize:permissions inSafari:NO];
}
......
......@@ -54,15 +54,15 @@
return self;
}
// - (void) setUmengAppKey:(NSString *)umengAppKey{
// _umengAppKey = [umengAppKey copy];
// [[UMSocialManager defaultManager] setUmSocialAppkey:_umengAppKey];
// }
// - (void) enableShareWithumengAppKey:(NSString *)umengAppKey snsNames:(NSArray *)snsNames{
// [self setUmengAppKey:umengAppKey];
// [self setSnsNames:snsNames];
// }
//- (void) setUmengAppKey:(NSString *)umengAppKey{
// _umengAppKey = [umengAppKey copy];
// [[UMSocialManager defaultManager] setUmSocialAppkey:_umengAppKey];
//}
//
//- (void) enableShareWithumengAppKey:(NSString *)umengAppKey snsNames:(NSArray *)snsNames{
// [self setUmengAppKey:umengAppKey];
// [self setSnsNames:snsNames];
//}
- (void) shareHandler:(NSDictionary *)data callback:(RNShareResponseCallback)callback;{
if (callback){
......@@ -178,7 +178,7 @@
}
- (void)initAli:(NSString*)appKey appSecret:(NSString*)appSecret redirect:(NSString*)redirect{
[[UMSocialManager defaultManager] setPlaform: UMSocialPlatformType_AlipaySession appKey:appKey appSecret:appSecret redirectURL:redirect];
[[UMSocialManager defaultManager] setPlaform: UMSocialPlatformType_APSession appKey:appKey appSecret:appSecret redirectURL:redirect];
[[RNLoginManager shareInstance] initAlipayLogin:appKey scheme:redirect];
}
......@@ -188,7 +188,7 @@
}
- (void)initAliPayShare:(NSString *)appKey appSecret:(NSString*)appSecret redirect:(NSString*)redirect {
[[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_AlipaySession appKey:appKey appSecret:appSecret redirectURL:redirect];
[[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_APSession appKey:appKey appSecret:appSecret redirectURL:redirect];
}
- (void)initDingTalkShare:(NSString *)appKey appSecret:(NSString *)appSecret redirect:(NSString *)redirect {
......
!function(){if(!window.AlipayJSBridge){window.alipayjsbridgeSetTitle=function(e){document.title=e,t("alipayjsbridge://setTitle?title="+encodeURIComponent(e))},window.alipayjsbridgeRefresh=function(){t("alipayjsbridge://onRefresh?")},window.alipayjsbridgeBack=function(){t("alipayjsbridge://onBack?")},window.alipayjsbridgeExit=function(e){t("alipayjsbridge://onExit?bsucc="+e)},window.alipayjsbridgeShowBackButton=function(e){t("alipayjsbridge://showBackButton?bshow="+e)},window.AlipayJSBridge={version:"2.0",addListener:function(e,i){a[e]=i},hasListener:function(e){if(!a[e])return!1;return!0},callListener:function(e,i,n){var t;n&&(t=function(e){var i="";e&&(i=encodeURIComponent(JSON.stringify(e)));var a="func=h5JsFuncCallback&cbId="+n+"&data="+i;o(a)});var r=a[e];r?r(i,t):console.log("AlipayJSBridge: no h5JsFunc ",e+i)},callNativeFunc:function(e,a,t){var r="";t&&(r="cb_"+i+++"_"+(new Date).getTime(),n[r]=t);var d="";a&&(d=encodeURIComponent(JSON.stringify(a)));o("func="+e+"&cbId="+r+"&data="+d)},callBackFromNativeFunc:function(e,i){var a=n[e];a&&(a(i),delete n[i])}};var e,i=1,n={},a={};window.CustomEvent?e=new CustomEvent("alipayjsbridgeready"):(e=document.createEvent("Event")).initEvent("alipayjsbridgeready",!0,!0),document.dispatchEvent(e),setTimeout(function(){if(window.AlipayJSBridgeInitArray){var e=window.AlipayJSBridgeInitArray;delete window.AlipayJSBridgeInitArray;for(var i=0;i<e.length;i++)try{e[i](AlipayJSBridge)}catch(e){setTimeout(function(){throw e})}}},0)}function t(e){window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.MQPJSBridgeScheme&&window.webkit.messageHandlers.MQPJSBridgeScheme.postMessage&&window.webkit.messageHandlers.MQPJSBridgeScheme.postMessage(e)}function o(e){t("alipayjsbridge://callNativeFunc?"+e)}}();
//
// AFServiceCenter.h
// AFServiceSDK
//
// Created by jiajunchen on 02/01/2018.
// Copyright © 2018 antfin. All rights reserved.
//
#import <Foundation/Foundation.h>
@class AFServiceResponse;
/**
SDK支持的业务枚举值
- AFServiceEInvoice: 电子发票
- AFServiceAuth: 账户授权
*/
typedef NS_ENUM(NSUInteger, AFService) {
AFServiceEInvoice,
AFServiceAuth,
AFServiceDeduct
};
extern NSString * const kAFServiceOptionBizParams; // 钱包服务调用入参
extern NSString * const kAFServiceOptionCallbackScheme; // 业务回跳当前app的scheme
extern NSString * const kAFServiceOptionNotUseLanding; // 不使用支付宝提示下载页做补偿,为true时需要商户自己处理用户未安装支付宝的情况
extern NSString * const kAFServiceBizParamsKeyUrl; // 独立签约入参url
typedef void(^AFServiceResultBlock)(AFServiceResponse *response);
@interface AFServiceCenter : NSObject
/**
调用钱包服务
@param service 业务service, 见AFService枚举值
@param params 参数Dictionary, key值详情参见kAFServiceOptionBizParams、kAFServiceOptionCallbackScheme注释
@param block 业务结果回调的block, block参数是AFServiceResponse类型,业务结果通过result属性获取,如果未用户未安装支付宝并且kAFServiceOptionNotUseLanding未设置为true,会使用H5landing页做补偿,这种情况下不会有block回调结果。
*/
+ (void)callService:(AFService)service
withParams:(NSDictionary *)params
andCompletion:(AFServiceResultBlock)block;
/**
处理钱包服务回跳APP的URL
@param url 回跳URL
@param block 业务结果回掉的block,详情见调用接口入参上的block。注意此接口上的block只有在跳转钱包后,当前APP被系统回收的情况下回跳才生效
*/
+ (void)handleResponseURL:(NSURL *)url
withCompletion:(AFServiceResultBlock)block;
@end
//
// AFServiceResponse.h
// AFServiceSDK
//
// Created by jiajunchen on 08/01/2018.
// Copyright © 2018 antfin. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
钱包服务调用结果状态吗
- AFResSuccess: 默认值,业务调用成功,结果数据参见result字段
- AFResInvalidService: service枚举值错误
- AFResInvalidURL: 钱包回跳URL错误
- AFResRepeatCall: 业务重复调用(3s内)
- AFResOpenURLErr: 跳转失败
*/
typedef NS_ENUM(NSUInteger, AFResCode) {
AFResSuccess = 0,
AFResInvalidService = 100,
AFResInvalidURL,
AFResRepeatCall,
AFResOpenURLErr,
};
@interface AFServiceResponse : NSObject
/**
业务调用状态吗
*/
@property (nonatomic, assign) AFResCode responseCode;
/**
业务结果Dictionary, 内容请参考具体业务方接入文档
*/
@property (readonly) NSDictionary *result;
@end
......@@ -18,5 +18,5 @@
"start": "react-native start",
"test": "jest"
},
"version": "1.3.1"
"version": "1.3.3"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment