简体   繁体   中英

Trying to use the new Receipt Validation Programming of iOS and stopping at step 1

I am trying to switch from using the transactionReceipt to the receipt returned from the appStoreReceiptURL as in the Apple's: Receipt Validation Programming Guide

Yet I am stuck at compiling the output of the asn1c command. Apart from the host of angled references to header files I had to switch individually to quotes, there are a number of errors connected to features evidently not available on iOS. They seem to be connected to the finite() function and the DEBUG command. Here are two examples:

if(!finite(d)) { //solved with isfinite()

and

/* Debug output function */
static inline void
DEBUG(const char *fmt, ...) {
    va_list ap;
    if(!opt_debug) return;
    fprintf(stderr, "AD: ");
    va_start(ap, fmt);
    vfprintf(stderr, fmt, ap);
    va_end(ap);
    fprintf(stderr, "\n");
 }

What should I substitute them with?

Ok, I managed the whole: the procedure encompassed:

1) changing most '<..>'includes to '"..."' (the compiler gives hints) 2) changing the name of function DEBUG to debug, what prompted "something" to turn it to:

void ASN_DEBUG_f(const char *fmt, ...);
void ASN_DEBUG_f(const char *fmt, ...) {
    va_list ap;
    va_start(ap, fmt);
    vfprintf(stderr, fmt, ap);
    fprintf(stderr, "\n");
    va_end(ap);
}

3) And finally remove the sample.c file containing another main function, and two README files.

Done those the program compiles without problems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM