我目前有我的应用内购买“恢复”按钮,
它确实有效,但本质上它会在整个过程中要求用户“购买”升级(就像在普通的应用内一样)我担心这会
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];
}