Skip to content

Commit 6fb9378

Browse files
authored
Merge pull request #3126 from numbersprotocol/milestone-v231017-hotfix
2 parents d0edc61 + a3e6c26 commit 6fb9378

14 files changed

+210
-195
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.87.1] - 2023-12-04
11+
12+
### Fixed
13+
14+
1. Fix in app purchase by migrating cordove-plugin-purchase to v13 (#3125)
15+
1016
## [0.87.0] - 2023-11-30
1117

1218
### Added
@@ -2220,7 +2226,8 @@ This is the first release! _Capture Lite_ is a cross-platform app adapted from [
22202226
- Web - see the demo [here](https://github.com/numbersprotocol/capture-lite#demo-app)
22212227
- Android - the APK file `app-debug.apk` is attached to this release
22222228

2223-
[unreleased]: https://github.com/numbersprotocol/capture-lite/compare/0.87.0...HEAD
2229+
[unreleased]: https://github.com/numbersprotocol/capture-lite/compare/0.87.1...HEAD
2230+
[0.87.1]: https://github.com/numbersprotocol/capture-lite/compare/0.87.0...0.87.1
22242231
[0.87.0]: https://github.com/numbersprotocol/capture-lite/compare/0.86.4...0.87.0
22252232
[0.86.4]: https://github.com/numbersprotocol/capture-lite/compare/0.83.2...0.86.4
22262233
[0.83.2]: https://github.com/numbersprotocol/capture-lite/compare/0.82.4...0.85.2

android/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "io.numbersprotocol.capturelite"
88
minSdkVersion rootProject.ext.minSdkVersion
99
targetSdkVersion rootProject.ext.targetSdkVersion
10-
versionCode 870
11-
versionName "0.87.0"
10+
versionCode 871
11+
versionName "0.87.1"
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
}
1414
buildFeatures {

android/app/capacitor.build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies {
3333
implementation project(':appsflyer-capacitor-plugin')
3434
implementation project(':capacitor-blob-writer')
3535
implementation project(':capacitor-native-settings')
36-
implementation "com.android.billingclient:billing:4.0.0"
36+
implementation "com.android.billingclient:billing:5.2.1"
3737
}
3838

3939

ios/App/App.xcodeproj/project.pbxproj

+4-4
Original file line numberDiff line numberDiff line change
@@ -368,13 +368,13 @@
368368
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
369369
CODE_SIGN_IDENTITY = "iPhone Distribution";
370370
CODE_SIGN_STYLE = Manual;
371-
CURRENT_PROJECT_VERSION = 870;
371+
CURRENT_PROJECT_VERSION = 871;
372372
DEVELOPMENT_TEAM = G7NB5YCKAP;
373373
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = G7NB5YCKAP;
374374
INFOPLIST_FILE = App/Info.plist;
375375
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
376376
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
377-
MARKETING_VERSION = 0.87.0;
377+
MARKETING_VERSION = 0.87.1;
378378
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
379379
PRODUCT_BUNDLE_IDENTIFIER = io.numbersprotocol.capturelite;
380380
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -395,13 +395,13 @@
395395
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
396396
CODE_SIGN_IDENTITY = "iPhone Distribution";
397397
CODE_SIGN_STYLE = Manual;
398-
CURRENT_PROJECT_VERSION = 870;
398+
CURRENT_PROJECT_VERSION = 871;
399399
DEVELOPMENT_TEAM = G7NB5YCKAP;
400400
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = G7NB5YCKAP;
401401
INFOPLIST_FILE = App/Info.plist;
402402
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
403403
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
404-
MARKETING_VERSION = 0.87.0;
404+
MARKETING_VERSION = 0.87.1;
405405
PRODUCT_BUNDLE_IDENTIFIER = io.numbersprotocol.capturelite;
406406
PRODUCT_NAME = "$(TARGET_NAME)";
407407
PROVISIONING_PROFILE_SPECIFIER = NumbersAppDistributionV4;

package-lock.json

+9-30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "capture-lite",
3-
"version": "0.87.0",
3+
"version": "0.87.1",
44
"author": "numbersprotocol",
55
"homepage": "https://numbersprotocol.io/",
66
"scripts": {
@@ -30,7 +30,6 @@
3030
"@angular/platform-browser-dynamic": "^14.2.0",
3131
"@angular/router": "^14.2.0",
3232
"@awesome-cordova-plugins/core": "^5.46.0",
33-
"@awesome-cordova-plugins/in-app-purchase-2": "^5.43.0",
3433
"@capacitor-community/advertising-id": "^5.0.0",
3534
"@capacitor-community/bluetooth-le": "^2.2.3",
3635
"@capacitor-community/http": "github:numbersprotocol/http#fix-catch-disabled-Local-Network-case-on-iOS",
@@ -74,7 +73,7 @@
7473
"capacitor-blob-writer": "^1.0.4",
7574
"capacitor-native-settings": "^4.0.3",
7675
"compressorjs": "^1.0.7",
77-
"cordova-plugin-purchase": "^11.0.0",
76+
"cordova-plugin-purchase": "^13.9.0",
7877
"ethers": "^6.8.1",
7978
"hammerjs": "^2.0.8",
8079
"immutable": "^4.0.0-rc.14",

src/app/app.component.spec.ts

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { HttpClientTestingModule } from '@angular/common/http/testing';
22
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
33
import { TestBed, waitForAsync } from '@angular/core/testing';
4-
import { InAppPurchase2 } from '@awesome-cordova-plugins/in-app-purchase-2/ngx';
54
import { Platform } from '@ionic/angular';
65
import { AppComponent } from './app.component';
76
import { CapacitorPluginsTestingModule } from './shared/capacitor-plugins/capacitor-plugins-testing.module';
@@ -22,12 +21,6 @@ describe('AppComponent', () => {
2221
is: platformIsSpy,
2322
});
2423

25-
const iap2SpyMethods = ['error', 'ready', 'when', 'refresh', 'off'];
26-
const inAppPurchase2Spy = jasmine.createSpyObj(
27-
'InAppPurchase2',
28-
iap2SpyMethods
29-
);
30-
3124
TestBed.configureTestingModule({
3225
declarations: [AppComponent],
3326
schemas: [CUSTOM_ELEMENTS_SCHEMA],
@@ -37,10 +30,7 @@ describe('AppComponent', () => {
3730
getTranslocoTestingModule(),
3831
MaterialTestingModule,
3932
],
40-
providers: [
41-
{ provide: Platform, useValue: platformSpy },
42-
{ provide: InAppPurchase2, useValue: inAppPurchase2Spy },
43-
],
33+
providers: [{ provide: Platform, useValue: platformSpy }],
4434
}).compileComponents();
4535
})
4636
);

src/app/app.module.ts

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar';
33
import { BrowserModule, HammerModule } from '@angular/platform-browser';
44
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
55
import { RouteReuseStrategy } from '@angular/router';
6-
import { InAppPurchase2 } from '@awesome-cordova-plugins/in-app-purchase-2/ngx';
76
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
87
import { FormlyModule } from '@ngx-formly/core';
98
import { FormlyMaterialModule } from '@ngx-formly/material';
@@ -36,7 +35,6 @@ import { SharedModule } from './shared/shared.module';
3635
provide: MAT_SNACK_BAR_DEFAULT_OPTIONS,
3736
useValue: { duration: 2500 },
3837
},
39-
InAppPurchase2,
4038
],
4139
bootstrap: [AppComponent],
4240
})

src/app/features/wallets/buy-num/buy-num.page.html

+1-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
></ion-icon>
2626
</div>
2727
<div class="subtitle-text">
28-
{{ product.inAppProduct.price }}
28+
{{ product.inAppProduct.pricing?.price }}
2929
</div>
3030
</div>
3131
</ion-label>
@@ -38,9 +38,6 @@
3838
{{
3939
t('wallets.buyCredits.buyXCredits', { credits: product.numPoints })
4040
}}
41-
<ion-spinner
42-
*ngIf="product.inAppProduct.state !== 'valid'"
43-
></ion-spinner>
4441
</ion-button>
4542
</ion-item>
4643
</ion-card>

src/app/features/wallets/buy-num/buy-num.page.spec.ts

-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2-
import { InAppPurchase2 } from '@awesome-cordova-plugins/in-app-purchase-2/ngx';
32
import { SharedTestingModule } from '../../../shared/shared-testing.module';
43

54
import { BuyNumPage } from './buy-num.page';
@@ -10,16 +9,9 @@ describe('BuyNumPage', () => {
109

1110
beforeEach(
1211
waitForAsync(() => {
13-
const iap2SpyMethods = ['error', 'ready', 'when', 'refresh', 'off'];
14-
const inAppPurchase2Spy = jasmine.createSpyObj(
15-
'InAppPurchase2',
16-
iap2SpyMethods
17-
);
18-
1912
TestBed.configureTestingModule({
2013
declarations: [BuyNumPage],
2114
imports: [SharedTestingModule],
22-
providers: [{ provide: InAppPurchase2, useValue: inAppPurchase2Spy }],
2315
}).compileComponents();
2416

2517
fixture = TestBed.createComponent(BuyNumPage);

src/app/features/wallets/buy-num/buy-num.page.ts

+18-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
2-
import { IAPProduct } from '@awesome-cordova-plugins/in-app-purchase-2/ngx';
32
import { AlertController } from '@ionic/angular';
43
import { TranslocoService } from '@ngneat/transloco';
4+
import { UntilDestroy } from '@ngneat/until-destroy';
55
import { combineLatest } from 'rxjs';
6-
import { map, tap } from 'rxjs/operators';
6+
import { filter, first, map, tap } from 'rxjs/operators';
7+
import { BlockingActionService } from '../../../shared/blocking-action/blocking-action.service';
78
import { InAppStoreService } from '../../../shared/in-app-store/in-app-store.service';
89

10+
@UntilDestroy()
911
@Component({
1012
selector: 'app-buy-num',
1113
templateUrl: './buy-num.page.html',
@@ -34,21 +36,33 @@ export class BuyNumPage implements OnInit {
3436
tap(_ => this.ref.detectChanges())
3537
);
3638

39+
readonly isProcessingOrder$ = this.store.isProcessingOrder$;
40+
3741
constructor(
3842
private readonly store: InAppStoreService,
3943
private readonly ref: ChangeDetectorRef,
4044
private readonly alertController: AlertController,
41-
private readonly translocoService: TranslocoService
45+
private readonly translocoService: TranslocoService,
46+
private readonly blockingActionService: BlockingActionService
4247
) {}
4348

4449
ngOnInit() {
4550
this.store.refreshNumPointsPricing();
4651
}
4752

48-
purchase(product: IAPProduct) {
53+
purchase(product: CdvPurchase.Product) {
54+
this.showLoadingIndicatorUntillOrderIsProcessed();
4955
this.store.purchase(product);
5056
}
5157

58+
private showLoadingIndicatorUntillOrderIsProcessed() {
59+
const action$ = this.isProcessingOrder$.pipe(
60+
filter(isProcessing => isProcessing === false),
61+
first()
62+
);
63+
this.blockingActionService.run$(action$).subscribe();
64+
}
65+
5266
async showNumPointsQuantity(numPoints: number) {
5367
const info = this.translocoService.translate(
5468
'wallets.buyCredits.thisPackageIncludeXCredits',

src/app/shared/in-app-store/in-app-store.service.spec.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { TestBed } from '@angular/core/testing';
2-
import { InAppPurchase2 } from '@awesome-cordova-plugins/in-app-purchase-2/ngx';
32
import { SharedModule } from '../shared.module';
43

54
import { InAppStoreService } from './in-app-store.service';
@@ -10,7 +9,6 @@ describe('InAppStoreService', () => {
109
beforeEach(() => {
1110
TestBed.configureTestingModule({
1211
imports: [SharedModule],
13-
providers: [InAppPurchase2],
1412
});
1513
service = TestBed.inject(InAppStoreService);
1614
});

0 commit comments

Comments
 (0)