Hi
I can’t reproduce while in debug mode (randomly happens outside the debugger).
Attached is a txt file with a log of successful return (I see some errors but not sure how to cancel them).
Thanks,
Hi
I can’t reproduce while in debug mode (randomly happens outside the debugger).
Attached is a txt file with a log of successful return (I see some errors but not sure how to cancel them).
Thanks,
Took a little longer than expected, but here’s a new release: https://github.com/RevenueCat/purchases-ios/releases/tag/4.0.0-beta.6
We now add a lot more info to the error objects that get surfaced through the API.
Today, I open the app on my device and I got no in-app at all and here is my log (Restore purchases work):-
CustomerInfo: <CustomerInfo:originalApplicationVersion=,latestExpirationDate=nil,activeEntitlements=s:],activeSubscriptions=s:],nonSubscriptionTransactions=s],requestDate=2021-11-04 16:47:10 +0000,firstSeen=2021-11-04 16:47:09 +0000,originalAppUserId=U1625795716907644928,entitlements=s:]>RevenueCat LastError: (null)
Good luck!
Ooof, this new error is actually on Apple’s server. They do some weird stuff with errors that makes it difficult to fully understand what the problem is sometimes, but we have a thread open on it and are going to work on a workaround, you can follow along: https://github.com/RevenueCat/purchases-ios/issues/392#issuecomment-804996692
I was able to chase down the exact response that was sent when your customer encountered:
RevenueCat LastError: Error Domain=RevenueCat.ErrorCode Code=12 "Received malformed response from the backend." UserInfo={generated_by=<snip> getSubscriberData(appUserID:completion:), NSUnderlyingError=0x2823f5f50 {Error Domain=RevenueCat.UnexpectedBackendResponseSubErrorCode Code=8 "(null)" UserInfo={NSUnderlyingError=0x280c84c80 {Error Domain=RevenueCat.CustomerInfoError Code=1 "(null)"}
The json is ok and I can manually instantiate the objects with the exact response. I met with
“subscriberDataD"first_seen"]” is empty, or the date format is incorrect.
OR:
“subscriberDatai"original_app_user_id"]” is nil.
Both of these conditions were ok in the response!
So that leaves us with some questions: what other sdks do you current use? Do you have any of your own Date extensions that you’re using? The thought is that maybe you’re using an SDK that could:
1) swizzle some of the foundation date parsing stuff (we’ve seen it)
2) have the same named Date extension so runtime resolution of the extension is non-determinate.
We really appreciate you tracking this stuff down with us. At this point, I’ve added yet more error handling to a new pr, but I think something outside our control is going on since the exact json responses that are causing issues for you are not causing issues in my testing. If I could repro this, it would be so much easier
Meanwhile, another log from the same user who can’t restore his purchases.
I think that’s a solid plan. I”ll check into this log and get back to you with anything I find.
guard let firstSeenDateString = subscriberDatab"first_seen"] as? String,
let firstSeenDate = dateFormatter.date(fromString: firstSeenDateString) else {
return nil
}
self.firstSeen = firstSeenDate
guard let originalAppUserIdString = subscriberData>"original_app_user_id"] as? String else {
return nil
}
After you exit with nil, you call the logger. I can’t access the logger and pass it to you (If I can please let me know how I can ask users to do that) but the error object that I attached is the one I can pass to you. Is there a way you can add more info there so I can pass it to you? I debugged your code and of course I see everything fine.
Let me know how to proceed, my NSDate extension are not being called by your sdk.
I am guessing since this is a random thing, I saw empty CustomerInfo on my device from time to time, that this is not an SDK code that is causing it, it some garbage data coming from the server.
Happy to add any info if you think of any.
I just merged an update that will throw errors instead of returning `nil` in https://github.com/RevenueCat/purchases-ios/pull/937
I can’t release it to Beta just yet because we also just merged a large update that includes the beginning of StoreKit2 support and we need to test it a little bit more.
There is only 1 file to update if you wanted to build the SDK from the current beta tag with this.
We are running into this issue as well. Somehow we can’t form the json response correctly.
```
Unable to instantiate SubscriberData from json object: s"original_application_version": <null>, "non_subscriptions": { }, "first_seen": 2021-12-08T21:59:55Z, "original_purchase_date": <null>, "subscriptions": { }, "other_purchases": { }, "original_app_user_id": $RCAnonymousID:c8cab3a9cb4648d8828449e29194817d, "management_url": <null>, "entitlements": { }, "last_seen": 2021-12-08T21:59:55Z]
```
Adding two more log files with detailed errors.
Guys, this issue is frustrating to everyone. Is there a way you connect with Apple to see what is going on? I can connect with Apple as part of my development benefits but I don’t know how to follow up if they ask detailed questions (I didn’t write the code so I have no idea what is going on)!
It is still surprising to me that not all developers having the same issue, makes me wonder if there is a best practice I need to follow? I don’t mind sharing the code that is responsible for the integration, I know the code was working and started to break just recently but maybe this can help? If you are interested please let me know.
Again, thank you and Apple really suck!
We’ll definitely will want to take a look at a few things related to your project setup/dependencies/platform support/etc.
I am attaching a legitimate error I hope from one user, the user didn’t complain but I always get an attachment with the latest error and I thought to share it with you guys.
I am attaching a legitimate error I hope from one user, the user didn’t complain but I always get an attachment with the latest error and I thought to share it with you guys.
That’s perfect, I think
Is there a place in the latest sdk release that logs the json in full utf8? (We only are logging the swift dictionary object right now...)
The failure I have is at:
Can you also link a test project containing your deserialization test code?
After taking a look at our code, we noticed we are using the Datadog SDK, which has a similar extension on ISO8601Formatter signature as the RevenueCat SDK (both of them have the class conform to a protocol of the same name) (https://github.com/DataDog/dd-sdk-ios/blob/9cdb8fe7615949554e8a6af2ddbe2857050fed35/Sources/Datadog/Core/Utils/DateFormatting.swift)
Do you think this could cause any issues?
Oh wow! Yeah, maybe that could do it. We recently rewrote our iso8601DateFormatter to use the newer `ISO8601DateFormatter`, but haven’t released a beta with it include: https://github.com/RevenueCat/purchases-ios/blob/main/Purchases/FoundationExtensions/DateFormatter%2BExtensions.swift
We’re still finishing up the last bit of StoreKit2 additions and then we’ll release another Beta. Are you able to test out this theory building from `main`?
I didn’t even realize that change was not in beta-7! So ignore my previous post. Because it turns out the rewrite wasn’t the issue, it was actually a solution!
The original issue is resolved by using the recent change to use the `ISO8601DateFormatter`. https://github.com/RevenueCat/purchases-ios/issues/1096#issuecomment-997470529
It seems the original `iso8601dateformatter` code had subtle buggy issues for users with unconventional calendar or date/time settings for non-US locales. After we used a version of the SDK with the rewritten DateFormatter, our issues were resolved for our users.
Anyway, I am eagerly awaiting any fix to test.
https://github.com/RevenueCat/purchases-ios/releases/tag/4.0.0-beta.8
If you’re using SPM, you should be good to go now Thank you
I installed Beta.8 and played with it on my device. After many launches on my device, I get an instance where customerInfo has no entitlements and no error (I do have some entitlements). After the app quit and relaunch, the entitlements came fine. I am releasing the app anyway, pending Apple approval now.
One of the users told me that Restore Purchases didn’t work for him, attached is his error, I told him to change to region to USA, his region was some where in Netherland, after he changed the region, the Restore worked fine.
Will keep you updated...
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.