Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getOffering returns null #19

Closed
owenkealey opened this issue Dec 24, 2019 · 6 comments
Closed

getOffering returns null #19

owenkealey opened this issue Dec 24, 2019 · 6 comments

Comments

@owenkealey
Copy link

Hi,

When I print out all the offerings I have, you can see the offerings particularly the one identified by the string "Default".

Offerings{current: Offering{identifier: Default, serverDescription: Subscription options., availablePackages: [Package{identifier: $rc_monthly, packageType: PackageType.monthly, product: Product{identifier: com.phntm.carbon.subscription, description: The subscription is required to access Carbon, title: Full Access, price: 11.989999771118164, priceString: $11.99, currencyCode: USD, introductoryPrice: null}, offeringIdentifier: Default}], lifetime: null, annual: null, sixMonth: null, threeMonth: null, twoMonth: null, monthly: Package{identifier: $rc_monthly, packageType: PackageType.monthly, product: Product{identifier: com.phntm.carbon.subscription, description: The subscription is required to access Carbon, title: Full Access, price: 11.989999771118164, priceString: $11.99, currencyCode: USD, introductoryPrice: null}, offeringIdentifier: Default}, weekly: null}, all: {Default: Offering{identifier: Default, serverDescription: Subscription options., availablePackages: [Package{identifie<…>

However, when I call the getOffering method on this, print(offerings.getOffering("Default"));

it prints out null and because of this when I try to get the Offering's package like this,
Package package = offerings.getOffering("Default").availablePackages[0];

it does not work, error Unhandled Exception: NoSuchMethodError: The getter 'availablePackages' was called on null.

@vegaro
Copy link
Contributor

vegaro commented Dec 24, 2019

Hey! Just released https://github.com/RevenueCat/purchases-flutter/releases/tag/1.0.4 which should fix it. That was a really stupid bug on our end, sorry about that @owenkealey

@vegaro vegaro closed this as completed Dec 24, 2019
@owenkealey
Copy link
Author

thanks

@lvlrSajjad
Copy link

lvlrSajjad commented Aug 1, 2020

@vegaro Still experiencing this on android.
All configurations are correct, running on a real device, and no errors.
image
just this problem.
It works correctly on ios ( At least, offerings are loaded on IOS even in the simulator )
I configurated offerings, products, packages in the panel and I can see them on IOS.

  purchases_flutter: 1.2.1

Flutter doctor:

[✓] Flutter (Channel stable, v1.17.5, on Mac OS X 10.15.6 19G73, locale en-US)
    • Flutter version 1.17.5 at /Users/lvlrx/development/flutter
    • Framework revision 8af6b2f038 (5 weeks ago), 2020-06-30 12:53:55 -0700
    • Engine revision ee76268252
    • Dart version 2.8.4

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/lvlrx/Library/Android/sdk
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.8.4

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (1 available)
    • SM A705FN • R58M72K6A2D • android-arm64 • Android 10 (API 29)

• No issues found!

@vegaro
Copy link
Contributor

vegaro commented Aug 3, 2020

Hi @lvlrSajjad. You're most likely facing a testing configuration issue. I would suggest you to look at this answer in our FAQs https://support.revenuecat.com/hc/en-us/articles/360041793174-Why-are-my-products-offerings-or-available-packages-empty- and at this article https://docs.revenuecat.com/docs/google-play-store. I hope there's something in those articles that fixes your issue 😄

We have a Spectrum community https://spectrum.chat/revenuecat that might be helpful if you have more configuration issues in the future

@Sesa1988
Copy link

Sesa1988 commented Sep 3, 2020

if you have multiple environments make sure your running on your live environment in debug mode (live bundle id).
Thats what I keep forgetting all the time :D

@pavel-birdy
Copy link

Hi @lvlrSajjad. You're most likely facing a testing configuration issue. I would suggest you to look at this answer in our FAQs https://support.revenuecat.com/hc/en-us/articles/360041793174-Why-are-my-products-offerings-or-available-packages-empty- and at this article https://docs.revenuecat.com/docs/google-play-store. I hope there's something in those articles that fixes your issue 😄

We have a Spectrum community https://spectrum.chat/revenuecat that might be helpful if you have more configuration issues in the future

@vegaro It was helpful thanks but spectrum chat is inactive no one replies there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants