调试拉起支付
This commit is contained in:
@@ -184,11 +184,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)cellContent:(MessageBaseModel *)model {
|
||||
// MessageHeadlinesTextModel *imageModel = (MessageHeadlinesTextModel *)model;
|
||||
return @"123";//[NSString stringWithFormat:@"%@", model.f];
|
||||
}
|
||||
|
||||
#pragma mark - 懒加载
|
||||
- (NetImageView *)avatarView{
|
||||
if(!_avatarView){
|
||||
|
@@ -48,11 +48,14 @@
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
NSString * deviceInfo = [YYUtility deviceID];
|
||||
NSString * clientIp= [YYUtility ipAddress];
|
||||
@kWeakify(self);
|
||||
[Api requestIAPRecharge:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
NSString *orderId = (NSString *)data.data[@"recordId"];
|
||||
NSString *uuid = (NSString *)data.data[@"appAccountToken"];
|
||||
[[self getView] requestIAPRechargeOrderSuccess:orderId chargeProdId:chargeProdId uuid:uuid];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if(code != 50000){
|
||||
[[self getView]showErrorToast:msg];
|
||||
}
|
||||
|
@@ -92,6 +92,7 @@
|
||||
[self createUI];
|
||||
[self initHttpData];
|
||||
}
|
||||
|
||||
- (void)createUI {
|
||||
self.view.backgroundColor = UIColorFromRGB(0xF4F5FA);
|
||||
|
||||
@@ -145,7 +146,7 @@
|
||||
[self getRechargeList];
|
||||
[self.presenter getBannerList];
|
||||
[self getUserWalletBalanceInfo];
|
||||
[self checkTranscationIds];
|
||||
[self checkTransactionIds];
|
||||
}
|
||||
|
||||
/// 返回
|
||||
@@ -211,7 +212,7 @@
|
||||
[self.collectionView reloadData];
|
||||
}
|
||||
///批量验证
|
||||
- (void)checkTranscationIds {
|
||||
- (void)checkTransactionIds {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSArray * array = [RechargeStorage getAllReciptsWithUid:uid];
|
||||
|
||||
@@ -282,10 +283,10 @@
|
||||
#pragma mark - XPIAPHelperDelegate
|
||||
///当前充值的状态
|
||||
- (void)rechargeNewProcessStatus:(StoreConditionResult)status {
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
if (status == StoreConditionResultPay || status == StoreConditionResultStart || status == StoreConditionResultVerifiedServer) {
|
||||
|
||||
if (status == StoreConditionResultPay ||
|
||||
status == StoreConditionResultStart ||
|
||||
status == StoreConditionResultVerifiedServer) {
|
||||
}else if (status == StoreConditionResultUnowned) {
|
||||
[XNDJTDDLoadingTool hideHUDInView:kWindow];
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController1")];
|
||||
@@ -294,7 +295,6 @@
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController0")];
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
///充值成功回调id
|
||||
@@ -303,7 +303,6 @@
|
||||
[self saveRechageReciptWithTransactionIdentifier:transactionIdentifier];
|
||||
///二次验证
|
||||
[self.presenter checkReceiptWithOrderId:self.orderId transcationId:transactionIdentifier errorToast:YES];
|
||||
|
||||
}
|
||||
#pragma mark - XPMineRechargeProtocol
|
||||
- (void)requestRechargeListSucccess:(NSArray *)list {
|
||||
@@ -333,27 +332,16 @@
|
||||
NSString *transactionId = result[@"transactionId"];
|
||||
|
||||
[self rechargeSuccess:transactionId];
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
} else {
|
||||
[XNDJTDDLoadingTool hideHUDInView:kWindow];
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController10")];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
[XNDJTDDLoadingTool hideHUDInView:kWindow];
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@
|
||||
#import "XPHomeMineViewController.h"
|
||||
#import "XPRoomSearchContainerViewController.h"
|
||||
|
||||
#import "FeedBackViewController.h"
|
||||
#import "XPWebViewController.h"
|
||||
|
||||
@interface XPHomePagingViewController () <UIPageViewControllerDelegate, UIPageViewControllerDataSource>
|
||||
|
||||
@@ -146,10 +146,31 @@
|
||||
make.height.mas_equalTo(4);
|
||||
make.centerX.mas_equalTo(self.recommendButton.mas_centerX);
|
||||
}];
|
||||
|
||||
#if DEBUG
|
||||
@kWeakify(self);
|
||||
UIButton *b = [UIButton buttonWithType:UIButtonTypeClose primaryAction:[UIAction actionWithHandler:^(__kindof UIAction * _Nonnull action) {
|
||||
@kStrongify(self);
|
||||
[self __testMethod];
|
||||
}]];
|
||||
[self.topControlView addSubview:b];
|
||||
[b mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.mineButton);
|
||||
if (isMSRTL()) {
|
||||
make.left.mas_equalTo(self.topControlView).offset(16);
|
||||
} else {
|
||||
make.right.mas_equalTo(self.topControlView).offset(-36);
|
||||
}
|
||||
make.width.height.mas_equalTo(36);
|
||||
}];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)__testMethod {
|
||||
FeedBackViewController *vc = [[FeedBackViewController alloc] init];
|
||||
// FeedBackViewController *vc = [[FeedBackViewController alloc] init];
|
||||
// [self.navigationController pushViewController:vc animated:YES];
|
||||
XPWebViewController *vc = [[XPWebViewController alloc]init];
|
||||
vc.url = @"http://beta.api.molistar.xyz/molistar/modules/order/index.html";//[NSURL URLWithString:];
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
|
@@ -67,7 +67,6 @@
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.backImageView];
|
||||
|
||||
|
||||
[self.backImageView addSubview:self.senderAvatarView];
|
||||
[self.backImageView addSubview:self.pi_contentView];
|
||||
[self.backImageView addSubview:self.pi_roomIconView];
|
||||
@@ -75,13 +74,10 @@
|
||||
[self.backImageView addSubview:self.circuseeBtn];
|
||||
[self.backImageView addSubview:self.giftImageView];
|
||||
[self.backImageView addSubview:self.countLabel];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
|
||||
|
||||
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
@@ -126,11 +122,6 @@
|
||||
make.leading.mas_equalTo(self.giftImageView.mas_trailing).offset(kGetScaleWidth(2));
|
||||
make.centerY.mas_equalTo(self.backImageView);
|
||||
}];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)initEvents {
|
||||
@@ -142,58 +133,33 @@
|
||||
UIColor *bgBtnColor;
|
||||
NSString * bgImageName;
|
||||
|
||||
|
||||
|
||||
switch (level) {
|
||||
case BroadCastLevel_Normal:
|
||||
{
|
||||
|
||||
|
||||
lineColor = UIColorFromRGB(0x66B5FF);
|
||||
bgBtnColor = UIColorFromRGB(0x283889);
|
||||
bgImageName = @"pi_room_gift_broadcast_low_bg";
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case BroadCastLevel_Middle:
|
||||
{
|
||||
|
||||
|
||||
|
||||
lineColor = UIColorFromRGB(0xFE9FFF);
|
||||
bgBtnColor = UIColorFromRGB(0x49157D);
|
||||
|
||||
bgImageName = @"pi_room_gift_broadcast_middle_bg";
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case BroadCastLevel_High:
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
lineColor = UIColorFromRGB(0xFFED77);
|
||||
bgBtnColor = UIColorFromRGB(0x87152D);
|
||||
|
||||
bgImageName = @"pi_room_gift_broadcast_high_bg";
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
|
||||
|
||||
|
||||
lineColor = UIColorFromRGB(0x66B5FF);
|
||||
bgBtnColor = UIColorFromRGB(0x283889);
|
||||
|
||||
bgImageName = @"pi_room_gift_broadcast_low_bg";
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -205,6 +171,7 @@
|
||||
-(void)showRoomVC{
|
||||
[self didClickEnterRoom];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setBroadcastModel:(GiftReceiveInfoModel *)broadcastModel {
|
||||
_broadcastModel = broadcastModel;
|
||||
|
@@ -116,7 +116,6 @@
|
||||
make.leading.mas_equalTo(self).offset(15);
|
||||
make.top.trailing.mas_equalTo(self);
|
||||
make.height.mas_equalTo(0);
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
@@ -62,7 +62,6 @@
|
||||
[[self getView] updateRoomTopicFail:YMLocalizedString(@"XPRoomTopicPresenter0")];
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -18,6 +18,10 @@
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
#import "XPMineUserInfoViewController.h"
|
||||
|
||||
#import "Api+Mine.h"
|
||||
#import "YuMi-swift.h"
|
||||
#import "RechargeStorage.h"
|
||||
|
||||
///vc
|
||||
#import "XPMineDressUpViewController.h"
|
||||
#import "XPDressUpShopViewController.h"
|
||||
@@ -89,6 +93,10 @@ typedef NS_ENUM(NSUInteger, RightNavigationPushType){
|
||||
///
|
||||
@property (nonatomic,assign) BOOL isCustom;
|
||||
@property(nonatomic,strong) PIWebViewSavePhotoView *saveView;
|
||||
|
||||
/// 订单编号
|
||||
@property (nonatomic,copy) NSString *orderId;
|
||||
|
||||
@end
|
||||
|
||||
NSString * const kJSOpenPurse = @"openPurse";
|
||||
@@ -113,6 +121,8 @@ NSString * const kJSOpenChatPage = @"geToChatPage";
|
||||
NSString * const kJSOpenAppConcernedChat = @"openAppConcernedChat";
|
||||
NSString * const kJSSavePictureShare = @"savePictureShare";
|
||||
NSString * const kJSGoToExchangeGold = @"goToExchangeGold";
|
||||
NSString * const kJSOpenPayment = @"openPayment";
|
||||
NSString * const kJSOpenPaymentCallback = @"openPaymentCallback";
|
||||
|
||||
|
||||
@implementation XPWebViewController
|
||||
@@ -229,9 +239,6 @@ NSString * const kJSGoToExchangeGold = @"goToExchangeGold";
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
||||
[Api getUserWalletInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@@ -299,20 +306,22 @@ NSString * const kJSGoToExchangeGold = @"goToExchangeGold";
|
||||
NSURLCredential *card = [[NSURLCredential alloc]initWithTrust:challenge.protectionSpace.serverTrust];
|
||||
completionHandler(NSURLSessionAuthChallengeUseCredential,card);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
|
||||
[self.webview evaluateJavaScript:@"document.location.href" completionHandler:^(id _Nullable response, NSError * _Nullable error) {
|
||||
- (void)userContentController:(WKUserContentController *)userContentController
|
||||
didReceiveScriptMessage:(WKScriptMessage *)message {
|
||||
[self.webview evaluateJavaScript:@"document.location.href"
|
||||
completionHandler:^(id _Nullable response, NSError * _Nullable error) {
|
||||
NSLog(@"%@", response);
|
||||
NSLog(@"-- -- - -- - -%@: %@", message.name, message.body);
|
||||
NSString *currentUrl = [NSString stringWithFormat:@"%@", response];
|
||||
///测试环境只要有host就执行,方便h5连接本地调试
|
||||
|
||||
BOOL condition = currentUrl != nil && [currentUrl containsString:API_HOST_URL];
|
||||
#ifdef DEBUG
|
||||
if (currentUrl != nil) {
|
||||
#else
|
||||
if (currentUrl != nil && [currentUrl containsString:API_HOST_URL]) {
|
||||
condition = currentUrl != nil;
|
||||
#endif
|
||||
if(condition) {
|
||||
if ([message.name isEqualToString:kJSOpenSharePage]) {
|
||||
if (message.body && message.body != [NSNull null]) {
|
||||
NSDictionary *body;
|
||||
@@ -352,11 +361,11 @@ NSString * const kJSGoToExchangeGold = @"goToExchangeGold";
|
||||
} else if ([message.name isEqualToString:kJSOpenPurse]) {
|
||||
|
||||
}else if([message.name isEqualToString:kJSChargePayPage]){
|
||||
// NSString *money = [NSString stringWithFormat:@"%@",message.body] ;
|
||||
// NSString *money = [NSString stringWithFormat:@"%@",message.body] ;
|
||||
|
||||
}else if([message.name isEqualToString:kJSChargePayClickPage]){
|
||||
if(message.body != nil && self.model.diamonds != nil){
|
||||
// NSString *type = [NSString stringWithFormat:@"%@",message.body];
|
||||
// NSString *type = [NSString stringWithFormat:@"%@",message.body];
|
||||
}
|
||||
}else if ([message.name isEqualToString:kJSOpenChargePage]) {
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(payHandler)]){
|
||||
@@ -504,11 +513,188 @@ NSString * const kJSGoToExchangeGold = @"goToExchangeGold";
|
||||
}else if([message.name isEqualToString:kJSGoToExchangeGold]){
|
||||
XPIncomeRecordVC *incomeRecordVC = [XPIncomeRecordVC new];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:incomeRecordVC animated:YES];
|
||||
}else if([message.name isEqualToString:kJSOpenPayment]) {
|
||||
[self handleOpenPayment:message.body];
|
||||
}
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Payment Method
|
||||
- (void)handleOpenPayment:(NSString *)chargeProdId {
|
||||
#if DEBUG
|
||||
chargeProdId = @"com.hflighting.yumi.first.10";
|
||||
#endif
|
||||
if (chargeProdId.length == 0) {
|
||||
[self showErrorToast:@"no charge ID"];
|
||||
return;
|
||||
}
|
||||
|
||||
[self showLoading];
|
||||
|
||||
@kWeakify(self);
|
||||
[Api requestIAPRecharge:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
[self showErrorToast:@"苹果下单 成功"];
|
||||
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
switch (code) {
|
||||
case 200: {
|
||||
NSString *orderId = (NSString *)data.data[@"recordId"];
|
||||
NSString *uuid = (NSString *)data.data[@"appAccountToken"];
|
||||
[self handleGetIAPRechargeSuccess:orderId
|
||||
uuid:uuid
|
||||
chargeProdId:chargeProdId];
|
||||
}
|
||||
break;
|
||||
case 50000:
|
||||
[self showErrorToast:msg];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
chargeProdId:chargeProdId
|
||||
uid:[AccountInfoStorage instance].getUid
|
||||
ticket:[AccountInfoStorage instance].getTicket
|
||||
deviceInfo:[YYUtility deviceID]
|
||||
clientIp:[YYUtility ipAddress]];
|
||||
}
|
||||
|
||||
- (void)handleGetIAPRechargeSuccess:(NSString *)orderID
|
||||
uuid:(NSString *)uuid
|
||||
chargeProdId:(NSString *)chargeProdId {
|
||||
if (orderID.length > 0) {
|
||||
self.orderId = orderID;
|
||||
if (@available(iOS 15.0, *)) {
|
||||
PIIAPRegulate *iap = [PIIAPRegulate shared];
|
||||
[iap demandCommodityThingWithProductId:chargeProdId
|
||||
uuid:uuid
|
||||
completionHandler:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
@kWeakify(self);
|
||||
iap.ConditionBlock = ^(enum StoreConditionResult state, NSDictionary<NSString *,id> * _Nullable result) {
|
||||
@kStrongify(self);
|
||||
switch (state) {
|
||||
case StoreConditionResultVerifiedServer: {
|
||||
NSString *transactionId = result[@"transactionId"];
|
||||
NSLog(@"-- -- - -- - - transactionId: %@, orderID: %@", transactionId, orderID);
|
||||
[self rechargeSuccess:transactionId];
|
||||
}
|
||||
break;
|
||||
case StoreConditionResultUnowned: {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[XNDJTDDLoadingTool hideHUDInView:kWindow];
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController1")];
|
||||
});
|
||||
}
|
||||
break;
|
||||
case StoreConditionResultPay:
|
||||
case StoreConditionResultStart:
|
||||
break;
|
||||
default: {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[XNDJTDDLoadingTool hideHUDInView:kWindow];
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController1")];
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
} else {
|
||||
[XNDJTDDLoadingTool hideHUDInView:kWindow];
|
||||
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController10")];
|
||||
}
|
||||
}else{
|
||||
[XNDJTDDLoadingTool hideHUDInView:kWindow];
|
||||
}
|
||||
}
|
||||
|
||||
///充值成功回调id
|
||||
- (void)rechargeSuccess:(NSString *)transactionIdentifier {
|
||||
///保存唯一凭证
|
||||
[self saveRechageReciptWithTransactionIdentifier:transactionIdentifier];
|
||||
|
||||
///二次验证
|
||||
@kWeakify(self);
|
||||
[Api checkReceipt:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if (code == 200) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
chooseEnv:@"true"
|
||||
chargeRecordId:self.orderId
|
||||
transcationId:transactionIdentifier
|
||||
uid:[AccountInfoStorage instance].getUid
|
||||
ticket:[AccountInfoStorage instance].getTicket];
|
||||
}
|
||||
|
||||
///充值成功之后保存订单到钥匙串
|
||||
- (void)saveRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
|
||||
NSData *receipt = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
|
||||
NSString *encodeStr = [receipt base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
|
||||
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
|
||||
if(transactionIdentifier != nil){
|
||||
[dictionary setObject:transactionIdentifier forKey:@"transcationId"];
|
||||
}
|
||||
if(encodeStr != nil){
|
||||
[dictionary setObject:encodeStr forKey:@"recipt"];
|
||||
}
|
||||
if(self.orderId != nil){
|
||||
[dictionary setObject:self.orderId forKey:@"orderId"];
|
||||
}
|
||||
if(dictionary.allKeys.count == 0)return;
|
||||
NSString *reciptJson = [dictionary toJSONString];
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
BOOL saveSuccess = [RechargeStorage saveTranscationId:transactionIdentifier recipt:reciptJson uid:uid];
|
||||
if (!saveSuccess) {
|
||||
NSLog(@"保存订单失败");
|
||||
}
|
||||
}
|
||||
|
||||
///二次验证成功
|
||||
- (void)checkReceiptSuccess:(NSString *)transcationId {
|
||||
[XNDJTDDLoadingTool hideHUDInView:kWindow];
|
||||
if (@available(iOS 15.0, *)) {
|
||||
PIIAPRegulate *iap = [PIIAPRegulate shared];
|
||||
[iap verifyBusinessAccomplishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
|
||||
|
||||
[self triggerOpenPaymentCallback:200
|
||||
orderID:self.orderId
|
||||
productID:transcationId];
|
||||
}
|
||||
|
||||
///删除本地保存的
|
||||
- (void)deleteRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
BOOL deleteSuccess = [RechargeStorage delegateTranscationId:transactionIdentifier
|
||||
uid:uid];
|
||||
if (deleteSuccess) {
|
||||
NSLog(@"删除本地账单失败");
|
||||
}
|
||||
}
|
||||
|
||||
- (void)triggerOpenPaymentCallback:(NSInteger)code
|
||||
orderID:(NSString *)orderID
|
||||
productID:(NSString *)productID {
|
||||
NSDictionary *dic = @{@"code":@(code), @"orderId":orderID, @"productId":productID};
|
||||
NSString *js = [NSString stringWithFormat:@"openPaymentCallback(%@)", dic.toJSONString];
|
||||
[self.webview evaluateJavaScript:js
|
||||
completionHandler:^(id _Nullable result, NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - private method
|
||||
- (void)handleRouterType:(NSInteger)skyType message:(WKScriptMessage *)message {
|
||||
NSDictionary *bodyDict = (NSDictionary *)message.body;
|
||||
@@ -666,7 +852,6 @@ NSString * const kJSGoToExchangeGold = @"goToExchangeGold";
|
||||
shareView.delegate = self;
|
||||
|
||||
[TTPopup popupView:shareView style:TTPopupStyleActionSheet];
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - XCShareViewDelegate
|
||||
@@ -856,7 +1041,9 @@ NSString * const kJSGoToExchangeGold = @"goToExchangeGold";
|
||||
[_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSSavePictureShare];
|
||||
///兑换金币
|
||||
[_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGoToExchangeGold];
|
||||
|
||||
///周卡内购
|
||||
[_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenPayment];
|
||||
[_pi_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenPaymentCallback];
|
||||
|
||||
}
|
||||
return _pi_userContentController;
|
||||
|
@@ -70,13 +70,11 @@ public class PIIAPRegulate: NSObject {
|
||||
if let scene = await view.window?.windowScene{
|
||||
try await Transaction.beginRefundRequest(for:transactionId , in: scene)
|
||||
}
|
||||
|
||||
}catch{
|
||||
print("iap error")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 购买某个产品
|
||||
@objc public func demandCommodityThing(productId:String, uuid: String) async throws {
|
||||
if(ConditionBlock != nil ){
|
||||
|
Reference in New Issue
Block a user