Comments (6)
Please disregard, this is happening because I'm using flutter's shared_preferences
plugin, which converts Set to List when you read from it. By default that plugin uses its own shared prefs xml but I forked it to read default shared prefs so that's why it interferes with RevenueCat.
from purchases-flutter.
Hi @diegocom I'm running a fork of shared_preferences
plugin so that I can read default Android prefs.
This migration of Set to List in getAllPrefs
method will cause the crash on next launch so I simply ignore this migration when prefix length 0 (e.g. I'm trying to read all prefs, not just Flutter ones).
You can check my commit here:
nuzelac/plugins@ae51d83
from purchases-flutter.
@nuzelac Great, it works! You saved my day
from purchases-flutter.
@nuzelac Hi, I have the same problem. I need to read the Android default shared preferences and not the flutter ones, but after reading them the app will crash on subsequent launches. How did you solve?
from purchases-flutter.
Is there anything we can do on our side to prevent this from happening for future developers? I am not sure I completely understand what's going on 😆 @nuzelac @diegocom
from purchases-flutter.
@vegaro Hah, it's a very specific issue, I had to look through my old commits to see how I fixed this. 😀
The thing is, Flutter's shared_preferences
plugin doesn't allow you to read any arbitrary prefs from Android, it adds a Flutter specific prefix by default and will only read prefs with the prefix. I think it will also use separate XML, but not certain about that.
I had a Xamarin app that used prefs and wanted to read these back when I migrated my app to Flutter.
If you hack around it (to make this prefix optional) you can read anything but the getter has some internal logic that converts Set to List serialized into String. This will touch RC prefs data and crash your SDK on launch next time.
Honestly, I wouldn't expect you to handle this case gracefully since it's not usual behavior 🤔
from purchases-flutter.
Related Issues (20)
- CustomerInfo listener fires with stale data HOT 3
- presentPaywallIfNeeded isn't defined. Using 6.3.0-beta.1 HOT 10
- Crash on SDK for the iOS app - PurchasesHybridCommon HOT 4
- Sample app does not call Purchases.removeCustomerInfoUpdateListener HOT 2
- The await for CustomerInfo customerInfo = await Purchases.purchasePackage(myProductList[index]); never completed; MagicWeather example, v.6.3.0 HOT 5
- Offerings not found or Null HOT 13
- Expand with linux, windows and more HOT 2
- Product Localization Problem For AppStore HOT 2
- presentPaywallIfNeeded always return Null HOT 6
- iOS simulator checkoutl HOT 9
- Dismissing iOS payment sheet throws uncatchable error HOT 3
- App rejected because no prices available in the TestFlight version but available in the AppStore version HOT 7
- Do you have example code for new paywall system? HOT 2
- Fatal Crash when using Flutter 6.3.0-beta.2 Paywall HOT 8
- What is public_ios_sdk_key ? HOT 4
- productPlanIdentifier parameter missing from EntitlementInfo HOT 2
- logOut() throws "user is anonymous" error even if I check Purchases.isAnonymous first HOT 5
- CustomerInfo == / hashCode aren't working HOT 3
- late initialization crashes the app HOT 3
- RevenueCatUi.framework is 4 MB in my executable for iOS, and I do not even use it, wassup? HOT 7
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-flutter.