j3k0 / cordova-plugin-purchase

In-App Purchase for Cordova on iOS, Android and Windows
https://purchase.cordova.fovea.cc
1.29k stars 529 forks source link

[iOS] [iPad] Error 6777010: Connection fail to iTunes Store #892

Closed sharpMouse closed 4 years ago

sharpMouse commented 4 years ago

How to reproduce:

  1. Get subscriptions info via refresh().
  2. Call order().

image

  1. Enter App ID and password.
  2. Get the error.

image This problem happens on iPad, but everything works ok on iPhone! (and ok in Android) What is wrong?

I have googled and found the link https://stackoverflow.com/questions/7402801/cannot-connect-to-itunes-store-in-app-purchases. The second-to-last answer says about the problem, but I failed to convince Apple in it. Apple's testing team declined my program even in TestFlight, saying "if it works on iPhone only, we can allow it on iPhone only". But the app is indented for tablets only.

May be you already met this error and solved it?

My system: iOS 12.3.1 Device: iPhone 5s PhoneGap Version: cli-8.0.0 Plugin Version: phonegap-cli-8.0.0

aesculus commented 4 years ago

Not sure if this is helpful or not but I just had a user report to me that he could not make purchases via iTunes either unless he disabled his VPN. Looking at my error logs I see that he was getting both 6777006 and 6777010 errors (Cannot connect to iTunes Store) for my subscription IAP.

I am in the process of trying to do some more debugging but I thought I would throw this out there in the meantime.

modemlooper commented 4 years ago

I am having this problem now, created new sandboxed accounts, deleted apps, reset the entire iPad and getting 6777010 error cannot connect to itunes.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

7creo commented 4 years ago

@aesculus have you been able to fix this? Apple just reviewd my app, the app also displayed "error code 6777010 can not connect to itunes store", and the APPLE tester had VPN on.

aesculus commented 4 years ago

I have not submitted a new version to Apple for 2 months so I could be in the same situation.

Last version I submitted was using version="9.0.0"

scottopolis commented 3 years ago

I am seeing the same issue, apps are being rejected because test purchases fail due to the "Cannot connect to iTunes Store" only on iPad, but are successful on iPhone.

I've found that if I restart the app on the iPad, the purchase works. Unfortunately this doesn't help because reviewers do not restart the app during review, and customers will not know to do that.

Any ideas on why this would only happen on the first app startup?

Here is the message from app store review:

Guideline 2.1 - Performance - App Completeness

We found that your in-app purchase products exhibited one or more bugs when reviewed on iPad running iOS 13.5.1 on Wi-Fi.

Specifically, when we attempted to purchase the app displayed an error message.

Next Steps

When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple's test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead.

aesculus commented 3 years ago

Which version of the plugin are you using? Also I assume you have a back ended validation system that handles both production and sandbox?

BTW I had a revision of my app approved twice in the last month. I am using 9.0.1 of the plugin.

scottopolis commented 3 years ago

@aesculus I am using 10.1.1, I use the fovea validator as the backend.

aesculus commented 3 years ago

OK. I would suspect the validator is OK then. Not sure about what the differences could be in the versions as I decided not to move that way yet since I did not need the advanced features and I was seeing lots of issues reported by others.

j3k0 commented 3 years ago

When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple's test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead.

Fovea's receipt validator implements this (and all best practices recommended by Apple), this isn't the issue.

However, notice that Apple's receipt validation API did experience slowdowns last week. On July 21th and (to a smaller measure) on July 24th. It might have been what prevented the purchase?

Screen Shot 2020-07-27 at 11 02 09

Not sure why this would have been specific to the iPad though. Have you been able to reproduce the issue?

scottopolis commented 3 years ago

@j3k0 yes I have reproduced the issue more than once locally using Xcode and my iPad. I have confirmed that it only affects the iPad, so I don't think it could be a network issue.

j3k0 commented 3 years ago

I'd be helpful if you can share some logs of a session with this issue with store.verbosity set to store.DEBUG. I know that apps are being released with the latest version of the plugin and don't have this issue.

Random ideas:

doug1e commented 3 years ago

Hi @scottopolis

I'd be grateful if you could share your solution if you found one. I am struggling with the same issue as my latest app just got rejected. I use the same in-app code for other apps so I know the code is working but it did not work for this one, potentially due to one of the reasons j3k0 mentioned.

Thanks,

Doug

canadaka commented 3 years ago

We recently launched a subscription option in our app and we are seeing about 10% of our iOS users are logging this Error 6777010. We have had over 70,000 transactions, so 10% is a fairly high rate to be having this issue.

Plugin: 10.3.0 Cordova: 10.0.0

j3k0 commented 3 years ago

