收据确认无

时间:2016-07-29 14:04:39

标签: ios objective-c in-app-purchase

这里使用收据验证方法,但它不返回值。它返回nil

NSData *ios7ReceiptData = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
        /
NSString * receiptStr = [ios7ReceiptData base64EncodedStringWithOptions: NSDataBase64Encoding64CharacterLineLength];



NSDictionary *receiptDict       = [self dictionaryFromPlistData:ios7ReceiptData];


- (NSDictionary *)dictionaryFromPlistData:(NSData *)data
{


    NSError *error;
    NSDictionary *dictionaryParsed = [NSPropertyListSerialization propertyListWithData:data
                                                                               options:NSPropertyListImmutable
                                                                                format:nil
                                                                                 error:&error];


    if (!responseDict)
    {
        if (error)
        {
            /
        }
        return nil;
    }
    return responseDict;

}

但它会将receiptDict作为nil返回。有人帮助我。 如何解决这个问题?

感谢提前

0 个答案:

没有答案