Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Add missing GlassfyProduct prop
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarbo committed Nov 16, 2023
1 parent e49402b commit 0e414f5
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.6.1

- Add missing GlassfyProduct properties

## 1.6.0

- Add support for Glassfy Android SDK 1.6.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To use this plugin, add glassfy_flutter in your `pubspec.yaml`

```
dependencies:
glassfy_flutter: ^1.6.0
glassfy_flutter: ^1.6.1
```

Or install automatically using this command
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'io.glassfy.glassfy_flutter'
version '1.6.0'
version '1.6.1'

buildscript {
ext.kotlin_version = '1.8.10'
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- Flutter (1.0.0)
- Glassfy (1.4.0)
- glassfy_flutter (1.6.0):
- glassfy_flutter (1.6.1):
- Flutter
- GlassfyGlue (= 1.4.1)
- GlassfyGlue (1.4.1):
Expand All @@ -25,7 +25,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
Glassfy: 6c13edc242715212cfd01a0a12c8553f2f06cfcb
glassfy_flutter: 650a1f1bf5aadff5ae4d508475806b068f76b10c
glassfy_flutter: ab47f375ec94d0c5361e4d11a6236924b195aed2
GlassfyGlue: cb21cb170ebfc2ff734ceaaafee61a76c54345a5

PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048
Expand Down
2 changes: 1 addition & 1 deletion example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class _MyHomePageState extends State<MyHomePage> {
debugPrint("Setting up Glassfy SDK...");

try {
const apiKey = "YOUR_API_KEY";
const apiKey = "50af3c1afb6f473bbaf1ad0d5fb19b41";
Glassfy.setLogLevel(GlassfyLogLevel.logLevelAll);
Glassfy.initialize(apiKey);
} catch (error) {
Expand Down
14 changes: 14 additions & 0 deletions example/lib/sku.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ class _SkuItemState extends State<SkuItem> {
onTap: () => handlePress(),
child: Column(
children: <Widget>[
Row(children: [
const Text("Title"),
Expanded(
child: Container(
alignment: AlignmentDirectional.centerEnd,
child: Text("${sku.product?.title}")))
]),
Row(children: [
const Text("Description"),
Expanded(
child: Container(
alignment: AlignmentDirectional.centerEnd,
child: Text("${sku.product?.description}")))
]),
Row(children: [
const Text("SkuId"),
Expanded(
Expand Down
2 changes: 1 addition & 1 deletion example/macos/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PODS:
- FlutterMacOS (1.0.0)
- Glassfy (1.4.0)
- glassfy_flutter (1.6.0):
- glassfy_flutter (1.6.1):
- FlutterMacOS
- GlassfyGlue (= 1.4.0)
- GlassfyGlue (1.4.0):
Expand Down
2 changes: 1 addition & 1 deletion ios/glassfy_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'glassfy_flutter'
s.version = '1.6.0'
s.version = '1.6.1'
s.summary = 'Glassfy SDK'
s.description = <<-DESC
Glassfy SDK.
Expand Down
8 changes: 4 additions & 4 deletions lib/glassfy_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ class Glassfy {
..setMethodCallHandler((call) async {
switch (call.method) {
case 'gy_did_purchase_product':
try{
try {
final transaction =
GlassfyTransaction.fromJson(jsonDecode(call.arguments));
GlassfyTransaction.fromJson(jsonDecode(call.arguments));
for (final listener in _didPurchaseListenerListeners) {
listener(transaction);
}
} catch(e){
} catch (e) {
debugPrint("Invalid didPurchaseListner Argument");
}
break;
Expand All @@ -40,7 +40,7 @@ class Glassfy {

static Future<void> initialize(String apiKey, {bool watcherMode = false}) =>
_channel.invokeMethod('initialize',
{'apiKey': apiKey, 'watcherMode': watcherMode, 'version': "1.6.0"});
{'apiKey': apiKey, 'watcherMode': watcherMode, 'version': "1.6.1"});

static setLogLevel(int logLevel) {
_channel.invokeMethod('setLogLevel', {
Expand Down
20 changes: 15 additions & 5 deletions lib/models.dart
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,26 @@ class GlassfyProductDiscount {

@JsonSerializable(explicitToJson: true)
class GlassfyProduct {
final String? title;
final String? description;
final String? currencyCode;
final String? identifier;
final String? basePlanId;
final num? price;
final String? currencyCode;
final String? period;
final GlassfyProductDiscount? introductoryPrice;
final List<GlassfyProductDiscount>? discounts;
final String? period;
final String? basePlanId;

GlassfyProduct(this.description, this.currencyCode, this.price,
this.introductoryPrice, this.discounts, this.period, this.basePlanId);
GlassfyProduct(
this.title,
this.description,
this.identifier,
this.basePlanId,
this.price,
this.currencyCode,
this.period,
this.introductoryPrice,
this.discounts);
factory GlassfyProduct.fromJson(Map<String, dynamic> json) =>
_$GlassfyProductFromJson(json);
Map<String, dynamic> toJson() => _$GlassfyProductToJson(this);
Expand Down
16 changes: 10 additions & 6 deletions lib/models.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion macos/glassfy_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'glassfy_flutter'
s.version = '1.6.0'
s.version = '1.6.1'
s.summary = 'Glassfy SDK'
s.description = <<-DESC
Glassfy SDK.
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: glassfy_flutter
description: Flutter plugin for Glassfy, build in-app purchases in minutes and offload the complexity of managing subscriptions and on-time purchases. Supports iOS, macOS and Android.
version: 1.6.0
version: 1.6.1
homepage: https://github.com/glassfy/glassfy-flutter

environment:
Expand Down

0 comments on commit 0e414f5

Please sign in to comment.