@@ -16723,16 +16723,16 @@ steps:
16723
16723
replace-contents: |
16724
16724
### Configuration Files
16725
16725
16726
- Create `lib/constants.dart` with :
16726
+ Configure the required IDs and keys in `lib/constants.dart`:
16727
16727
16728
16728
```
16729
- const androidPackageId = " your Android package ID" ;
16729
+ const androidPackageId = ' your Android package ID' ;
16730
16730
const appStoreIssuerId = 'App Store Key issuer ID';
16731
- const appStoreKeyId = 'App Store Keu ID';
16732
- const appStoreSharedSecret = " App Store shared secret" ;
16731
+ const appStoreKeyId = 'App Store Key ID';
16732
+ const appStoreSharedSecret = ' App Store shared secret' ;
16733
16733
const bundleId = 'your iOS bundle ID';
16734
- const googlePlayProjectName = " Google Cloud project name" ;
16735
- const googlePlayPubsubBillingTopic = " play_billing" ; // change if necessary
16734
+ const googleCloudProjectId = ' Google Cloud project ID' ;
16735
+ const googlePlayPubsubBillingTopic = ' play_billing' ; // change if necessary
16736
16736
```
16737
16737
16738
16738
- Add `assets/service-account-firebase.json` with the server key for the Firebase Firestore project.
@@ -16788,7 +16788,7 @@ steps:
16788
16788
const appStoreKeyId = 'App Store Key ID';
16789
16789
const appStoreSharedSecret = 'App Store shared secret';
16790
16790
const bundleId = 'your iOS bundle ID';
16791
- const googlePlayProjectName = 'Google Cloud project name ';
16791
+ const googleCloudProjectId = 'Google Cloud project ID ';
16792
16792
const googlePlayPubsubBillingTopic = 'play_billing';
16793
16793
- name: Add dart-backend/lib/helpers.dart
16794
16794
path: steps/dart-backend/lib/helpers.dart
@@ -17486,15 +17486,15 @@ steps:
17486
17486
from: steps
17487
17487
to: step_08
17488
17488
17489
- - name: step_09
17489
+ - name: step_10
17490
17490
steps:
17491
- - name: Remove step_09
17492
- rmdir: step_09
17491
+ - name: Remove step_10
17492
+ rmdir: step_10
17493
17493
- name: Patch app/lib/main.dart
17494
17494
path: steps/app/lib/main.dart
17495
17495
patch-u: |
17496
- --- b/in_app_purchases/step_09 /app/lib/main.dart
17497
- +++ a/in_app_purchases/step_09 /app/lib/main.dart
17496
+ --- b/in_app_purchases/step_10 /app/lib/main.dart
17497
+ +++ a/in_app_purchases/step_10 /app/lib/main.dart
17498
17498
@@ -79,7 +79,11 @@ class _MyHomePageState extends State<MyHomePage> {
17499
17499
create: (context) => IAPRepo(context.read<FirebaseNotifier>()),
17500
17500
),
@@ -17511,8 +17511,8 @@ steps:
17511
17511
- name: Patch app/lib/logic/dash_purchases.dart
17512
17512
path: steps/app/lib/logic/dash_purchases.dart
17513
17513
patch-u: |
17514
- --- b/in_app_purchases/step_09 /app/lib/logic/dash_purchases.dart
17515
- +++ a/in_app_purchases/step_09 /app/lib/logic/dash_purchases.dart
17514
+ --- b/in_app_purchases/step_10 /app/lib/logic/dash_purchases.dart
17515
+ +++ a/in_app_purchases/step_10 /app/lib/logic/dash_purchases.dart
17516
17516
@@ -1,7 +1,9 @@
17517
17517
import 'dart:async';
17518
17518
+import 'dart:convert';
@@ -17605,8 +17605,8 @@ steps:
17605
17605
- name: Patch app/lib/logic/firebase_notifier.dart
17606
17606
path: steps/app/lib/logic/firebase_notifier.dart
17607
17607
patch-u: |
17608
- --- b/in_app_purchases/step_09 /app/lib/logic/firebase_notifier.dart
17609
- +++ a/in_app_purchases/step_09 /app/lib/logic/firebase_notifier.dart
17608
+ --- b/in_app_purchases/step_10 /app/lib/logic/firebase_notifier.dart
17609
+ +++ a/in_app_purchases/step_10 /app/lib/logic/firebase_notifier.dart
17610
17610
@@ -29,6 +29,8 @@ class FirebaseNotifier extends ChangeNotifier {
17611
17611
return FirebaseFirestore.instance;
17612
17612
}
@@ -17619,8 +17619,8 @@ steps:
17619
17619
- name: Patch app/lib/pages/purchase_page.dart
17620
17620
path: steps/app/lib/pages/purchase_page.dart
17621
17621
patch-u: |
17622
- --- b/in_app_purchases/step_09 /app/lib/pages/purchase_page.dart
17623
- +++ a/in_app_purchases/step_09 /app/lib/pages/purchase_page.dart
17622
+ --- b/in_app_purchases/step_10 /app/lib/pages/purchase_page.dart
17623
+ +++ a/in_app_purchases/step_10 /app/lib/pages/purchase_page.dart
17624
17624
@@ -2,15 +2,29 @@ import 'package:flutter/material.dart';
17625
17625
import 'package:provider/provider.dart';
17626
17626
@@ -17654,8 +17654,8 @@ steps:
17654
17654
- name: Patch dart-backend/bin/server.dart
17655
17655
path: steps/dart-backend/bin/server.dart
17656
17656
patch-u: |
17657
- --- b/in_app_purchases/step_09 /dart-backend/bin/server.dart
17658
- +++ a/in_app_purchases/step_09 /dart-backend/bin/server.dart
17657
+ --- b/in_app_purchases/step_10 /dart-backend/bin/server.dart
17658
+ +++ a/in_app_purchases/step_10 /dart-backend/bin/server.dart
17659
17659
@@ -2,12 +2,111 @@
17660
17660
// for details. All rights reserved. Use of this source code is governed by a
17661
17661
// BSD-style license that can be found in the LICENSE file.
@@ -18099,20 +18099,20 @@ steps:
18099
18099
required String token,
18100
18100
});
18101
18101
}
18102
- - name: Copy to step_09
18102
+ - name: Copy to step_10
18103
18103
copydir:
18104
18104
from: steps
18105
- to: step_09
18105
+ to: step_10
18106
18106
18107
- - name: step_10
18107
+ - name: step_11
18108
18108
steps:
18109
- - name: Remove step_10
18110
- rmdir: step_10
18109
+ - name: Remove step_11
18110
+ rmdir: step_11
18111
18111
- name: Patch app/lib/main.dart
18112
18112
path: steps/app/lib/main.dart
18113
18113
patch-u: |
18114
- --- b/in_app_purchases/step_10 /app/lib/main.dart
18115
- +++ a/in_app_purchases/step_10 /app/lib/main.dart
18114
+ --- b/in_app_purchases/step_11 /app/lib/main.dart
18115
+ +++ a/in_app_purchases/step_11 /app/lib/main.dart
18116
18116
@@ -83,6 +83,7 @@ class _MyHomePageState extends State<MyHomePage> {
18117
18117
(context) => DashPurchases(
18118
18118
context.read<DashCounter>(),
@@ -18124,8 +18124,8 @@ steps:
18124
18124
- name: Patch app/lib/logic/dash_purchases.dart
18125
18125
path: steps/app/lib/logic/dash_purchases.dart
18126
18126
patch-u: |
18127
- --- b/in_app_purchases/step_10 /app/lib/logic/dash_purchases.dart
18128
- +++ a/in_app_purchases/step_10 /app/lib/logic/dash_purchases.dart
18127
+ --- b/in_app_purchases/step_11 /app/lib/logic/dash_purchases.dart
18128
+ +++ a/in_app_purchases/step_11 /app/lib/logic/dash_purchases.dart
18129
18129
@@ -10,6 +10,7 @@ import '../constants.dart';
18130
18130
import '../main.dart';
18131
18131
import '../model/purchasable_product.dart';
@@ -18228,8 +18228,8 @@ steps:
18228
18228
- name: Patch dart-backend/bin/server.dart
18229
18229
path: steps/dart-backend/bin/server.dart
18230
18230
patch-u: |
18231
- --- b/in_app_purchases/step_10 /dart-backend/bin/server.dart
18232
- +++ a/in_app_purchases/step_10 /dart-backend/bin/server.dart
18231
+ --- b/in_app_purchases/step_11 /dart-backend/bin/server.dart
18232
+ +++ a/in_app_purchases/step_11 /dart-backend/bin/server.dart
18233
18233
@@ -5,7 +5,9 @@
18234
18234
import 'dart:convert';
18235
18235
import 'dart:io';
@@ -18315,8 +18315,8 @@ steps:
18315
18315
- name: Patch dart-backend/lib/app_store_purchase_handler.dart
18316
18316
path: steps/dart-backend/lib/app_store_purchase_handler.dart
18317
18317
patch-u: |
18318
- --- b/in_app_purchases/step_10 /dart-backend/lib/app_store_purchase_handler.dart
18319
- +++ a/in_app_purchases/step_10 /dart-backend/lib/app_store_purchase_handler.dart
18318
+ --- b/in_app_purchases/step_11 /dart-backend/lib/app_store_purchase_handler.dart
18319
+ +++ a/in_app_purchases/step_11 /dart-backend/lib/app_store_purchase_handler.dart
18320
18320
@@ -7,10 +7,19 @@ import 'iap_repository.dart';
18321
18321
import 'products.dart';
18322
18322
import 'purchase_handler.dart';
@@ -18395,8 +18395,8 @@ steps:
18395
18395
- name: Patch dart-backend/lib/google_play_purchase_handler.dart
18396
18396
path: steps/dart-backend/lib/google_play_purchase_handler.dart
18397
18397
patch-u: |
18398
- --- b/in_app_purchases/step_10 /dart-backend/lib/google_play_purchase_handler.dart
18399
- +++ a/in_app_purchases/step_10 /dart-backend/lib/google_play_purchase_handler.dart
18398
+ --- b/in_app_purchases/step_11 /dart-backend/lib/google_play_purchase_handler.dart
18399
+ +++ a/in_app_purchases/step_11 /dart-backend/lib/google_play_purchase_handler.dart
18400
18400
@@ -1,6 +1,8 @@
18401
18401
import 'dart:async';
18402
18402
+import 'dart:convert';
@@ -18437,7 +18437,7 @@ steps:
18437
18437
+ print('Polling Google Play messages');
18438
18438
+ final request = pubsub.PullRequest(maxMessages: 1000);
18439
18439
+ final topicName =
18440
- + 'projects/$googlePlayProjectName /subscriptions/$googlePlayPubsubBillingTopic-sub';
18440
+ + 'projects/$googleCloudProjectId /subscriptions/$googlePlayPubsubBillingTopic-sub';
18441
18441
+ final pullResponse = await pubsubApi.projects.subscriptions.pull(
18442
18442
+ request,
18443
18443
+ topicName,
@@ -18503,7 +18503,7 @@ steps:
18503
18503
+ print('ACK Message');
18504
18504
+ final request = pubsub.AcknowledgeRequest(ackIds: [id]);
18505
18505
+ final subscriptionName =
18506
- + 'projects/$googlePlayProjectName /subscriptions/$googlePlayPubsubBillingTopic-sub';
18506
+ + 'projects/$googleCloudProjectId /subscriptions/$googlePlayPubsubBillingTopic-sub';
18507
18507
+ await pubsubApi.projects.subscriptions.acknowledge(
18508
18508
+ request,
18509
18509
+ subscriptionName,
@@ -18512,10 +18512,10 @@ steps:
18512
18512
}
18513
18513
18514
18514
NonSubscriptionStatus _nonSubscriptionStatusFrom(int? state) {
18515
- - name: Copy to step_10
18515
+ - name: Copy to step_11
18516
18516
copydir:
18517
18517
from: steps
18518
- to: step_10
18518
+ to: step_11
18519
18519
18520
18520
- name: complete
18521
18521
steps:
0 commit comments