2015-01-20 8 views
2

처음으로 내 ios 게임에 unibill을 사용하고 기기에 앱을 빌드하고 실행하려고 할 때 문제가 발생합니다.unibillStoreKit.mm - 선언되지 않은 식별자 SKPaymentTransactionStateDeferred - unibill 전문가입니까?

SKPaymentTransactionStateDeferred에 대한 선언되지 않은 idenifier가 사용되었다는 메시지가 나타납니다. (unibill 플러그인 소스 코드에서 아무 것도 변경하지 않았습니다.) 그래서 무엇을해야할지 모르겠습니다.

이미지를 게시 할 수 없으므로 아래 코드를 게시하십시오. Pls는 XCODE ISSUE 줄을 봅니다.

// The transaction status of the SKPaymentQueue is sent here. 
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray*)transactions { 
    NSLog(@"Unibill: updatedTransactions"); 
    for(SKPaymentTransaction *transaction in transactions) { 
     switch (transaction.transactionState) { 

      case SKPaymentTransactionStatePurchasing: 
       // Item is still in the process of being purchased 
       break; 

      case SKPaymentTransactionStatePurchased: 
      case SKPaymentTransactionStateRestored: { 
       // Item was successfully purchased or restored. 
       NSMutableDictionary* dic; 
       dic = [[NSMutableDictionary alloc] init]; 
       [dic setObject:transaction.payment.productIdentifier forKey:@"productId"]; 

       [dic setObject:[self selectReceipt:transaction] forKey:@"receipt"]; 

       NSData* data; 
       data = [NSJSONSerialization dataWithJSONObject:dic options:0 error:nil]; 
       NSString* result; 
       result = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; 

       UnitySendMessage(UNITY_GAMEOBJECT_NAME, "onProductPurchaseSuccess", result.UTF8String); 
#if !__has_feature(objc_arc) 
       [result release]; 
       [dic release]; 
#endif 

       // After customer has successfully received purchased content, 
       // remove the finished transaction from the payment queue. 
       [[SKPaymentQueue defaultQueue] finishTransaction: transaction]; 
       break; 
      } 

      case SKPaymentTransactionStateDeferred: 
**//XCODE ISSUE: USE OF UNDECLARED IDENTIFIER "SKPaymentTransactionStateDeferred"** 
       NSLog(@"Unibill: purchaseDeferred"); 
       UnitySendMessage(UNITY_GAMEOBJECT_NAME, "onProductPurchaseDeferred", transaction.payment.productIdentifier.UTF8String); 
       break; 
      case SKPaymentTransactionStateFailed: 
       // Purchase was either cancelled by user or an error occurred. 

       NSString* errorCode = [NSString stringWithFormat:@"%d",transaction.error.code]; 
       if (transaction.error.code != SKErrorPaymentCancelled) { 
        NSLog(@"Unibill: purchaseFailed: %@", errorCode); 
        UnitySendMessage(UNITY_GAMEOBJECT_NAME, "onProductPurchaseFailed", transaction.payment.productIdentifier.UTF8String); 
       } else { 
        NSLog(@"Unibill: purchaseFailed: %@", errorCode); 
        UnitySendMessage(UNITY_GAMEOBJECT_NAME, "onProductPurchaseCancelled", transaction.payment.productIdentifier.UTF8String); 
       } 

       // Finished transactions should be removed from the payment queue. 
       [[SKPaymentQueue defaultQueue] finishTransaction: transaction]; 
       break; 
     } 
    } 
} 

누군가 내가해야 할 일을 알고 있습니까? 또 다른 질문 : unibillstorekit.mm 파일에서 호출 된 사례의 선언은 어디에서 찾을 수 있습니까? 아니면이 식별자를 어디에 선언해야합니까?

자세한 정보가 필요한 경우 알려주십시오.

참고 : IAM은 초보자 :

답변

1

당신은 배포 대상을 변경 했습니까?

배포 대상이 8.0 이하의 iOS 버전을 가리키고 있기 때문에 문제가 발생할 수 있습니다. SKPaymentTransactionStateDeferred은 iOS 버전이 8 이상인 경우에만 사용할 수 있습니다. 따라서 배포 타겟이 예 : 7.1이 오류가 발생합니다.

은 단지 8.0보다 크거나 동일하게 배포 대상을 업데이트하거나 라이브러리 또는 플러그인의 또 다른 (이상) 버전이 도움이 총 36

희망을 사용할 수 있습니다이 제거합니다.