Skip to content

Complete rewrite of the module targeting iOS 17+ and Titanium SDK 13+.#49

Open
deckameron wants to merge 2 commits into
tidev:masterfrom
deckameron:master
Open

Complete rewrite of the module targeting iOS 17+ and Titanium SDK 13+.#49
deckameron wants to merge 2 commits into
tidev:masterfrom
deckameron:master

Conversation

@deckameron

Copy link
Copy Markdown

v6.0.0 — iOS 17+ rebuild with App Store Server API support

What changed

Removed (deprecated by Apple):

  • validateReceipt() and verifyReceipt() — on-device OpenSSL validation
  • bundleVersion, bundleIdentifier, receiptVerificationSandbox properties
  • restoreCompletedTransactionsWithApplicationUsername() — merged into restoreCompletedTransactions({ username })
  • VerifyStoreReceipt / OpenSSL dependency

Added:

  • originalTransactionId on the transactionState event — stable across all renewals, use this for App Store Server API validation
  • receiptBase64 property — Base64 receipt string without the TiBlob dance
  • validateReceiptWithServer() — server-side validation via Apple's /verifyReceipt (kept for compatibility, deprecated by Apple)
  • showManageSubscriptions() — system subscription sheet (iOS 15+)
  • getSubscriptionStatus() — current subscription state via SK1 queue (iOS 15+)
  • showCloudSetupDialog() — cloud service setup (e.g. Apple Music)
  • requestReviewDialog() — updated to scene-based requestReviewInScene: (iOS 14+)
  • errorCode and retryable on TRANSACTION_STATE_FAILED
  • SUBSCRIPTION_STATE_* constants
  • SKDownload APIs kept with deprecation warnings (Apple deprecated iOS 16)

Examples:

  • example/app.js — complete purchase flow with intent flag, debounce, local cache
  • example/subscription.py — Flask backend for App Store Server API validation

Testing

Tested on a real iPhone 17 Pro Max (iOS 26) with Sandbox tester account:

  • New purchase → server validation → access granted
  • App restart → cache hit → instant response
  • Auto-renewal → handled silently in background
  • Subscription expired → access revoked correctly
  • Reinstall → originalTransactionId recovered
  • Restore purchases → server validation → access granted
  • Transient Apple errors → automatic retry, no false error shown

@m1ga

m1ga commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Hi @deckameron just wanted to update and old app (ti.storekit 3) to this module and when I build it I see this error:

[TRACE] ld: arm64 slice extends beyond end of file in '/Users/miga/Documents/titanium/app/build/iphone/build/Products/Debug-iphonesimulator/libti.storekit.a'
[TRACE] clang++: error: linker command failed with exit code 1 (use -v to see invocation)

do you know what this could be?

@deckameron

Copy link
Copy Markdown
Author

Hi @m1ga! I will investigate it and let you know asap.

@deckameron

deckameron commented Jul 6, 2026

Copy link
Copy Markdown
Author

@m1ga

  • What is your Ti SDK version?
  • What Xcode version are you using?
  • Is your Mac Intel or Apple Silicon?

Thanks!

@m1ga

m1ga commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

I've tested it with Ti 13.3.0, Xcode 26.3 and it's an Apple Silicon Macbook Air with macOS 26.5.1

@m1ga

m1ga commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

I think it's the release file that is broken:

lipo -info modules/iphone/ti.storekit/6.0.0/ti.storekit.xcframework/ios-arm64_x86_64-simulator/libti.storekit.a returns:

fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: truncated or malformed fat file (offset plus size of cputype (16777228) cpusubtype (0) extends past the end of the file) modules/iphone/ti.storekit/6.0.0/ti.storekit.xcframework/ios-arm64_x86_64-simulator/libti.storekit.a

@deckameron

deckameron commented Jul 6, 2026

Copy link
Copy Markdown
Author

I think it's the release file that is broken:

lipo -info modules/iphone/ti.storekit/6.0.0/ti.storekit.xcframework/ios-arm64_x86_64-simulator/libti.storekit.a returns:

fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: truncated or malformed fat file (offset plus size of cputype (16777228) cpusubtype (0) extends past the end of the file) modules/iphone/ti.storekit/6.0.0/ti.storekit.xcframework/ios-arm64_x86_64-simulator/libti.storekit.a

This is very strange!
I have downloaded the module 6.0.0 and tested both libti.storekit.a files and it did not show any error.

douglas@MacBook-Pro ios-arm64_x86_64-simulator % lipo -info libti.storekit.a
Architectures in the fat file: libti.storekit.a are: x86_64 arm64 
douglas@MacBook-Pro ios-arm64_x86_64-simulator % ls -lh libti.storekit.a    
-rw-r--r--  1 douglas  staff   282K Mar 20 19:57 libti.storekit.a

douglas@MacBook-Pro ios-arm64 % ls -lh libti.storekit.a    
-rw-r--r--  1 douglas  staff   149K Mar 20 19:57 libti.storekit.a
douglas@MacBook-Pro ios-arm64 % lipo -info libti.storekit.a
Non-fat file: libti.storekit.a is architecture: arm64

Could you please try downloading the module again and run the com lipo -info command on both .

lipo -info modules/iphone/ti.storekit/6.0.0/ti.storekit.xcframework/ios-arm64_x86_64-simulator/libti.storekit.a
ls -lh modules/iphone/ti.storekit/6.0.0/ti.storekit.xcframework/ios-arm64_x86_64-simulator/libti.storekit.a
lipo -info modules/iphone/ti.storekit/6.0.0/ti.storekit.xcframework/ios-arm64/libti.storekit.a
ls -lh modules/iphone/ti.storekit/6.0.0/ti.storekit.xcframework/ios-arm64/libti.storekit.a

@m1ga

m1ga commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

ok, looks like my previous download was broken 🤷 I've cleared the module folder, downloaded the file again and it's building now.

Sorry for the false alarm!

@m1ga m1ga mentioned this pull request Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants