ngx-firebase 1.1.13 → 22.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +121 -13
- package/fesm2022/ngx-firebase.mjs +158 -0
- package/fesm2022/ngx-firebase.mjs.map +1 -0
- package/package.json +39 -30
- package/types/ngx-firebase.d.ts +55 -0
- package/bundles/ngx-firebase-capacitor.umd.js +0 -763
- package/bundles/ngx-firebase-capacitor.umd.js.map +0 -1
- package/bundles/ngx-firebase-capacitor.umd.min.js +0 -16
- package/bundles/ngx-firebase-capacitor.umd.min.js.map +0 -1
- package/bundles/ngx-firebase-iap.umd.js +0 -718
- package/bundles/ngx-firebase-iap.umd.js.map +0 -1
- package/bundles/ngx-firebase-iap.umd.min.js +0 -2
- package/bundles/ngx-firebase-iap.umd.min.js.map +0 -1
- package/bundles/ngx-firebase-ionic-auth-ui.umd.js +0 -2116
- package/bundles/ngx-firebase-ionic-auth-ui.umd.js.map +0 -1
- package/bundles/ngx-firebase-ionic-auth-ui.umd.min.js +0 -16
- package/bundles/ngx-firebase-ionic-auth-ui.umd.min.js.map +0 -1
- package/bundles/ngx-firebase-ionic.umd.js +0 -979
- package/bundles/ngx-firebase-ionic.umd.js.map +0 -1
- package/bundles/ngx-firebase-ionic.umd.min.js +0 -16
- package/bundles/ngx-firebase-ionic.umd.min.js.map +0 -1
- package/bundles/ngx-firebase-testing.umd.js +0 -801
- package/bundles/ngx-firebase-testing.umd.js.map +0 -1
- package/bundles/ngx-firebase-testing.umd.min.js +0 -2
- package/bundles/ngx-firebase-testing.umd.min.js.map +0 -1
- package/bundles/ngx-firebase.umd.js +0 -2299
- package/bundles/ngx-firebase.umd.js.map +0 -1
- package/bundles/ngx-firebase.umd.min.js +0 -2
- package/bundles/ngx-firebase.umd.min.js.map +0 -1
- package/capacitor/capacitor.module.d.ts +0 -9
- package/capacitor/interfaces/config.d.ts +0 -12
- package/capacitor/interfaces/index.d.ts +0 -1
- package/capacitor/ngx-firebase-capacitor.d.ts +0 -5
- package/capacitor/ngx-firebase-capacitor.metadata.json +0 -1
- package/capacitor/package.json +0 -25
- package/capacitor/public-api.d.ts +0 -3
- package/capacitor/services/analytics-firebase-capacitor.service.d.ts +0 -9
- package/capacitor/services/crashlytics-firebase-capacitor.service.d.ts +0 -8
- package/capacitor/services/credential-factory-capacitor.service.d.ts +0 -18
- package/capacitor/services/index.d.ts +0 -3
- package/esm2015/capacitor/capacitor.module.js +0 -78
- package/esm2015/capacitor/interfaces/config.js +0 -3
- package/esm2015/capacitor/interfaces/index.js +0 -2
- package/esm2015/capacitor/ngx-firebase-capacitor.js +0 -6
- package/esm2015/capacitor/public-api.js +0 -4
- package/esm2015/capacitor/services/analytics-firebase-capacitor.service.js +0 -43
- package/esm2015/capacitor/services/crashlytics-firebase-capacitor.service.js +0 -40
- package/esm2015/capacitor/services/credential-factory-capacitor.service.js +0 -182
- package/esm2015/capacitor/services/index.js +0 -4
- package/esm2015/iap/iap.module.js +0 -32
- package/esm2015/iap/interfaces/index.js +0 -5
- package/esm2015/iap/ngx-firebase-iap.js +0 -5
- package/esm2015/iap/public-api.js +0 -5
- package/esm2015/iap/services/iap.service.js +0 -317
- package/esm2015/iap/tokens/index.js +0 -4
- package/esm2015/ionic/animations/index.js +0 -30
- package/esm2015/ionic/components/avatar/avatar.component.js +0 -98
- package/esm2015/ionic/components/avatar/index.js +0 -2
- package/esm2015/ionic/components/index.js +0 -3
- package/esm2015/ionic/components/popover-menu/index.js +0 -3
- package/esm2015/ionic/components/popover-menu/interface.js +0 -2
- package/esm2015/ionic/components/popover-menu/popover-menu.component.js +0 -34
- package/esm2015/ionic/ionic.module.js +0 -46
- package/esm2015/ionic/ngx-firebase-ionic.js +0 -5
- package/esm2015/ionic/public-api.js +0 -5
- package/esm2015/ionic/services/alerts-ionic.service.js +0 -107
- package/esm2015/ionic/services/index.js +0 -6
- package/esm2015/ionic/services/legality-dialog-ionic.service.js +0 -85
- package/esm2015/ionic/services/loading-ionic.service.js +0 -46
- package/esm2015/ionic/services/picker-ionic.service.js +0 -44
- package/esm2015/ionic/services/toast-ionic.service.js +0 -49
- package/esm2015/ionic-auth-ui/animations/index.js +0 -30
- package/esm2015/ionic-auth-ui/components/email-confirmation/email-confirmation.component.js +0 -99
- package/esm2015/ionic-auth-ui/components/email-field/email-field.component.js +0 -25
- package/esm2015/ionic-auth-ui/components/form-field/form-field.component.js +0 -82
- package/esm2015/ionic-auth-ui/components/index.js +0 -12
- package/esm2015/ionic-auth-ui/components/name-field/name-field.component.js +0 -30
- package/esm2015/ionic-auth-ui/components/or-divider/or-divider.component.js +0 -11
- package/esm2015/ionic-auth-ui/components/password-field/password-field.component.js +0 -138
- package/esm2015/ionic-auth-ui/components/password-field/passwordValidatorFunctions.js +0 -62
- package/esm2015/ionic-auth-ui/components/providers/providers.component.js +0 -70
- package/esm2015/ionic-auth-ui/components/reauthenticate/reauthenticate.component.js +0 -99
- package/esm2015/ionic-auth-ui/components/register/register.component.js +0 -142
- package/esm2015/ionic-auth-ui/components/register-with-email/register-with-email.component.js +0 -60
- package/esm2015/ionic-auth-ui/components/register-with-email-popover/register-with-email-popover.component.js +0 -26
- package/esm2015/ionic-auth-ui/components/signin/signin.component.js +0 -92
- package/esm2015/ionic-auth-ui/components/terms-field/terms-field.component.js +0 -99
- package/esm2015/ionic-auth-ui/components/user/user.component.js +0 -195
- package/esm2015/ionic-auth-ui/ionic-auth-ui.module.js +0 -92
- package/esm2015/ionic-auth-ui/ngx-firebase-ionic-auth-ui.js +0 -23
- package/esm2015/ionic-auth-ui/pages/index.js +0 -5
- package/esm2015/ionic-auth-ui/pages/register/index.js +0 -2
- package/esm2015/ionic-auth-ui/pages/register/register.page.js +0 -56
- package/esm2015/ionic-auth-ui/pages/signin/index.js +0 -2
- package/esm2015/ionic-auth-ui/pages/signin/signin.page.js +0 -78
- package/esm2015/ionic-auth-ui/pages/user/index.js +0 -2
- package/esm2015/ionic-auth-ui/pages/user/user.page.js +0 -11
- package/esm2015/ionic-auth-ui/pages/verifyemail/index.js +0 -2
- package/esm2015/ionic-auth-ui/pages/verifyemail/verifyemail.page.js +0 -85
- package/esm2015/ionic-auth-ui/public-api.js +0 -5
- package/esm2015/ngx-firebase.js +0 -6
- package/esm2015/public-api.js +0 -6
- package/esm2015/shared/guards/index.js +0 -3
- package/esm2015/shared/guards/logged-in.guard.js +0 -60
- package/esm2015/shared/guards/verify-email.guard.js +0 -41
- package/esm2015/shared/interfaces/accounts.enum.js +0 -9
- package/esm2015/shared/interfaces/authprovider.enum.js +0 -15
- package/esm2015/shared/interfaces/config.interface.js +0 -61
- package/esm2015/shared/interfaces/index.js +0 -8
- package/esm2015/shared/interfaces/main.interface.js +0 -7
- package/esm2015/shared/interfaces/providers.interface.js +0 -2
- package/esm2015/shared/interfaces/tokens.js +0 -19
- package/esm2015/shared/interfaces/ui-providers.interface.js +0 -2
- package/esm2015/shared/services/analytics.service.js +0 -24
- package/esm2015/shared/services/auth-process.service.js +0 -779
- package/esm2015/shared/services/crashlytics.service.js +0 -42
- package/esm2015/shared/services/device-info.service.js +0 -14
- package/esm2015/shared/services/firebase.service.js +0 -37
- package/esm2015/shared/services/firestore-sync.service.js +0 -60
- package/esm2015/shared/services/index.js +0 -10
- package/esm2015/shared/services/performance.service.js +0 -28
- package/esm2015/shared/services/remoteconfig.service.js +0 -49
- package/esm2015/shared/services/ui.service.js +0 -45
- package/esm2015/shared/shared.module.js +0 -175
- package/esm2015/shared/types/DisplayWidth.js +0 -9
- package/esm2015/shared/types/Location.js +0 -2
- package/esm2015/shared/types/ValueAccessorControlComponent.js +0 -85
- package/esm2015/shared/types/ValueAccessorValueComponent.js +0 -40
- package/esm2015/shared/types/index.js +0 -5
- package/esm2015/testing/fakeavatar.module.js +0 -22
- package/esm2015/testing/fakes/FakeAuthProcessService.js +0 -31
- package/esm2015/testing/fakes/FakeAvatarComponent.js +0 -13
- package/esm2015/testing/fakes/FakeFireService.js +0 -21
- package/esm2015/testing/fakes/FakeFirestoreSyncService.js +0 -11
- package/esm2015/testing/fakes/FakeIAPurchaseService.js +0 -11
- package/esm2015/testing/fakes/FakePickerService.js +0 -9
- package/esm2015/testing/fakes/FakeRemoteConfigService.js +0 -44
- package/esm2015/testing/fakes/FakeTranslateService.js +0 -21
- package/esm2015/testing/fakes/FakeUiService.js +0 -26
- package/esm2015/testing/fakes/angular-fire/FakeAngularFireAuth.js +0 -30
- package/esm2015/testing/fakes/angular-fire/FakeAngularFireFunctions.js +0 -17
- package/esm2015/testing/fakes/angular-fire/FakeAngularFirePerformance.js +0 -17
- package/esm2015/testing/fakes/angular-fire/FakeAngularFireStorage.js +0 -8
- package/esm2015/testing/fakes/angular-fire/FakeAngularFirestore.js +0 -8
- package/esm2015/testing/fakes/angular-fire/FakeUserCredential.js +0 -18
- package/esm2015/testing/fakes/index.js +0 -19
- package/esm2015/testing/ngx-firebase-testing.js +0 -6
- package/esm2015/testing/public-api.js +0 -5
- package/esm2015/testing/test.module.js +0 -66
- package/esm2015/testing/utils/index.js +0 -17
- package/esm2015/testing/utils/patchConsole.js +0 -14
- package/fesm2015/ngx-firebase-capacitor.js +0 -328
- package/fesm2015/ngx-firebase-capacitor.js.map +0 -1
- package/fesm2015/ngx-firebase-iap.js +0 -354
- package/fesm2015/ngx-firebase-iap.js.map +0 -1
- package/fesm2015/ngx-firebase-ionic-auth-ui.js +0 -1482
- package/fesm2015/ngx-firebase-ionic-auth-ui.js.map +0 -1
- package/fesm2015/ngx-firebase-ionic.js +0 -495
- package/fesm2015/ngx-firebase-ionic.js.map +0 -1
- package/fesm2015/ngx-firebase-testing.js +0 -388
- package/fesm2015/ngx-firebase-testing.js.map +0 -1
- package/fesm2015/ngx-firebase.js +0 -1509
- package/fesm2015/ngx-firebase.js.map +0 -1
- package/iap/iap.module.d.ts +0 -5
- package/iap/interfaces/index.d.ts +0 -11
- package/iap/ngx-firebase-iap.d.ts +0 -4
- package/iap/ngx-firebase-iap.metadata.json +0 -1
- package/iap/package.json +0 -23
- package/iap/public-api.d.ts +0 -4
- package/iap/services/iap.service.d.ts +0 -47
- package/iap/tokens/index.d.ts +0 -3
- package/ionic/animations/index.d.ts +0 -1
- package/ionic/components/avatar/avatar.component.d.ts +0 -27
- package/ionic/components/avatar/index.d.ts +0 -1
- package/ionic/components/index.d.ts +0 -2
- package/ionic/components/popover-menu/index.d.ts +0 -2
- package/ionic/components/popover-menu/interface.d.ts +0 -6
- package/ionic/components/popover-menu/popover-menu.component.d.ts +0 -10
- package/ionic/ionic.module.d.ts +0 -2
- package/ionic/ngx-firebase-ionic.d.ts +0 -4
- package/ionic/ngx-firebase-ionic.metadata.json +0 -1
- package/ionic/package.json +0 -30
- package/ionic/public-api.d.ts +0 -4
- package/ionic/services/alerts-ionic.service.d.ts +0 -13
- package/ionic/services/index.d.ts +0 -5
- package/ionic/services/legality-dialog-ionic.service.d.ts +0 -10
- package/ionic/services/loading-ionic.service.d.ts +0 -17
- package/ionic/services/picker-ionic.service.d.ts +0 -9
- package/ionic/services/toast-ionic.service.d.ts +0 -11
- package/ionic-auth-ui/animations/index.d.ts +0 -1
- package/ionic-auth-ui/components/email-confirmation/email-confirmation.component.d.ts +0 -31
- package/ionic-auth-ui/components/email-field/email-field.component.d.ts +0 -7
- package/ionic-auth-ui/components/form-field/form-field.component.d.ts +0 -28
- package/ionic-auth-ui/components/index.d.ts +0 -11
- package/ionic-auth-ui/components/name-field/name-field.component.d.ts +0 -8
- package/ionic-auth-ui/components/or-divider/or-divider.component.d.ts +0 -2
- package/ionic-auth-ui/components/password-field/password-field.component.d.ts +0 -34
- package/ionic-auth-ui/components/password-field/passwordValidatorFunctions.d.ts +0 -4
- package/ionic-auth-ui/components/providers/providers.component.d.ts +0 -26
- package/ionic-auth-ui/components/reauthenticate/reauthenticate.component.d.ts +0 -30
- package/ionic-auth-ui/components/register/register.component.d.ts +0 -26
- package/ionic-auth-ui/components/register-with-email/register-with-email.component.d.ts +0 -24
- package/ionic-auth-ui/components/register-with-email-popover/register-with-email-popover.component.d.ts +0 -7
- package/ionic-auth-ui/components/signin/signin.component.d.ts +0 -28
- package/ionic-auth-ui/components/terms-field/terms-field.component.d.ts +0 -27
- package/ionic-auth-ui/components/user/user.component.d.ts +0 -45
- package/ionic-auth-ui/ionic-auth-ui.module.d.ts +0 -32
- package/ionic-auth-ui/ngx-firebase-ionic-auth-ui.d.ts +0 -22
- package/ionic-auth-ui/ngx-firebase-ionic-auth-ui.metadata.json +0 -1
- package/ionic-auth-ui/package.json +0 -30
- package/ionic-auth-ui/pages/index.d.ts +0 -4
- package/ionic-auth-ui/pages/register/index.d.ts +0 -1
- package/ionic-auth-ui/pages/register/register.page.d.ts +0 -16
- package/ionic-auth-ui/pages/signin/index.d.ts +0 -1
- package/ionic-auth-ui/pages/signin/signin.page.d.ts +0 -22
- package/ionic-auth-ui/pages/user/index.d.ts +0 -1
- package/ionic-auth-ui/pages/user/user.page.d.ts +0 -3
- package/ionic-auth-ui/pages/verifyemail/index.d.ts +0 -1
- package/ionic-auth-ui/pages/verifyemail/verifyemail.page.d.ts +0 -19
- package/ionic-auth-ui/public-api.d.ts +0 -4
- package/ngx-firebase.d.ts +0 -5
- package/ngx-firebase.metadata.json +0 -1
- package/public-api.d.ts +0 -5
- package/shared/guards/index.d.ts +0 -2
- package/shared/guards/logged-in.guard.d.ts +0 -13
- package/shared/guards/verify-email.guard.d.ts +0 -11
- package/shared/interfaces/accounts.enum.d.ts +0 -7
- package/shared/interfaces/authprovider.enum.d.ts +0 -13
- package/shared/interfaces/config.interface.d.ts +0 -63
- package/shared/interfaces/index.d.ts +0 -7
- package/shared/interfaces/main.interface.d.ts +0 -13
- package/shared/interfaces/providers.interface.d.ts +0 -70
- package/shared/interfaces/tokens.d.ts +0 -16
- package/shared/interfaces/ui-providers.interface.d.ts +0 -66
- package/shared/services/analytics.service.d.ts +0 -10
- package/shared/services/auth-process.service.d.ts +0 -197
- package/shared/services/crashlytics.service.d.ts +0 -11
- package/shared/services/device-info.service.d.ts +0 -3
- package/shared/services/firebase.service.d.ts +0 -16
- package/shared/services/firestore-sync.service.d.ts +0 -16
- package/shared/services/index.d.ts +0 -9
- package/shared/services/performance.service.d.ts +0 -12
- package/shared/services/remoteconfig.service.d.ts +0 -18
- package/shared/services/ui.service.d.ts +0 -22
- package/shared/shared.module.d.ts +0 -14
- package/shared/types/DisplayWidth.d.ts +0 -7
- package/shared/types/Location.d.ts +0 -8
- package/shared/types/ValueAccessorControlComponent.d.ts +0 -27
- package/shared/types/ValueAccessorValueComponent.d.ts +0 -19
- package/shared/types/index.d.ts +0 -4
- package/testing/fakeavatar.module.d.ts +0 -2
- package/testing/fakes/FakeAuthProcessService.d.ts +0 -28
- package/testing/fakes/FakeAvatarComponent.d.ts +0 -3
- package/testing/fakes/FakeFireService.d.ts +0 -20
- package/testing/fakes/FakeFirestoreSyncService.d.ts +0 -9
- package/testing/fakes/FakeIAPurchaseService.d.ts +0 -9
- package/testing/fakes/FakePickerService.d.ts +0 -6
- package/testing/fakes/FakeRemoteConfigService.d.ts +0 -19
- package/testing/fakes/FakeTranslateService.d.ts +0 -15
- package/testing/fakes/FakeUiService.d.ts +0 -25
- package/testing/fakes/angular-fire/FakeAngularFireAuth.d.ts +0 -52
- package/testing/fakes/angular-fire/FakeAngularFireFunctions.d.ts +0 -11
- package/testing/fakes/angular-fire/FakeAngularFirePerformance.d.ts +0 -10
- package/testing/fakes/angular-fire/FakeAngularFireStorage.d.ts +0 -5
- package/testing/fakes/angular-fire/FakeAngularFirestore.d.ts +0 -5
- package/testing/fakes/angular-fire/FakeUserCredential.d.ts +0 -9
- package/testing/fakes/index.d.ts +0 -16
- package/testing/ngx-firebase-testing.d.ts +0 -5
- package/testing/ngx-firebase-testing.metadata.json +0 -1
- package/testing/package.json +0 -29
- package/testing/public-api.d.ts +0 -4
- package/testing/test.module.d.ts +0 -4
- package/testing/utils/index.d.ts +0 -5
- package/testing/utils/patchConsole.d.ts +0 -4
|
@@ -1,354 +0,0 @@
|
|
|
1
|
-
import { InjectionToken, NgModule, ɵɵdefineInjectable, ɵɵinject, NgZone, Injectable, Optional, Inject, forwardRef } from '@angular/core';
|
|
2
|
-
import { InAppPurchase2 } from '@ionic-native/in-app-purchase-2/ngx';
|
|
3
|
-
import { MalSharedConfigToken, AuthProcessService, FirebaseService } from 'ngx-firebase';
|
|
4
|
-
import { __awaiter } from 'tslib';
|
|
5
|
-
import { Platform } from '@ionic/angular';
|
|
6
|
-
import { BehaviorSubject, of, Observable } from 'rxjs';
|
|
7
|
-
import { map, distinctUntilChanged } from 'rxjs/operators';
|
|
8
|
-
import { Capacitor } from '@capacitor/core';
|
|
9
|
-
import { InAppPurchase2 as InAppPurchase2$1 } from '@ionic-native/in-app-purchase-2/ngx/index';
|
|
10
|
-
|
|
11
|
-
// This token is the official token containing the final configuration; ie. the merge between default and user provided configurations
|
|
12
|
-
const MalIAPOptionsToken = new InjectionToken('IAPOptionsToken');
|
|
13
|
-
|
|
14
|
-
// @angular/*
|
|
15
|
-
class MalIAPModule {
|
|
16
|
-
static forRoot(options) {
|
|
17
|
-
return {
|
|
18
|
-
ngModule: MalIAPModule,
|
|
19
|
-
providers: [
|
|
20
|
-
{ provide: MalIAPOptionsToken, useValue: options },
|
|
21
|
-
{
|
|
22
|
-
provide: InAppPurchase2,
|
|
23
|
-
useFactory: functionsInAppPurchase2Factory,
|
|
24
|
-
deps: [MalSharedConfigToken]
|
|
25
|
-
},
|
|
26
|
-
]
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
MalIAPModule.decorators = [
|
|
31
|
-
{ type: NgModule, args: [{},] }
|
|
32
|
-
];
|
|
33
|
-
function functionsInAppPurchase2Factory(sharedConfig) {
|
|
34
|
-
if (false === sharedConfig.services.inAppPurchase) {
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
return new InAppPurchase2();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
var IAPProductTypes;
|
|
43
|
-
(function (IAPProductTypes) {
|
|
44
|
-
IAPProductTypes["PAID_SUBSCRIPTION"] = "PAID_SUBSCRIPTION";
|
|
45
|
-
})(IAPProductTypes || (IAPProductTypes = {}));
|
|
46
|
-
|
|
47
|
-
function slimDown(p) {
|
|
48
|
-
if (Array.isArray(p)) {
|
|
49
|
-
return p.map(i => slimDown(i));
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
return { owned: p.owned, id: p.id, canPurchase: p.canPurchase, state: p.state };
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
var ProductStates;
|
|
56
|
-
(function (ProductStates) {
|
|
57
|
-
ProductStates["owned"] = "owned";
|
|
58
|
-
ProductStates["approved"] = "approved";
|
|
59
|
-
ProductStates["initiated"] = "initiated";
|
|
60
|
-
ProductStates["requested"] = "requested";
|
|
61
|
-
ProductStates["valid"] = "valid";
|
|
62
|
-
ProductStates["registered"] = "registered";
|
|
63
|
-
ProductStates["downloading"] = "downloading";
|
|
64
|
-
ProductStates["downloaded"] = "downloaded";
|
|
65
|
-
ProductStates["finsihed"] = "finished";
|
|
66
|
-
})(ProductStates || (ProductStates = {}));
|
|
67
|
-
class IAPurchaseService {
|
|
68
|
-
/*
|
|
69
|
-
private updateProduct(p: IAPProduct) {
|
|
70
|
-
const i = this.products.findIndex(item => p.id === item.id);
|
|
71
|
-
this.products[i] = p;
|
|
72
|
-
}
|
|
73
|
-
*/
|
|
74
|
-
constructor(plt, store, aps, ngZone, fire, options, sharedConfig) {
|
|
75
|
-
this.plt = plt;
|
|
76
|
-
this.store = store;
|
|
77
|
-
this.aps = aps;
|
|
78
|
-
this.ngZone = ngZone;
|
|
79
|
-
this.fire = fire;
|
|
80
|
-
this.options = options;
|
|
81
|
-
this.sharedConfig = sharedConfig;
|
|
82
|
-
this.activeStates = [
|
|
83
|
-
ProductStates.valid,
|
|
84
|
-
ProductStates.requested,
|
|
85
|
-
ProductStates.initiated,
|
|
86
|
-
ProductStates.initiated,
|
|
87
|
-
ProductStates.downloading,
|
|
88
|
-
ProductStates.downloaded,
|
|
89
|
-
ProductStates.finsihed,
|
|
90
|
-
ProductStates.owned
|
|
91
|
-
];
|
|
92
|
-
this._isLoading$ = new BehaviorSubject(false);
|
|
93
|
-
this.isLoading$ = this._isLoading$.asObservable();
|
|
94
|
-
this.isModuleEnabled = this.store && Capacitor.isNative && (false !== this.sharedConfig.services.inAppPurchase);
|
|
95
|
-
this.products$ = (this.isModuleEnabled) ? this.selectAllProducts() : of([]);
|
|
96
|
-
this.activeProducts$ = this.products$
|
|
97
|
-
.pipe(map(products => products.filter(item => this.activeStates.includes(item.state) && item.title)));
|
|
98
|
-
this.productsHeld$ = this.products$
|
|
99
|
-
.pipe(map(products => products.filter(item => item.owned)));
|
|
100
|
-
if (this.isModuleEnabled && this.options.validatorUrl) {
|
|
101
|
-
this.plt.ready().then(() => __awaiter(this, void 0, void 0, function* () {
|
|
102
|
-
this.isLoading = true;
|
|
103
|
-
this.aps.user$.subscribe(user => {
|
|
104
|
-
this.store.applicationUsername = (user === null || user === void 0 ? void 0 : user.uid) || '';
|
|
105
|
-
});
|
|
106
|
-
this.store.validator = this.options.validatorUrl;
|
|
107
|
-
/* For debug
|
|
108
|
-
this.store.when('product').updated((p: IAPProduct) => {
|
|
109
|
-
console.log('C:UPDTED>', slimDown(p));
|
|
110
|
-
});
|
|
111
|
-
*/
|
|
112
|
-
this.store.when('product').approved((p) => {
|
|
113
|
-
p.verify();
|
|
114
|
-
});
|
|
115
|
-
this.store.error((error) => {
|
|
116
|
-
this.fire.recordException(error);
|
|
117
|
-
});
|
|
118
|
-
try {
|
|
119
|
-
yield this.load(this.options.products);
|
|
120
|
-
}
|
|
121
|
-
catch (error) {
|
|
122
|
-
this.fire.recordException(error);
|
|
123
|
-
}
|
|
124
|
-
finally {
|
|
125
|
-
this.isLoading = false;
|
|
126
|
-
}
|
|
127
|
-
}));
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
this.fire.addLogMessage('Not starting IAP as not a device');
|
|
131
|
-
console.warn('Not starting IAP as not a device');
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
get isLoading() { return this._isLoading$.value; }
|
|
135
|
-
set isLoading(val) { this.ngZone.run(() => this._isLoading$.next(val)); }
|
|
136
|
-
selectAllProducts() {
|
|
137
|
-
if (this.isModuleEnabled) {
|
|
138
|
-
return new Observable(subscriber => {
|
|
139
|
-
this.store.ready(() => {
|
|
140
|
-
this.ngZone.run(() => {
|
|
141
|
-
subscriber.next(this.store.products);
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
this.store.when('product').updated((p) => {
|
|
145
|
-
this.ngZone.run(() => {
|
|
146
|
-
subscriber.next(this.store.products);
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
return of([]);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
selectProduct(product) {
|
|
156
|
-
if (this.isModuleEnabled) {
|
|
157
|
-
return new Observable(subscriber => {
|
|
158
|
-
this.store.when(product).registered((p) => {
|
|
159
|
-
this.ngZone.run(() => {
|
|
160
|
-
subscriber.next(p);
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
this.store.when(product).updated((p) => {
|
|
164
|
-
this.ngZone.run(() => {
|
|
165
|
-
subscriber.next(p);
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
return of();
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
selectIsOwned(product) {
|
|
175
|
-
return this.selectProduct(product)
|
|
176
|
-
.pipe(map(p => p.owned), distinctUntilChanged());
|
|
177
|
-
}
|
|
178
|
-
selectVerified(product = 'product') {
|
|
179
|
-
if (this.isModuleEnabled) {
|
|
180
|
-
return new Observable(subscriber => {
|
|
181
|
-
this.store.when(product).verified((p) => {
|
|
182
|
-
this.ngZone.run(() => {
|
|
183
|
-
subscriber.next(p);
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
return of();
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
selectOwned(product = 'product') {
|
|
193
|
-
if (this.isModuleEnabled) {
|
|
194
|
-
return new Observable(subscriber => {
|
|
195
|
-
this.store.when(product).owned((p) => {
|
|
196
|
-
this.ngZone.run(() => {
|
|
197
|
-
subscriber.next(p);
|
|
198
|
-
});
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
return of();
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
load(products) {
|
|
207
|
-
return new Promise((resolve, reject) => {
|
|
208
|
-
try {
|
|
209
|
-
this.fire.addLogMessage('Error registering products');
|
|
210
|
-
this.store.register(products.map(item => {
|
|
211
|
-
let type;
|
|
212
|
-
switch (item.type) {
|
|
213
|
-
case IAPProductTypes.PAID_SUBSCRIPTION:
|
|
214
|
-
type = this.store.PAID_SUBSCRIPTION;
|
|
215
|
-
break;
|
|
216
|
-
default: throw new Error('Product type not recognised');
|
|
217
|
-
}
|
|
218
|
-
return Object.assign(Object.assign({}, item), { type });
|
|
219
|
-
}));
|
|
220
|
-
}
|
|
221
|
-
catch (error) {
|
|
222
|
-
this.fire.recordException(error);
|
|
223
|
-
}
|
|
224
|
-
this.store.ready(() => {
|
|
225
|
-
// console.log('READY READY 1>', consoleDebug(this.store.products));
|
|
226
|
-
resolve(this.store.products);
|
|
227
|
-
});
|
|
228
|
-
this.store.error((error) => {
|
|
229
|
-
this.fire.recordException(error);
|
|
230
|
-
reject(error);
|
|
231
|
-
});
|
|
232
|
-
try {
|
|
233
|
-
this.fire.addLogMessage('Starting store refresh');
|
|
234
|
-
this.store.refresh();
|
|
235
|
-
}
|
|
236
|
-
catch (error) {
|
|
237
|
-
this.fire.recordException(error);
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
purchase(product, waitForOwned = true) {
|
|
242
|
-
try {
|
|
243
|
-
if (!this.isModuleEnabled) {
|
|
244
|
-
throw new Error('IAP Module not enabled');
|
|
245
|
-
}
|
|
246
|
-
if (!this.store.applicationUsername) {
|
|
247
|
-
throw new Error('Unable to puchase when store.applicationUsername is not set');
|
|
248
|
-
}
|
|
249
|
-
return new Observable(subscriber => {
|
|
250
|
-
this.store.when(product).requested((p) => {
|
|
251
|
-
subscriber.next(p);
|
|
252
|
-
});
|
|
253
|
-
this.store.when(product).initiated((p) => {
|
|
254
|
-
subscriber.next(p);
|
|
255
|
-
});
|
|
256
|
-
this.store.when(product).approved((p) => {
|
|
257
|
-
subscriber.next(p);
|
|
258
|
-
});
|
|
259
|
-
this.store.when(product).verified((p) => __awaiter(this, void 0, void 0, function* () {
|
|
260
|
-
// console.log('P:VERIFIED>', consoleDebug(p));
|
|
261
|
-
subscriber.next(p);
|
|
262
|
-
if (!waitForOwned) {
|
|
263
|
-
subscriber.complete();
|
|
264
|
-
} // HERE WE ARE RELAIANT ON SOMETHING EXTERNAL FULLFILLING
|
|
265
|
-
}));
|
|
266
|
-
this.store.once(product).owned((p) => __awaiter(this, void 0, void 0, function* () {
|
|
267
|
-
// console.log('P:OWNED>', consoleDebug(p));
|
|
268
|
-
subscriber.next(p);
|
|
269
|
-
subscriber.complete();
|
|
270
|
-
}));
|
|
271
|
-
this.store.once(product).cancelled((p) => {
|
|
272
|
-
// console.log('P:CANCELLED>', consoleDebug(p));
|
|
273
|
-
subscriber.next(p);
|
|
274
|
-
subscriber.complete();
|
|
275
|
-
});
|
|
276
|
-
this.store.once(product).error((error) => {
|
|
277
|
-
this.fire.recordException(error);
|
|
278
|
-
subscriber.error(error);
|
|
279
|
-
});
|
|
280
|
-
this.store.order(product).then((p) => {
|
|
281
|
-
// Purchase in progress!
|
|
282
|
-
}, (error) => {
|
|
283
|
-
this.fire.recordException(error);
|
|
284
|
-
subscriber.error(error);
|
|
285
|
-
});
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
catch (error) {
|
|
289
|
-
this.fire.recordException(error);
|
|
290
|
-
throw error;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
finish(product) {
|
|
294
|
-
try {
|
|
295
|
-
if (!this.isModuleEnabled) {
|
|
296
|
-
throw new Error('IAP Module not enabled');
|
|
297
|
-
}
|
|
298
|
-
return new Promise((resolve, reject) => {
|
|
299
|
-
this.store.once(product).owned((p) => {
|
|
300
|
-
// console.log('P:OWNED>', consoleDebug(p));
|
|
301
|
-
resolve(p);
|
|
302
|
-
});
|
|
303
|
-
this.store.once(product).error((error) => {
|
|
304
|
-
this.fire.recordException(error);
|
|
305
|
-
reject(error);
|
|
306
|
-
});
|
|
307
|
-
try {
|
|
308
|
-
this.fire.addLogMessage('Starting finsih product');
|
|
309
|
-
product.finish();
|
|
310
|
-
}
|
|
311
|
-
catch (error) {
|
|
312
|
-
this.fire.recordException(error);
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
}
|
|
316
|
-
catch (error) {
|
|
317
|
-
this.fire.recordException(error);
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
// To comply with AppStore rules
|
|
321
|
-
refresh() {
|
|
322
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
323
|
-
if (this.isModuleEnabled) {
|
|
324
|
-
try {
|
|
325
|
-
this.fire.addLogMessage('Starting store refresh');
|
|
326
|
-
yield this.store.refresh();
|
|
327
|
-
}
|
|
328
|
-
catch (error) {
|
|
329
|
-
this.fire.recordException(error);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
IAPurchaseService.ɵprov = ɵɵdefineInjectable({ factory: function IAPurchaseService_Factory() { return new IAPurchaseService(ɵɵinject(Platform), ɵɵinject(InAppPurchase2$1, 8), ɵɵinject(AuthProcessService), ɵɵinject(NgZone), ɵɵinject(FirebaseService), ɵɵinject(MalIAPOptionsToken), ɵɵinject(MalSharedConfigToken)); }, token: IAPurchaseService, providedIn: "root" });
|
|
336
|
-
IAPurchaseService.decorators = [
|
|
337
|
-
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
338
|
-
];
|
|
339
|
-
IAPurchaseService.ctorParameters = () => [
|
|
340
|
-
{ type: Platform },
|
|
341
|
-
{ type: InAppPurchase2, decorators: [{ type: Optional }] },
|
|
342
|
-
{ type: AuthProcessService },
|
|
343
|
-
{ type: NgZone },
|
|
344
|
-
{ type: FirebaseService },
|
|
345
|
-
{ type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalIAPOptionsToken),] }] },
|
|
346
|
-
{ type: undefined, decorators: [{ type: Inject, args: [forwardRef(() => MalSharedConfigToken),] }] }
|
|
347
|
-
];
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Generated bundle index. Do not edit.
|
|
351
|
-
*/
|
|
352
|
-
|
|
353
|
-
export { IAPProductTypes, IAPurchaseService, MalIAPModule, MalIAPOptionsToken, ProductStates, slimDown };
|
|
354
|
-
//# sourceMappingURL=ngx-firebase-iap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-firebase-iap.js","sources":["../../../projects/ngx-firebase/iap/src/tokens/index.ts","../../../projects/ngx-firebase/iap/src/iap.module.ts","../../../projects/ngx-firebase/iap/src/interfaces/index.ts","../../../projects/ngx-firebase/iap/src/services/iap.service.ts","../../../projects/ngx-firebase/iap/src/ngx-firebase-iap.ts"],"sourcesContent":["// This token is the official token containing the final configuration; ie. the merge between default and user provided configurations\nimport { InjectionToken } from '@angular/core';\nimport { MalIAPOptions } from '../interfaces';\n\nexport const MalIAPOptionsToken = new InjectionToken<MalIAPOptions[]>('IAPOptionsToken');\n","// @angular/*\nimport { ModuleWithProviders, NgModule } from '@angular/core';\nimport { InAppPurchase2 } from '@ionic-native/in-app-purchase-2/ngx';\nimport { MalSharedConfig, MalSharedConfigToken } from 'ngx-firebase';\nimport { MalIAPOptions } from './interfaces';\nimport { MalIAPOptionsToken } from './tokens';\n\n@NgModule({})\nexport class MalIAPModule {\n\n static forRoot(options: MalIAPOptions): ModuleWithProviders<MalIAPModule> {\n return {\n ngModule: MalIAPModule,\n providers:\n [\n { provide: MalIAPOptionsToken, useValue: options },\n {\n provide: InAppPurchase2,\n useFactory: functionsInAppPurchase2Factory,\n deps: [MalSharedConfigToken]\n },\n ]\n };\n }\n\n}\n\nfunction functionsInAppPurchase2Factory(sharedConfig: MalSharedConfig): InAppPurchase2 | undefined {\n if (false === sharedConfig.services.inAppPurchase) {\n return undefined;\n } else {\n return new InAppPurchase2();\n }\n}","import { IAPProductOptions } from '@ionic-native/in-app-purchase-2/ngx';\n\nexport enum IAPProductTypes {\n PAID_SUBSCRIPTION = 'PAID_SUBSCRIPTION'\n}\n\nexport interface MalIAPProductOptions extends IAPProductOptions {\n type: IAPProductTypes;\n}\n\nexport interface MalIAPOptions {\n validatorUrl: string;\n products: MalIAPProductOptions[];\n}\n","import { forwardRef, Inject, Injectable, NgZone, Optional } from '@angular/core';\nimport { AuthProcessService, FirebaseService, MalSharedConfig, MalSharedConfigToken } from 'ngx-firebase';\nimport { Platform } from '@ionic/angular';\nimport { InAppPurchase2, IAPProduct } from '@ionic-native/in-app-purchase-2/ngx';\nimport { BehaviorSubject, Observable, of } from 'rxjs';\nimport { distinctUntilChanged, map } from 'rxjs/operators';\nimport { Capacitor } from '@capacitor/core';\nimport { MalIAPOptionsToken } from '../tokens';\nimport { IAPProductTypes, MalIAPOptions, MalIAPProductOptions } from '../interfaces';\n\nexport function slimDown(p: IAPProduct[]): Partial<IAPProduct>[];\nexport function slimDown(p: IAPProduct): Partial<IAPProduct>;\nexport function slimDown(p: IAPProduct | IAPProduct[]): Partial<IAPProduct> | Partial<IAPProduct>[] {\n if (Array.isArray(p)) {\n return p.map(i => slimDown(i));\n } else {\n return { owned: p.owned, id: p.id, canPurchase: p.canPurchase, state: p.state };\n }\n}\n\nexport enum ProductStates {\n owned = 'owned',\n approved = 'approved',\n initiated = 'initiated',\n requested = 'requested',\n valid = 'valid',\n registered = 'registered',\n downloading = 'downloading',\n downloaded = 'downloaded',\n finsihed = 'finished'\n\n}\n\n@Injectable({ providedIn: 'root' })\nexport class IAPurchaseService {\n\n readonly activeStates: string[] = [\n ProductStates.valid,\n ProductStates.requested,\n ProductStates.initiated,\n ProductStates.initiated,\n ProductStates.downloading,\n ProductStates.downloaded,\n ProductStates.finsihed,\n ProductStates.owned\n ] as string[];\n\n private _isLoading$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false);\n public isLoading$ = this._isLoading$.asObservable();\n public get isLoading(): boolean { return this._isLoading$.value; }\n public set isLoading(val: boolean) { this.ngZone.run(() => this._isLoading$.next(val)); }\n\n private readonly isModuleEnabled = this.store && Capacitor.isNative && (false !== this.sharedConfig.services.inAppPurchase);\n\n public readonly products$: Observable<IAPProduct[]> = (this.isModuleEnabled) ? this.selectAllProducts() : of([]);\n\n public readonly activeProducts$: Observable<IAPProduct[]> = this.products$\n .pipe(\n map(products => products.filter(item => this.activeStates.includes(item.state) && item.title))\n );\n\n public readonly productsHeld$: Observable<IAPProduct[]> = this.products$\n .pipe(map(products => products.filter(item => item.owned)));\n\n selectAllProducts(): Observable<IAPProduct[]> {\n if (this.isModuleEnabled) {\n return new Observable<IAPProduct[]>(subscriber => {\n this.store.ready(() => {\n this.ngZone.run(() => {\n subscriber.next(this.store.products);\n });\n });\n this.store.when('product').updated((p: IAPProduct) => {\n this.ngZone.run(() => {\n subscriber.next(this.store.products);\n });\n });\n });\n } else {\n return of([]);\n }\n }\n\n selectProduct(product: string | IAPProduct): Observable<IAPProduct> {\n if (this.isModuleEnabled) {\n return new Observable<IAPProduct>(subscriber => {\n this.store.when(product).registered((p: IAPProduct) => {\n this.ngZone.run(() => {\n subscriber.next(p);\n });\n });\n this.store.when(product).updated((p: IAPProduct) => {\n this.ngZone.run(() => {\n subscriber.next(p);\n });\n });\n });\n } else {\n return of();\n }\n }\n\n selectIsOwned(product: string | IAPProduct): Observable<boolean> {\n return this.selectProduct(product)\n .pipe(\n map(p => p.owned),\n distinctUntilChanged()\n );\n }\n\n selectVerified(product: string | IAPProduct = 'product'): Observable<IAPProduct> {\n if (this.isModuleEnabled) {\n return new Observable<IAPProduct>(subscriber => {\n this.store.when(product).verified((p: IAPProduct) => {\n this.ngZone.run(() => {\n subscriber.next(p);\n });\n });\n });\n } else {\n return of();\n }\n }\n\n selectOwned(product: string | IAPProduct = 'product'): Observable<IAPProduct> {\n if (this.isModuleEnabled) {\n return new Observable<IAPProduct>(subscriber => {\n this.store.when(product).owned((p: IAPProduct) => {\n this.ngZone.run(() => {\n subscriber.next(p);\n });\n });\n });\n } else {\n return of();\n }\n }\n\n /*\n private updateProduct(p: IAPProduct) {\n const i = this.products.findIndex(item => p.id === item.id);\n this.products[i] = p;\n }\n */\n\n constructor(\n private plt: Platform,\n @Optional() private store: InAppPurchase2,\n private aps: AuthProcessService,\n private ngZone: NgZone,\n private fire: FirebaseService,\n @Inject(forwardRef(() => MalIAPOptionsToken)) private options: MalIAPOptions,\n @Inject(forwardRef(() => MalSharedConfigToken)) private sharedConfig: MalSharedConfig\n ) {\n if (this.isModuleEnabled && this.options.validatorUrl) {\n this.plt.ready().then(async () => {\n this.isLoading = true;\n\n this.aps.user$.subscribe(\n user => {\n this.store.applicationUsername = user?.uid || '';\n }\n );\n\n this.store.validator = this.options.validatorUrl;\n\n /* For debug\n this.store.when('product').updated((p: IAPProduct) => {\n console.log('C:UPDTED>', slimDown(p));\n });\n */\n this.store.when('product').approved((p: IAPProduct) => {\n p.verify();\n });\n\n this.store.error((error: any) => {\n this.fire.recordException(error);\n });\n\n try {\n await this.load(this.options.products);\n } catch (error) {\n this.fire.recordException(error);\n } finally {\n this.isLoading = false;\n }\n\n });\n } else {\n this.fire.addLogMessage('Not starting IAP as not a device');\n console.warn('Not starting IAP as not a device');\n }\n }\n\n private load(products: MalIAPProductOptions[]): Promise<IAPProduct[]> {\n return new Promise<IAPProduct[]>((resolve, reject) => {\n try {\n this.fire.addLogMessage('Error registering products');\n this.store.register(products.map(item => {\n let type: string;\n switch (item.type) {\n case IAPProductTypes.PAID_SUBSCRIPTION: type = this.store.PAID_SUBSCRIPTION; break;\n default: throw new Error('Product type not recognised');\n }\n return {\n ...item,\n type\n };\n }));\n } catch (error) {\n this.fire.recordException(error);\n }\n\n this.store.ready(() => {\n // console.log('READY READY 1>', consoleDebug(this.store.products));\n resolve(this.store.products);\n });\n\n this.store.error((error: any) => {\n this.fire.recordException(error);\n reject(error);\n });\n\n try {\n this.fire.addLogMessage('Starting store refresh');\n this.store.refresh();\n } catch (error) {\n this.fire.recordException(error);\n }\n\n });\n }\n\n purchase(product: IAPProduct | string, waitForOwned = true): Observable<IAPProduct> {\n try {\n\n if (!this.isModuleEnabled) {\n throw new Error('IAP Module not enabled');\n }\n if (!this.store.applicationUsername) {\n throw new Error('Unable to puchase when store.applicationUsername is not set');\n }\n return new Observable<IAPProduct>(subscriber => {\n this.store.when(product).requested((p: IAPProduct) => {\n subscriber.next(p);\n });\n this.store.when(product).initiated((p: IAPProduct) => {\n subscriber.next(p);\n });\n this.store.when(product).approved((p: IAPProduct) => {\n subscriber.next(p);\n });\n this.store.when(product).verified(async (p: IAPProduct) => {\n // console.log('P:VERIFIED>', consoleDebug(p));\n subscriber.next(p);\n if (!waitForOwned) {\n subscriber.complete();\n } // HERE WE ARE RELAIANT ON SOMETHING EXTERNAL FULLFILLING\n });\n this.store.once(product).owned(async (p: IAPProduct) => {\n // console.log('P:OWNED>', consoleDebug(p));\n subscriber.next(p);\n subscriber.complete();\n });\n this.store.once(product).cancelled((p: IAPProduct) => {\n // console.log('P:CANCELLED>', consoleDebug(p));\n subscriber.next(p);\n subscriber.complete();\n });\n this.store.once(product).error((error: any) => {\n this.fire.recordException(error);\n subscriber.error(error);\n });\n this.store.order(product).then((p: any) => {\n // Purchase in progress!\n }, (error: any) => {\n this.fire.recordException(error);\n subscriber.error(error);\n });\n });\n } catch (error) {\n this.fire.recordException(error);\n throw error;\n }\n }\n\n finish(product: IAPProduct): Promise<IAPProduct> {\n try {\n if (!this.isModuleEnabled) {\n throw new Error('IAP Module not enabled');\n }\n return new Promise<IAPProduct>((resolve, reject) => {\n this.store.once(product).owned((p: IAPProduct) => {\n // console.log('P:OWNED>', consoleDebug(p));\n resolve(p);\n });\n this.store.once(product).error((error: any) => {\n this.fire.recordException(error);\n reject(error);\n });\n try {\n this.fire.addLogMessage('Starting finsih product');\n product.finish();\n } catch (error) {\n this.fire.recordException(error);\n }\n });\n } catch (error) {\n this.fire.recordException(error);\n }\n }\n\n // To comply with AppStore rules\n async refresh() {\n if (this.isModuleEnabled) {\n try {\n this.fire.addLogMessage('Starting store refresh');\n await this.store.refresh();\n } catch (error) {\n this.fire.recordException(error);\n }\n }\n }\n\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAAA;MAIa,kBAAkB,GAAG,IAAI,cAAc,CAAkB,iBAAiB;;ACJvF;MAQa,YAAY;IAEvB,OAAO,OAAO,CAAC,OAAsB;QACnC,OAAO;YACL,QAAQ,EAAE,YAAY;YACtB,SAAS,EACP;gBACE,EAAE,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,OAAO,EAAE;gBAClD;oBACE,OAAO,EAAE,cAAc;oBACvB,UAAU,EAAE,8BAA8B;oBAC1C,IAAI,EAAE,CAAC,oBAAoB,CAAC;iBAC7B;aACF;SACJ,CAAC;KACH;;;YAhBF,QAAQ,SAAC,EAAE;;AAoBZ,SAAS,8BAA8B,CAAC,YAA6B;IACnE,IAAI,KAAK,KAAK,YAAY,CAAC,QAAQ,CAAC,aAAa,EAAE;QACjD,OAAO,SAAS,CAAC;KAClB;SAAM;QACL,OAAO,IAAI,cAAc,EAAE,CAAC;KAC7B;AACH;;IC/BY;AAAZ,WAAY,eAAe;IACvB,0DAAuC,CAAA;AAC3C,CA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