我現在有我的應用程序內購買「恢復」按鈕,在沒有「購買」提示的情況下恢復應用內購買?可能嗎?
它確實工作,但本質上它要求用戶中旬方式經由過程「買入」升級(就像它會對一個正常的應用程序內),我擔心這會
一)蘋果 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];
}
您好,感謝您的回答,我必須承認,我奮力把它的那一刻,它的令人沮喪的這樣一個小功能添加代碼! 那麼你會建議用你的代碼替換上面的代碼嗎?或者你可以幫助修改我的代碼? 親切的問候 Agnelli – Agnelli 2012-07-13 00:18:35
不幸的是,你將不得不用這裏給出的幫助來解決這個問題。你還期望學習SDK,以及如何正確地把事情放在一起並使它們工作?如果你**看不出來,請查看我的個人資料以獲得進一步的幫助。 – WrightsCS 2012-07-13 00:22:36