Hi endecotp, I'm the author of TPInAppReceipt. Unfortunately, I don't have access to the new arm macs yet and haven't tried to run ios app on macOS, but I'm 99.9% sure that it will work, like it works for Catalyst apps. I will be more than happy if you have a chance to try it out and prove my correctness.
Thank you,
P
Post
Replies
Boosts
Views
Activity
Hi endecotp, I truly appreciate your efforts in trying to figure out what should we do in this case and kudos for reporting it to developer technical support.
Personally, I thought we can do the same what we did for Catalyst apps, basically, switch to macOS implementation which is close to what you've described:
#elseif targetEnvironment(macCatalyst) || os(macOS)
var masterPort = mach_port_t()
var kernResult: kern_return_t = IOMasterPort(mach_port_t(MACH_PORT_NULL), &masterPort)
if (kernResult != KERN_SUCCESS)
{
assertionFailure("Failed to initialize master port")
}
let matchingDict = IOBSDNameMatching(masterPort, 0, "en0")
if (matchingDict == nil)
{
assertionFailure("Failed to retrieve guid")
}
var iterator = io_iterator_t()
kernResult = IOServiceGetMatchingServices(masterPort, matchingDict, &iterator)
if (kernResult != KERN_SUCCESS)
{
assertionFailure("Failed to retrieve guid")
}
var guidData: Data?
var service = IOIteratorNext(iterator)
var parentService = io_object_t()
defer
{
IOObjectRelease(iterator)
}
while(service != 0)
{
kernResult = IORegistryEntryGetParentEntry(service, kIOServicePlane, &parentService)
if (kernResult == KERN_SUCCESS)
{
guidData = IORegistryEntryCreateCFProperty(parentService, "IOMACAddress" as CFString, nil, 0).takeRetainedValue() as? Data
IOObjectRelease(parentService)
}
IOObjectRelease(service)
if guidData != nil {
break
}else{
service = IOIteratorNext(iterator)
}
}
if guidData == nil
{
assertionFailure("Failed to retrieve guid")
}
return guidData!
#endif
Anyway, I've created a ticket (https://github.com/tikhop/TPInAppReceipt/issues/73) — let's see maybe someone else knows how to deal with that.
Let me know if you have any questions or I can help somehow here. You can send me email if so (tikhop at gmail com)
Thank you.
Same here!