@canadaka Sounds pretty high. Does 10% means that you had "70,000" transactions and "7,000" "Cannot connect to iTunes" errors ?

Note that the 6777010 error can also happens just when a user starts the app (without intending any purchases), only when the plugin attempts to load the product information. After store.update() (when loading the the product information might eventually load.

mifkys commented 3 years ago

Same problem when reviewer on iPad with Wi-Fi and VPN rejecting my app because of 6777002/6777010 error codes. in-app purchase code not edited for years and now with last build on 14.2 app start rejecting

j3k0 commented 3 years ago

Other people had the issue. It was only solved by contacting apple technical support, in both cases I'm aware of it was an issue on their end.

There's this quite old thread: https://developer.apple.com/forums/thread/6401

Specifically, the support person from Apple recommended this:

...the best course of action should be to first ask App Review to review the app once more and specifically request that the reviewer restart the device before doing a second review. If the app is reviewed a second time, the app should pass the SKProductsRequest. However, in some cases, an App Reviewer may still find that the problem persists, which is where DTS can be an advocate for the developer on this issue. In many cases, I've been able to secure a re-credit to the incident, but I'm not going to guarantee that this is going to happen. All DTS incidents are handled on a case by case basis.

rich kubota - rkubota@apple.com developer technical support CoreOS/Hardware/MFI

HarelM commented 3 years ago

Hi,

I'm experiencing this error as well, but on iPhone and not iPad Two users had reported a similar issue: They purchase a subscription on one device and when they try to use the payed subscription on their other device they receive this error. In both cases they purchased the subscription on the iPad and tried to use it on the iPhone. The following is the relevant log from the device that failed. When they click the purchase button the appstore presents a message saying that the subscription is valid and they can "manage" or click "OK", in both cased it doesn't get to product ordered state. I can open a separate issue if this is not exactly the case here. If anyone had encountered it and know of a way to solve this please let me know: Code can be found here, nothing fancy, pretty straight forward. https://github.com/IsraelHikingMap/Site/blob/4506f1fb90affdf2333cc202545a10f9134b45c2/IsraelHiking.Web/sources/application/services/purchase.service.ts#L28 Let me know if you want me to open another issue. I'm using version 10.3.0 I'll update to 10.5.0 release just in case...

2020-12-25 08:11:42 | DEBUG | [Store] state: offline_map -> registered
2020-12-25 08:20:38 |  INFO | [Store] logged in: <user id>
2020-12-25 08:20:38 | DEBUG | [Store] store.trigger -> triggering action refreshed
2020-12-25 08:20:38 | DEBUG | [Store] ios -> initializing storekit
2020-12-25 08:20:38 |  INFO | [Store] ios -> storekit ready
2020-12-25 08:20:39 | DEBUG | [Store] ios -> products loaded
2020-12-25 08:20:39 | DEBUG | [Store] ios -> product offline_map is valid (offline map)
2020-12-25 08:20:39 | DEBUG | [Store] update()
2020-12-25 08:20:39 | DEBUG | [Store] state: il.org.osm.israelhiking -> 
2020-12-25 08:20:39 | DEBUG | [Store] state: il.org.osm.israelhiking -> registered
2020-12-25 08:20:39 | DEBUG | [Store] Approved, verifing: il.org.osm.israelhiking
2020-12-25 08:20:40 | DEBUG | [Store] state: il.org.osm.israelhiking -> approved
2020-12-25 08:20:40 | DEBUG | [Store] Approved, verifing: il.org.osm.israelhiking
2020-12-25 08:20:40 | DEBUG | [Store] scheduleValidation()
2020-12-25 08:20:40 | DEBUG | [Store] scheduleValidation()
2020-12-25 08:20:40 | DEBUG | [Store] scheduleValidation()
2020-12-25 08:20:41 | DEBUG | [Store] scheduleValidation()
2020-12-25 08:20:42 | DEBUG | [Store] runValidation()
2020-12-25 08:20:42 | DEBUG | [Store] ajax -> send request to https://validator.fovea.cc/v1/validate?appName=il.org.osm.israelhiking&apiKey=<key>
2020-12-25 08:20:44 | DEBUG | [Store] validator success, response: {"ok":true,"data":{"id":"il.org.osm.israelhiking","ineligible_for_intro_price":[],"latest_receipt":true,"...
2020-12-25 08:20:44 | DEBUG | [Store] verify -> {"success":true,"data":{"id":"il.org.osm.israelhiking","ineligible_for_intro_price":[],"latest_receipt":true,...
2020-12-25 08:20:44 | DEBUG | [Store] transaction fields for il.org.osm.israelhiking
2020-12-25 08:20:44 | DEBUG | [Store] verify -> success: {"id":"il.org.osm.israelhiking","ineligible_for_intro_price":[],"latest_receipt":true,"transaction":...
2020-12-25 08:20:44 | DEBUG | [Store] syncWithAppStoreReceipt
2020-12-25 08:20:44 | DEBUG | [Store] {"type":"ios-appstore",...
2020-12-25 08:20:44 | DEBUG | [Store] transaction fields for offline_map
2020-12-25 08:20:44 | DEBUG | [Store] expiryDate: 2021-12-24T18:01:49.000Z
2020-12-25 08:20:44 | DEBUG | [Store] Verified, Finishing: il.org.osm.israelhiking
2020-12-25 08:20:44 | DEBUG | [Store] product -> defer finishing il.org.osm.israelhiking
2020-12-25 08:20:44 | DEBUG | [Store] verify -> offline_map ineligibleForIntroPrice:false
2020-12-25 08:20:44 | DEBUG | [Store] verify -> success: {"id":"il.org.osm.israelhiking","ineligible_for_intro_price":[],"latest_receipt":true,...
2020-12-25 08:20:44 | DEBUG | [Store] verify -> il.org.osm.israelhiking ineligibleForIntroPrice:false
2020-12-25 08:20:44 | DEBUG | [Store] product -> defer finishing il.org.osm.israelhiking
2020-12-25 08:20:44 | DEBUG | [Store] Verified, Finishing: il.org.osm.israelhiking
2020-12-25 08:20:44 | DEBUG | [Store] state: il.org.osm.israelhiking -> finished
2020-12-25 08:20:44 | DEBUG | [Store] state: il.org.osm.israelhiking -> finished
2020-12-25 08:20:44 | DEBUG | [Store] ios -> finishing il.org.osm.israelhiking (a application)
2020-12-25 08:20:44 | DEBUG | [Store] product -> finishing il.org.osm.israelhiking
2020-12-25 08:20:57 | DEBUG | [Store] Ordering product
2020-12-25 08:20:57 | DEBUG | [Store] state: offline_map -> requested
2020-12-25 08:20:57 | DEBUG | [Store] ios -> is purchasing offline_map
2020-12-25 08:20:57 | DEBUG | [Store] state: offline_map -> initiated
2020-12-25 08:20:59 | DEBUG | Resigning app
2020-12-25 08:21:01 | ERROR | [Store] ios -> ERROR 6777010: ארעה שגיאה לא ידועה - {"productId":"offline_map"}
2020-12-25 08:21:01 | DEBUG | [Store] state: offline_map -> valid
2020-12-25 08:21:01 | ERROR | [Store] error handler: ארעה שגיאה לא ידועה (6777010)
2020-12-25 08:21:01 | DEBUG | [Store] store.trigger -> triggering action refresh-finished
2020-12-25 08:21:07 | DEBUG | [Store] Ordering product
2020-12-25 08:21:07 | DEBUG | [Store] state: offline_map -> requested
2020-12-25 08:21:07 | DEBUG | [Store] ios -> is purchasing offline_map
2020-12-25 08:21:07 | DEBUG | [Store] state: offline_map -> initiated
2020-12-25 08:21:09 | DEBUG | Resigning app
2020-12-25 08:21:11 | ERROR | [Store] ios -> ERROR 6777010: ארעה שגיאה לא ידועה - {"productId":"offline_map"}
2020-12-25 08:21:11 | DEBUG | [Store] state: offline_map -> valid
2020-12-25 08:21:11 | ERROR | [Store] error handler: ארעה שגיאה לא ידועה (6777010)

The Hebrew text is translated to "Unknown error happened".

orjandh commented 3 years ago

Just chiming in to say I am also facing the same issue. Any solutions are much appreciated.

HarelM commented 3 years ago

I think that upgrading to latest version (10.5) solved this for me, not sure though...

orjandh commented 3 years ago

Thanks for the suggestion. I am glad you managed to solve the issue this way, but I am running the latest version from github.

The IAP items works for me on testflight and in sandbox. But when the reviewer runs the app, it doesn't manage to fetch the IAP items.

j3k0 commented 3 years ago

@orjandh I saw this happen at least three time (on different apps), where issue only happened with the reviewer. A message to Apple tech support (here: https://developer.apple.com/support/technical/) eventually "fixed" the issue... Apparently something on their side.

orjandh commented 3 years ago

Thank you, I will try that and hope for the best. :)

AEiosApp commented 2 years ago

getting same issue - everything works fine on my iPhone, but failed on Apple review iPad. Any updates? Any suggestions (except ticketing apple TSI)?

j3k0 commented 2 years ago

@AEiosApp Every occurrences I know of were fixed by ticketing Apple, without any change to the app (and without information from them on why the problem occurred: just a short answer from support like "We've been able to test in-app purchase successfully, I'll inform reviewer that your in-app purchase integration is correct").