Solved

Is there a way to add metadata to a package

  • 26 August 2021
  • 6 replies
  • 453 views

Badge +1

Let’s say I need to add additional information about a package - I can display the title of a package, I can display the description but where can I fetch additional information about the package? For example the colour or the weight.

 

Is this currently possible or do I need another way of storing and fetching this information?

icon

Best answer by sharif 16 September 2021, 00:30

View original

6 replies

Userlevel 5
Badge +9

It isn’t possible (yet) to attach arbitrary metadata to a package outside of its description, so you probably need another way to store and fetch this information. This is on our backlog but I don’t have an ETA of when we’ll release it. I’ll mention @Jens so that it’s on his radar.

Badge +3

@sharif How do we get the package description? I don’t see that available in Flutter

Badge +3

I see this: https://github.com/RevenueCat/purchases-flutter/issues/35

 

so it was an oversight but logged about a year ago ...so is it just not happening? This really makes building the dynamic paywall a bit tough

Userlevel 5
Badge +9

We definitely hear you but the package description was really meant for dashboard use, not SDK use. It’s still definitely on our backlog to implement but the issue is that the package description isn’t returned in our offerings API endpoint, which makes it impossible for the SDK to pull it from RevenueCat. We try to be very conservative with the updates we make to our REST API in order to maintain backwards compatibility, so a package description field would be scheduled for a larger v2.0 release of our API.

For now we recommend relying on the offering description to describe the packages as a whole (for example you could have a paywall with a heading displaying the offering description and buttons for the monthly and yearly packages.) You can make more than one offering to group similar packages together so that the description can cover all of the packages in the offering.

Otherwise you could host a simple map of packages to descriptions on a basic web server and fetch that map in your app (this is what we recommend for more advanced use cases, e.g. a catalog of consumable products.)

Let me know if you have any other questions.

Badge +3

@sharif A bit strange but understood. Another workaround for us might be the ability to get introductory pricing info from the the Flutter SDK but that also doesn’t seem possible. I logged this bug:

https://github.com/RevenueCat/purchases-flutter/issues/243

Badge +1

Is it a good idea for now to use a ‘custom’ package identifier to include the needed text?

In other words, would a long string with non unicode characters work as a package identifier or I may face parsing problems. For example I may use “Special offer!_عرض خاص!_besonderes Angebot”  .

Reply