0

我目前有我的应用内购买“恢复”按钮,

确实有效,但本质上它会在整个过程中要求用户“购买”升级(就像在普通的应用内一样)我担心这会

a) 被苹果拒绝 b) 吓唬用户以为他们再次付款

有什么办法可以改变它,所以它可能有不同的信息?

-(IBAction)restore:(id)sender
{=
    [[SKPaymentQueue defaultQueue]
     addTransactionObserver:self];
    [[SKPaymentQueue defaultQueue]
     restoreCompletedTransactions];

    UIAlertView *alert;

    alert = [[[UIAlertView alloc] initWithTitle:@"Restoring Your Purchases, Please Wait..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease];
    [alert show];

    UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];

    // Adjust the indicator so it is up a few pixels from the bottom of the alert
    indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 50);
    [indicator startAnimating];
    [alert addSubview:indicator];
    [indicator release];

    [alert dismissWithClickedButtonIndex:0 animated:YES];

    [[MKStoreManager sharedManager] buyFeature];=
}

-(void)productPurchased
{
    for (UIView *view in self.view.subviews)
    {
        if (view.tag==2000)
        {
            [view removeFromSuperview];
        }
    } 

    UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Thank you" message:@"Your restore was successful." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
    [alert show];
    [alert release];
}

// error restore
- (void)failed
{
    for (UIView *view in self.view.subviews)
    {
        if (view.tag==2000)
        {
            [view removeFromSuperview];
        }
    }

    UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error" message:@"Your restore has failed." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
    [alert show];
    [alert release];
}
4

2 回答 2

1

绝对有可能,事实上这是必要的。请参阅我对类似问题的回答

本质上,当您按下恢复按钮时,应该要求用户验证他们的帐户;这是由StoreKit. 如果为该帐户找到 IA 购买,则该过程应该开始以与他们第一次购买该项目相同的方式恢复购买,只是没有实际购买的提示。

于 2012-07-13T00:10:36.747 回答
0

我看到你正在使用 MKStoreKit。只需在您的应用程序中启用 iCloud,其余的由 MKStoreKit 处理。其他设备甚至无需打开商店页面即可将购买“视为”“已购买”。

PS:我写了 MKStoreKit

于 2012-07-15T16:10:48.560 回答