Ios unibillStoreKit.mm-未声明的标识符SKPaymentTransactionStateDeferred-unibill expert?

Ios unibillStoreKit.mm-未声明的标识符SKPaymentTransactionStateDeferred-unibill expert?,ios,xcode,identifier,deferred,Ios,Xcode,Identifier,Deferred,这是我第一次在ios游戏中使用unibill,当我尝试在设备上构建和运行我的应用程序时遇到了问题 我得到的信息是,在SKPaymentTransactionStateDeferred的案例中使用了未声明的idenifer:(我没有更改unibill插件源代码中的任何内容),所以我不确定该怎么办 我不能发布图像,所以我在下面发布代码。请在线关注XCODE问题 // The transaction status of the SKPaymentQueue is sent here. - (void)

这是我第一次在ios游戏中使用unibill,当我尝试在设备上构建和运行我的应用程序时遇到了问题

我得到的信息是,在SKPaymentTransactionStateDeferred的案例中使用了未声明的idenifer:(我没有更改unibill插件源代码中的任何内容),所以我不确定该怎么办

我不能发布图像,所以我在下面发布代码。请在线关注XCODE问题

// 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文件中调用的案例声明?或者我必须在哪里声明此标识符

如果你需要更具体的信息,请告诉我


注意:我只是一个初学者:)

您是否更改了部署目标

问题可能是由于您的部署目标指向8.0以下的iOS版本
SKPaymentTransactionStateDeferred
仅在iOS版本大于8的版本中可用。因此,如果您的部署目标设置为例如7.1,您将遇到此错误

要消除这个问题,您可以将部署目标更新为大于或等于8.0,或者重复使用另一个(旧)版本的库或插件

希望这有帮助