Skip to content

Commit

Permalink
Merge pull request #3126 from numbersprotocol/milestone-v231017-hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
shc261392 authored Dec 4, 2023
2 parents d0edc61 + a3e6c26 commit 6fb9378
Show file tree
Hide file tree
Showing 14 changed files with 210 additions and 195 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.87.1] - 2023-12-04

### Fixed

1. Fix in app purchase by migrating cordove-plugin-purchase to v13 (#3125)

## [0.87.0] - 2023-11-30

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

[unreleased]: https://github.com/numbersprotocol/capture-lite/compare/0.87.0...HEAD
[unreleased]: https://github.com/numbersprotocol/capture-lite/compare/0.87.1...HEAD
[0.87.1]: https://github.com/numbersprotocol/capture-lite/compare/0.87.0...0.87.1
[0.87.0]: https://github.com/numbersprotocol/capture-lite/compare/0.86.4...0.87.0
[0.86.4]: https://github.com/numbersprotocol/capture-lite/compare/0.83.2...0.86.4
[0.83.2]: https://github.com/numbersprotocol/capture-lite/compare/0.82.4...0.85.2
Expand Down
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "io.numbersprotocol.capturelite"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 870
versionName "0.87.0"
versionCode 871
versionName "0.87.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures {
Expand Down
2 changes: 1 addition & 1 deletion android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
implementation project(':appsflyer-capacitor-plugin')
implementation project(':capacitor-blob-writer')
implementation project(':capacitor-native-settings')
implementation "com.android.billingclient:billing:4.0.0"
implementation "com.android.billingclient:billing:5.2.1"
}


Expand Down
8 changes: 4 additions & 4 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -368,13 +368,13 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 870;
CURRENT_PROJECT_VERSION = 871;
DEVELOPMENT_TEAM = G7NB5YCKAP;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = G7NB5YCKAP;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.87.0;
MARKETING_VERSION = 0.87.1;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = io.numbersprotocol.capturelite;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -395,13 +395,13 @@
CODE_SIGN_ENTITLEMENTS = App/App.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 870;
CURRENT_PROJECT_VERSION = 871;
DEVELOPMENT_TEAM = G7NB5YCKAP;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = G7NB5YCKAP;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 0.87.0;
MARKETING_VERSION = 0.87.1;
PRODUCT_BUNDLE_IDENTIFIER = io.numbersprotocol.capturelite;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = NumbersAppDistributionV4;
Expand Down
39 changes: 9 additions & 30 deletions package-lock.json

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

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "capture-lite",
"version": "0.87.0",
"version": "0.87.1",
"author": "numbersprotocol",
"homepage": "https://numbersprotocol.io/",
"scripts": {
Expand Down Expand Up @@ -30,7 +30,6 @@
"@angular/platform-browser-dynamic": "^14.2.0",
"@angular/router": "^14.2.0",
"@awesome-cordova-plugins/core": "^5.46.0",
"@awesome-cordova-plugins/in-app-purchase-2": "^5.43.0",
"@capacitor-community/advertising-id": "^5.0.0",
"@capacitor-community/bluetooth-le": "^2.2.3",
"@capacitor-community/http": "github:numbersprotocol/http#fix-catch-disabled-Local-Network-case-on-iOS",
Expand Down Expand Up @@ -74,7 +73,7 @@
"capacitor-blob-writer": "^1.0.4",
"capacitor-native-settings": "^4.0.3",
"compressorjs": "^1.0.7",
"cordova-plugin-purchase": "^11.0.0",
"cordova-plugin-purchase": "^13.9.0",
"ethers": "^6.8.1",
"hammerjs": "^2.0.8",
"immutable": "^4.0.0-rc.14",
Expand Down
12 changes: 1 addition & 11 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { TestBed, waitForAsync } from '@angular/core/testing';
import { InAppPurchase2 } from '@awesome-cordova-plugins/in-app-purchase-2/ngx';
import { Platform } from '@ionic/angular';
import { AppComponent } from './app.component';
import { CapacitorPluginsTestingModule } from './shared/capacitor-plugins/capacitor-plugins-testing.module';
Expand All @@ -22,12 +21,6 @@ describe('AppComponent', () => {
is: platformIsSpy,
});

const iap2SpyMethods = ['error', 'ready', 'when', 'refresh', 'off'];
const inAppPurchase2Spy = jasmine.createSpyObj(
'InAppPurchase2',
iap2SpyMethods
);

TestBed.configureTestingModule({
declarations: [AppComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
Expand All @@ -37,10 +30,7 @@ describe('AppComponent', () => {
getTranslocoTestingModule(),
MaterialTestingModule,
],
providers: [
{ provide: Platform, useValue: platformSpy },
{ provide: InAppPurchase2, useValue: inAppPurchase2Spy },
],
providers: [{ provide: Platform, useValue: platformSpy }],
}).compileComponents();
})
);
Expand Down
2 changes: 0 additions & 2 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar';
import { BrowserModule, HammerModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouteReuseStrategy } from '@angular/router';
import { InAppPurchase2 } from '@awesome-cordova-plugins/in-app-purchase-2/ngx';
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { FormlyModule } from '@ngx-formly/core';
import { FormlyMaterialModule } from '@ngx-formly/material';
Expand Down Expand Up @@ -36,7 +35,6 @@ import { SharedModule } from './shared/shared.module';
provide: MAT_SNACK_BAR_DEFAULT_OPTIONS,
useValue: { duration: 2500 },
},
InAppPurchase2,
],
bootstrap: [AppComponent],
})
Expand Down
5 changes: 1 addition & 4 deletions src/app/features/wallets/buy-num/buy-num.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
></ion-icon>
</div>
<div class="subtitle-text">
{{ product.inAppProduct.price }}
{{ product.inAppProduct.pricing?.price }}
</div>
</div>
</ion-label>
Expand All @@ -38,9 +38,6 @@
{{
t('wallets.buyCredits.buyXCredits', { credits: product.numPoints })
}}
<ion-spinner
*ngIf="product.inAppProduct.state !== 'valid'"
></ion-spinner>
</ion-button>
</ion-item>
</ion-card>
Expand Down
8 changes: 0 additions & 8 deletions src/app/features/wallets/buy-num/buy-num.page.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { InAppPurchase2 } from '@awesome-cordova-plugins/in-app-purchase-2/ngx';
import { SharedTestingModule } from '../../../shared/shared-testing.module';

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

beforeEach(
waitForAsync(() => {
const iap2SpyMethods = ['error', 'ready', 'when', 'refresh', 'off'];
const inAppPurchase2Spy = jasmine.createSpyObj(
'InAppPurchase2',
iap2SpyMethods
);

TestBed.configureTestingModule({
declarations: [BuyNumPage],
imports: [SharedTestingModule],
providers: [{ provide: InAppPurchase2, useValue: inAppPurchase2Spy }],
}).compileComponents();

fixture = TestBed.createComponent(BuyNumPage);
Expand Down
22 changes: 18 additions & 4 deletions src/app/features/wallets/buy-num/buy-num.page.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { IAPProduct } from '@awesome-cordova-plugins/in-app-purchase-2/ngx';
import { AlertController } from '@ionic/angular';
import { TranslocoService } from '@ngneat/transloco';
import { UntilDestroy } from '@ngneat/until-destroy';
import { combineLatest } from 'rxjs';
import { map, tap } from 'rxjs/operators';
import { filter, first, map, tap } from 'rxjs/operators';
import { BlockingActionService } from '../../../shared/blocking-action/blocking-action.service';
import { InAppStoreService } from '../../../shared/in-app-store/in-app-store.service';

@UntilDestroy()
@Component({
selector: 'app-buy-num',
templateUrl: './buy-num.page.html',
Expand Down Expand Up @@ -34,21 +36,33 @@ export class BuyNumPage implements OnInit {
tap(_ => this.ref.detectChanges())
);

readonly isProcessingOrder$ = this.store.isProcessingOrder$;

constructor(
private readonly store: InAppStoreService,
private readonly ref: ChangeDetectorRef,
private readonly alertController: AlertController,
private readonly translocoService: TranslocoService
private readonly translocoService: TranslocoService,
private readonly blockingActionService: BlockingActionService
) {}

ngOnInit() {
this.store.refreshNumPointsPricing();
}

purchase(product: IAPProduct) {
purchase(product: CdvPurchase.Product) {
this.showLoadingIndicatorUntillOrderIsProcessed();
this.store.purchase(product);
}

private showLoadingIndicatorUntillOrderIsProcessed() {
const action$ = this.isProcessingOrder$.pipe(
filter(isProcessing => isProcessing === false),
first()
);
this.blockingActionService.run$(action$).subscribe();
}

async showNumPointsQuantity(numPoints: number) {
const info = this.translocoService.translate(
'wallets.buyCredits.thisPackageIncludeXCredits',
Expand Down
2 changes: 0 additions & 2 deletions src/app/shared/in-app-store/in-app-store.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { TestBed } from '@angular/core/testing';
import { InAppPurchase2 } from '@awesome-cordova-plugins/in-app-purchase-2/ngx';
import { SharedModule } from '../shared.module';

import { InAppStoreService } from './in-app-store.service';
Expand All @@ -10,7 +9,6 @@ describe('InAppStoreService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [SharedModule],
providers: [InAppPurchase2],
});
service = TestBed.inject(InAppStoreService);
});
Expand Down
Loading

0 comments on commit 6fb9378

Please sign in to comment.