My response is based on the assumption that the app is using StoreKit 1 API's. The appStoreReceipt will be for whatever user action most recently caused the appStoreReceipt to be updated. In this case, when User A made the subscription purchase, the successful transaction will result in the appStoreReceipt to be updated to reflect the successful transaction by User A. When User B logs into the app no action taken by the StoreKit to update the appStoreReceipt. When User B changes the device's App Store ID to match User B's ID, here again, no action is taken by StoreKit to updated the appStoreReceipt. If the appStoreReceipt is validated, it will provide the transaction information about User A.
The appStoreReceipt is updated whenever the following occurs. There is a successful purchase transaction. The restoreCompletedTransactions successfully restores finished transactions. The SKReceiptRefreshRequest is used to refresh the receipt. With StoreKit 1, the app is responsible for managing transactions for a multi-user application.
With StoreKit 2, when a purchase attempt is made, the app can associate a application specific identifier with the purchase - for example an identifier associated with the current user. Later, after the transaction is successful, access to information about the transaction will include the app specific identifier. Keep in mind StoreKit 2 requires the presence of iOS 15.
rich kubota
developer technical support CoreOS/Hardware/MFI