Comments (8)
Basically if appUserID is nil, it causes a crash as a method appends the appUserID to a base key. If it's nil, that crashes... so I just check for the presence of an appUserId to prevent the crash.
from purchases-ios.
Hey! We'll look into this right away.
What do you mean by "clearing NSUserDefaults"?
The SDK should work with a blanked out NSUserDefaults
.
from purchases-ios.
Hey thanks! Well we have a "Reset Settings" tool in our app that goes through NSUserDefaults and clears it out so I'm not really sure what caused that appUserId to become blank in the process. Maybe it stores that in NSUserDefaults, but the SDK state was still thinking it had one, I'm not sure exactly.
from purchases-ios.
Ok, so this crashed during the same session as when you cleared the defaults?
Restarting the app, everything worked ok yea? Just want to make sure we understand the severity of the issue.
We hadn't considered somebody deleting our cache keys from underneath us mid-session.
from purchases-ios.
Yes, once it was restarted it works fine. Understood, the "pulling the rug out from underneath you" part probably wasn't expected ;) But just adding a little check when appending the appUserId to make sure it isn't nil first would probably be easy defensive coding.
from purchases-ios.
@jkichline Sorry for the delay in responding. We're looking into moving out of NSUserDefaults and into another form of storage that's specific to the SDK so that we prevent this kind of collision in the future. We'll keep this issue open until we have a fix for this. Thanks for reporting!
from purchases-ios.
replied on #156, you should be able to pass in a different UserDefaults instance for RevenueCat to use and this issue shouldn't happen anymore.
from purchases-ios.
closing as a duplicate of #156
from purchases-ios.
Related Issues (20)
- /v1/receipts api returns status_code 529 HOT 7
- Paywall language changes on every app re-install HOT 6
- "can't find package" error. HOT 4
- Add support for the native macOS platform to the RevenueCat Paywalls HOT 2
- Way to test Promotions in-app purchases from Store HOT 1
- Unable to fetch offering on real device when using Storekit file HOT 5
- Weird state of checkTrialOrIntroDiscountEligibility HOT 6
- Bug: Writing Keys out of container HOT 7
- macOS App hanging for at least 2000 ms because of check for macOS app running on the main thread. HOT 2
- CustomerInfo needs subscriptions. HOT 6
- Subtle Paywall localization issue HOT 4
- Offerings returns available offerings, then doesn't use them HOT 3
- Template 4 As Paywall Footer Has Incorrect Size While Loading, And Never Resizes Afterwards HOT 7
- 'StoreProduct' is ambiguous for type lookup in the context when using RevenueCat with Superwall-iOS v.3.6.3 HOT 4
- "Sign in with Apple ID" modal dialog (with user already signed into App Store app) when calling `purchasePackage` HOT 10
- Should the func onChangeOf<V> be private? HOT 6
- `Xcode 16` / `iOS 18`: Thread 21: EXC_BAD_ACCESS (code=1, address=0xfffffffffffffff8) in ETagManager.Response.encode(to:) HOT 21
- Bug: Last opened is not what is supposed to be. HOT 3
- Request for Lightweight SDK for App Extension (Eg Widget) HOT 1
- [Proposal] XCFramework binary size HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from purchases-ios.