Thanks for the hint. I am using QT in my app, and before I did:
QJsonParseError jsonErr;
QByteArray contents = file.readAll();
auto doc = QJsonDocument::fromJson(contents, &jsonErr);
Now after your hint I was able to do this, which seems to be working:
QJsonParseError jsonErr;
QByteArray contents = file.readAll();
QString utf32String = QString::fromUcs4((const uint*)contents.data());
auto doc = QJsonDocument::fromJson(utf32String.toUtf8(), &jsonErr);
It still won't parse, because the JSON actually contains a trailing comma, which the Wallet app seems to ignore, but QJsonDocument not. What a pity, but thats another story. However the data seems to be readable now, when I dump the utf32String, I'll get:
There is still some weird characters at the end, not sure what they are.
(I had to add this as screenshot, because it would not add a reply here with those invalid characters)
Is there any way I can detect that this is UTF-32 instead of UTF-8, other than the normal parsing failing & trying to parse again?
Post
Replies
Boosts
Views
Activity
You test on device, not simulator ?
Could you show the url ?
I am testing it on my iPhone 11 Pro connected to the MacBook via cable, and compiling/running the app directly on device via XCode.
This is what the URL looks like:
(lldb) p receiptURL
(NSURL *) $0 = 0x0000000280179f80 @"file:///private/var/mobile/Containers/Data/Application/577AA8C8-8D2F-4CEF-958E-32BD27CEB8BF/StoreKit/sandboxReceipt"
(lldb) p receipt
(NSData *) $1 = nil
To me this looks like that the app - since it was installed on the device by XCode - was not installed by the app store, and thus it cannot get any receipt information. That in turn would raise the question how I would be able to test my implementation when I cannot debug it?
Hello? :)