Skip to content

Commit 763f179

Browse files
Merge pull request #116 from qonversion/release/4.2.0
Release 4.2.0
2 parents be37ffc + 6327e40 commit 763f179

File tree

16 files changed

+212
-17
lines changed

16 files changed

+212
-17
lines changed

.github/workflows/checks.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Checks
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
6+
jobs:
7+
lint:
8+
runs-on: macos-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
name: Checkout
13+
14+
- uses: actions/setup-java@v1
15+
name: Setup Java
16+
with:
17+
java-version: '12.x'
18+
19+
- uses: subosito/flutter-action@v1
20+
name: Setup Flutter
21+
with:
22+
channel: 'stable'
23+
- run: flutter pub get
24+
- name: Validation
25+
run: flutter pub publish --dry-run
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Pre-release Github
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
8+
jobs:
9+
pre-release:
10+
runs-on: macos-latest
11+
12+
steps:
13+
- uses: "marvinpinto/action-automatic-releases@latest"
14+
with:
15+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
16+
automatic_release_tag: "latest"
17+
prerelease: true
18+
title: "Development Build"
19+
files: |
20+
LICENSE.txt
21+
*.jar
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release pull requests
2+
on:
3+
push:
4+
tags:
5+
- prerelease/*
6+
7+
jobs:
8+
prerelease:
9+
runs-on: macos-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
name: Checkout all
14+
with:
15+
fetch-depth: 0
16+
17+
- uses: olegtarasov/[email protected]
18+
id: tagName
19+
with:
20+
tagRegex: 'prerelease\/(\d*\.\d*\.\d*)'
21+
22+
- name: Bump version
23+
run: |
24+
fastlane bump version:${{ steps.tagName.outputs.tag }}
25+
26+
- name: Create pull request
27+
uses: peter-evans/create-pull-request@v3
28+
with:
29+
title: Release ${{ steps.tagName.outputs.tag }}
30+
body: Release PR
31+
labels: autocreated
32+
branch: release/${{ steps.tagName.outputs.tag }}
33+
base: develop
34+
35+
- uses: actions/checkout@v2
36+
with:
37+
ref: main
38+
39+
- name: Reset main branch
40+
run: |
41+
git fetch origin release/${{ steps.tagName.outputs.tag }}:release/${{ steps.tagName.outputs.tag }}
42+
git reset --hard release/${{ steps.tagName.outputs.tag }}
43+
44+
- name: Create Pull Request
45+
uses: peter-evans/create-pull-request@v3
46+
with:
47+
title: Release ${{ steps.tagName.outputs.tag }}
48+
body: Release PR
49+
labels: autocreated
50+
branch: release/${{ steps.tagName.outputs.tag }}
51+
base: main

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 4.2.0
2+
* Add `setAppleSearchAdsAttributionEnabled()` method
3+
14
## 4.1.1
25
* Fix StrictMode policy violation errors in the Google Play Console pre-launch report.
36

example/lib/home.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ class _HomeViewState extends State<HomeView> {
102102
isObserveMode: false,
103103
);
104104

105+
Qonversion.setAppleSearchAdsAttributionEnabled(true);
106+
105107
_loadQonversionObjects();
106108
}
107109

example/lib/products_view.dart

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ class ProductsView extends StatefulWidget {
99
}
1010

1111
class _ProductsViewState extends State<ProductsView> {
12-
var _products = <String, QProduct>{};
12+
var _products = <QProduct>[];
1313
QOfferings _offerings;
1414
StreamSubscription<Map<String, QPermission>> _deferredPurchasesStream;
1515
StreamSubscription<String> _promoPurchasesStream;
1616

1717
@override
1818
void initState() {
1919
super.initState();
20-
_loadProducts();
2120
_loadOfferings();
2221

2322
_deferredPurchasesStream =
@@ -28,7 +27,7 @@ class _ProductsViewState extends State<ProductsView> {
2827
try {
2928
final permissions = await Qonversion.promoPurchase(promoPurchaseId);
3029
// Get Qonversion product by App Store ID
31-
final qProduct = _products.values.firstWhere(
30+
final qProduct = _products.firstWhere(
3231
(element) => element.storeId == promoPurchaseId,
3332
orElse: () => null);
3433
// Get permission by Qonversion product
@@ -65,7 +64,7 @@ class _ProductsViewState extends State<ProductsView> {
6564
: ListView(
6665
children: [
6766
if (_products != null)
68-
for (final p in _products.values) _productWidget(p),
67+
for (final p in _products) _productWidget(p),
6968
if (_offerings != null) _offeringsWidget(_offerings),
7069
if (_products != null)
7170
Padding(
@@ -80,9 +79,10 @@ class _ProductsViewState extends State<ProductsView> {
8079
textColor: Colors.black,
8180
onPressed: () async {
8281
try {
82+
final ids = _products.map((product) => product.storeId).toList();
8383
final res =
84-
await Qonversion.checkTrialIntroEligibility(
85-
_products.keys.toList());
84+
await Qonversion.checkTrialIntroEligibility(ids);
85+
8686
print(res.map(
8787
(key, value) => MapEntry(key, value.status)));
8888
} catch (e) {
@@ -97,19 +97,20 @@ class _ProductsViewState extends State<ProductsView> {
9797
);
9898
}
9999

100-
Future<void> _loadProducts() async {
100+
Future<void> _loadOfferings() async {
101101
try {
102-
_products = await Qonversion.products();
102+
_offerings = await Qonversion.offerings();
103+
_loadProducts();
103104
setState(() {});
104105
} catch (e) {
105106
print(e);
106-
_products = {};
107107
}
108108
}
109109

110-
Future<void> _loadOfferings() async {
110+
Future<void> _loadProducts() async {
111111
try {
112-
_offerings = await Qonversion.offerings();
112+
var mainOffering = _offerings.offeringForIdentifier("main");
113+
_products = mainOffering.products;
113114
setState(() {});
114115
} catch (e) {
115116
print(e);

fastlane/Appfile

Whitespace-only changes.

fastlane/Fastfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
def update_dart(new_version)
2+
path = Dir['../lib/**/qonversion.dart'].first
3+
regex = /static const String _sdkVersion = ".*";/
4+
result_value = "static const String _sdkVersion = \"#{new_version}\";"
5+
6+
update_file(path, regex, result_value)
7+
end
8+
9+
def update_yaml(new_version)
10+
path = "../pubspec.yaml"
11+
regex = /version: .*/
12+
result_value = "version: #{new_version}"
13+
14+
update_file(path, regex, result_value)
15+
end
16+
17+
def update_file(path, regex, result_value)
18+
file = File.read(path)
19+
new_content = file.gsub(regex, result_value)
20+
File.open(path, 'w') { |line| line.puts new_content }
21+
end
22+
23+
def update_changelog(new_version)
24+
changelog_update = "\#\# #{new_version}\n* // Update changelog here\n\n"
25+
path = "../CHANGELOG.md"
26+
file = File.read(path)
27+
File.open(path, 'w') { |line|
28+
line.puts changelog_update + file
29+
}
30+
end
31+
32+
lane :bump do |options|
33+
new_version = options[:version]
34+
35+
update_dart(new_version)
36+
update_yaml(new_version)
37+
update_changelog(new_version)
38+
end

fastlane/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
fastlane documentation
2+
================
3+
# Installation
4+
5+
Make sure you have the latest version of the Xcode command line tools installed:
6+
7+
```
8+
xcode-select --install
9+
```
10+
11+
Install _fastlane_ using
12+
```
13+
[sudo] gem install fastlane -NV
14+
```
15+
or alternatively using `brew install fastlane`
16+
17+
# Available Actions
18+
### bump
19+
```
20+
fastlane bump
21+
```
22+
23+
24+
----
25+
26+
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
27+
More information about fastlane can be found on [fastlane.tools](https://fastlane.tools).
28+
The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools).

fastlane/report.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<testsuites>
3+
<testsuite name="fastlane.lanes">
4+
5+
6+
7+
</testsuite>
8+
</testsuites>

0 commit comments

Comments
 (0)