owncloud / ios-app

πŸ“±The all-new iOS app for ownCloud
https://owncloud.org/news/new-ios-app-ready-public-app-store/
GNU General Public License v3.0
213 stars 121 forks source link

[BUG] Purchased IAP in Shortcuts intents not detected #785

Closed hosy closed 4 years ago

hosy commented 4 years ago

When using the shortcuts extension and the Shortcuts IAP was bought, the extension returns, that the IAP was not bought.

Steps to reproduce

  1. Add a new Shortcut
  2. Add an ownCloud shortcut action from a non enterprise account
  3. Run the Shortcut (be sure, the IAP was bought on this device)

Expected behavior

Shortcut will be executed

Actual behavior

Shortcut extension returns an error, that the IAP was not bought

Client

iOS version: iOS 14

ownCloud app version: 11.4

hosy commented 4 years ago

@felix-schwarz attached you can find the log file after a reboot: ownCloud_25.08.2020__14_22_12.log.txt

felix-schwarz commented 4 years ago

@hosy Looks like OCLicenseAppStoreProvider can't access the App Store receipt. Here's the Intents appex log:

2020-08-25 14:24:34.026000+0200 ownCloud Intents[277:004485] [dbug] | [Licensing, AppStore, …] Loading receipt [… Start] [OCLicenseAppStoreProvider.m:235|FULL]
2020-08-25 14:24:34.026000+0200 ownCloud Intents[277:004485] [dbug] | [Licensing, AppStore, …] Loading App Store Receipt [… LoadReceipt] [OCLicenseAppStoreProvider.m:259|FULL]
2020-08-25 14:24:34.026000+0200 ownCloud Intents[277:004485] [dbug] | [Licensing, AppStore, …] App Store Receipt loaded: (null) [… LoadReceipt] [OCLicenseAppStoreProvider.m:273|FULL]

And here the same for the app:

2020-08-25 14:24:39.259000+0200 ownCloud[288.004736] [dbug] | [Licensing, AppStore, …] Loading receipt [… Start] [OCLicenseAppStoreProvider.m:235|FULL]
2020-08-25 14:24:39.259000+0200 ownCloud[288.004736] [dbug] | [Licensing, AppStore, …] Loading App Store Receipt [… LoadReceipt] [OCLicenseAppStoreProvider.m:259|FULL]
2020-08-25 14:24:39.266000+0200 ownCloud[288.004736] [dbug] | Loaded receipt from file:///private/var/mobile/Containers/Data/Application/55E1541E-8258-41AE-9B06-79302DBA8BE0/StoreKit/receipt [OCLicenseAppStoreReceipt.m:73|FULL]
2020-08-25 14:24:39.280000+0200 ownCloud[288.004736] [dbug] β”“ [Licensing, AppStore, …] App Store Receipt loaded: <OCLicenseAppStoreReceipt: 0x2802dc200, receiptData: {length = 5807, bytes = 0x308216ab 06092a86 4886f70d 010702a0 ... 47976f17 1d850cf9 }, creationDate: 2020-08-23 10:03:42 +0000, expirationDate: (null), appBundleIdentifier: com.owncloud.ios-app, appVersion: 169, originalAppVersion: 124, inAppPurchases: ( [… LoadReceipt] [OCLicenseAppStoreProvider.m:273|FULL]
2020-08-25 14:24:39.280000+0200 ownCloud[288.004736] [dbug] ┃ [Licensing, AppStore, …]     "<OCLicenseAppStoreReceiptInAppPurchase: 0x2833ff660, quantity: 1, productID: single.shortcuts, purchaseDate: 2020-02-14 10:36:52 +0000, originalPurchaseDate: 2020-02-14 10:36:52 +0000, cancellationDate: (null), subscriptionExpirationDate: (null), subscriptionInIntroOfferPeriod: (null), webOrderLineItemID: 0, transactionID: 180000673067795, originalTransactionID: 180000673067795>", [… LoadReceipt] [OCLicenseAppStoreProvider.m:273|FULL]
2020-08-25 14:24:39.280000+0200 ownCloud[288.004736] [dbug] ┃ [Licensing, AppStore, …]     "<OCLicenseAppStoreReceiptInAppPurchase: 0x2833ff600, quantity: 1, productID: single.documentmarkup, purchaseDate: 2020-02-14 10:37:15 +0000, originalPurchaseDate: 2020-02-14 10:37:15 +0000, cancellationDate: (null), subscriptionExpirationDate: (null), subscriptionInIntroOfferPeriod: (null), webOrderLineItemID: 0, transactionID: 180000673067973, originalTransactionID: 180000673067973>", [… LoadReceipt] [OCLicenseAppStoreProvider.m:273|FULL]
2020-08-25 14:24:39.280000+0200 ownCloud[288.004736] [dbug] ┃ [Licensing, AppStore, …]     "<OCLicenseAppStoreReceiptInAppPurchase: 0x2833ff5a0, quantity: 1, productID: single.documentscanner, purchaseDate: 2020-02-14 10:37:32 +0000, originalPurchaseDate: 2020-02-14 10:37:32 +0000, cancellationDate: (null), subscriptionExpirationDate: (null), subscriptionInIntroOfferPeriod: (null), webOrderLineItemID: 0, transactionID: 180000673068111, originalTransactionID: 180000673068111>" [… LoadReceipt] [OCLicenseAppStoreProvider.m:273|FULL]
2020-08-25 14:24:39.280000+0200 ownCloud[288.004736] [dbug] β”› [Licensing, AppStore, …] )> [… LoadReceipt] [OCLicenseAppStoreProvider.m:273|FULL]

The fix, then, will likely be to have the app copy its receipt to a location in the shared app container and have OCLicenseAppStoreProvider fall back to that copy if it doesn't find one under NSBundle.mainBundle.appStoreReceiptURL.

I'll take care of that in the 11.4.1 branch.

felix-schwarz commented 4 years ago

@hosy Now implemented in 5ac174678972ef329abd8b05c2175861b1003180.

michaelstingl commented 4 years ago

included in milestone/11.4.1 branch

jesmrec commented 4 years ago

I can not reproduce this one. These are the steps i do:

  1. Purchase shortcuts (sandbox user)
  2. Execute a single shortcut (create a new folder) over a non-enterprise account
  3. Check account -> folder is there

iPhoneX iOS14GM iOS oC app 11.4 43691f

Do i miss something? here you have the performance:

Sep-16-2020 18-15-11

Is it posible that the fix comes from a newest version of iOS14, apart of the one developed by @felix-schwarz ?

hosy commented 4 years ago

@jesmrec I think this can only be validated with the live App Store version. But @felix-schwarz figured out, that we had some problems before and fixed it with this code changes. My suggestion is, to move forward and QA with the App Store version.

jesmrec commented 4 years ago

Agreed, let's move forward.

hosy commented 4 years ago

I keep this issue open and should be checked again after the release.

hosy commented 4 years ago

@jesmrec you can give it a new try. For me it is working now again with the AppStore version.

jesmrec commented 4 years ago

yeah, it works!