Commit fbc1b8de authored by Mazy's avatar Mazy

optimize mine logic

parent e97306ac
......@@ -158,6 +158,7 @@ class ZTPurchaseManager: NSObject {
print("Restore Success: \(results.restoredPurchases)")
if let product = results.restoredPurchases.last {
if product.needsFinishTransaction {
let receiptData = SwiftyStoreKit.localReceiptData
let receiptString = receiptData?.base64EncodedString(options: []) ?? ""
print("receiptString: \(receiptString)")
......@@ -175,17 +176,15 @@ class ZTPurchaseManager: NSObject {
guard let status = data["status"] as? Bool, status == true else {
return
}
if product.needsFinishTransaction {
SwiftyStoreKit.finishTransaction(product.transaction)
}
print("Purchase Success: \(product.productId)")
SwiftyStoreKit.finishTransaction(product.transaction)
success()
}) { (error) in
innerHud.hide(animated: true)
}
}
}
} else {
MBProgressHUD.showError("没有商品可恢复")
print("Nothing to Restore")
......
......@@ -185,7 +185,7 @@
if (Member) {
_gongNengLabel.text = kLocalizedString(@"mine_unlocked");
_timeLabel.text = kLocalizedString(@"mine_free_used");
// _xuFeiButton.hidden = YES;
_xuFeiButton.hidden = YES;
}else{
_gongNengLabel.text = kLocalizedString(@"mine_premium_services_locked");
_timeLabel.text = kLocalizedString(@"mine_unlock_more_services");
......@@ -197,10 +197,20 @@
_nicknameLabel.text = userInfo.nickname;
}
}else{
if (Member) {
_gongNengLabel.text = kLocalizedString(@"mine_unlocked");
_timeLabel.text = kLocalizedString(@"mine_free_used");
_nicknameLabel.text = kLocalizedString(@"mine_sign"); // [[data Read] objectForKey:@"NickName"];
_xuFeiButton.hidden = true;
}else{
_gongNengLabel.text = kLocalizedString(@"mine_premium_services_locked");
_timeLabel.text = kLocalizedString(@"mine_unlock_more_services");
[_xuFeiButton setTitle:kLocalizedString(@"mine_unlock") forState:(UIControlStateNormal)];
_xuFeiButton.hidden = false;
}
// _gongNengLabel.text = kLocalizedString(@"mine_premium_services_locked");
// _timeLabel.text = kLocalizedString(@"mine_unlock_more_services");
// [_xuFeiButton setTitle:kLocalizedString(@"mine_unlock") forState:(UIControlStateNormal)];
}
if ([userInfo.uid isEqual: @""]) {
......
......@@ -156,7 +156,7 @@ appName = "Family Mapp";
"mine_sign"="Sign in";
"mine_click_nickname"="Click name to edit";
"mine_unlock_more_services"="Unlock to access Premium services";
"mine_unlock"="Unlocked";
"mine_unlock"="Unlock";
"mine_userID"="User ID";
"mine_track"="My track";
"mine_emergenry_contacts"="Emergency contacts";
......
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