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,
For anyone reading this,
As for ways of working around this, it seems like the suggested approach is to move the SDK configuration to the initialization of the root VC.
I’d also advise to move related code (like reading from the keychain), for the same reason.
It was a pleasure chatting with you
I am thrilled to write this. Since relocating the initialization to the root view controller there was zero incident of nil customerInfo.
Please update the documentation to enforce this, otherwise apps will get in trouble for sure
I will close the issue in few days, just because the majority of Stocks Live users will upgrade this week.
I am closing the issue, never been so excited about a bug being crushed.
you guys rock.
We are running into this issue as well. Somehow we can’t form the json response correctly.
```
😿‼️ Unable to instantiate SubscriberData from json object: ["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]
```
This is awesome
I will report back after one week to gather more data.
🙏
Just got those from a user with the latest 4.0.0-beta.3
hope it give you any clue on what is happening.
the user reported that things are fine now after Restoring Purchases.
Ok, just released Beta 5 https://github.com/RevenueCat/purchases-ios/releases/tag/4.0.0-beta.5
I think this should really help us home in on what is going on.
I also like to add that sometimes I get purchaserInfoWithCompletion with RCPurchaserInfo=null and it shouldn’t.
Here is the error I got from the user above after installing Beta5.
RCCustomerInfo: (null)
RevenueCat LastError: Error Domain=RevenueCat.ErrorCode Code=12 "Unable to instantiate a CustomerInfoResponse." UserInfo={readable_error_code=UNEXPECTED_BACKEND_RESPONSE_ERROR, NSUnderlyingError=0x28168af30 {Error Domain=RevenueCat.UnexpectedBackendResponseSubErrorCode Code=7 "(null)"}, NSLocalizedDescription=Unable to instantiate a CustomerInfoResponse.}
The user came back and mentioned he didn’t change the user ID (he changed his user name). I confirmed that he has two devices, iPad and iPhone, both running iOS 15.1 and same version of the app, same Apple ID, on the iPhone, he can’t restore, he gets errors, on the iPad he can restore.
Latest error from user (F6862686180809447439), note that CustomerInfo is nil
App:CustomerInfo: (null)RevenueCat LastError: Error Domain=RevenueCat.ErrorCode Code=12 "Unable to instantiate a CustomerInfoResponse." UserInfo={readable_error_code=UNEXPECTED_BACKEND_RESPONSE_ERROR, NSUnderlyingError=0x283ee5d10 {Error Domain=RevenueCat.UnexpectedBackendResponseSubErrorCode Code=7 "(null)"}, NSLocalizedDescription=Unable to instantiate a CustomerInfoResponse.}
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!
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=[:],activeSubscriptions=[:],nonSubscriptionTransactions=[],requestDate=2021-11-04 16:47:10 +0000,firstSeen=2021-11-04 16:47:09 +0000,originalAppUserId=U1625795716907644928,entitlements=[:]>RevenueCat LastError: (null)
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?
@imougy update here: I found a few extensions where we’re not adding prefixes or necessarily disambiguating our extensions from others, which might cause conflicts.
I’m going to work on an update to remove all ambiguity, which might solve it.
Would you be willing to give it a shot when I’m done?
Also, have you found any way to consistently reproduce this? Perhaps by changing regions on your device?
And yes, having some information on the date extensions would be super helpful. Also, if you have any extensions on date formatters in particular, since those seemed to be the conflict with DataDog’s SDK.
fix/name_conflicts_on_foundation_extensions
, which adds a prefix to every single internal extension in our SDK, to make absolutely sure that no conflicts can happen.
If you have a way to reproduce this issue, would you mind giving the branch a shot to see if it solve it?
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 = subscriberData["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.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.