Skip to content

Commit

Permalink
feat: add intel reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
fttx committed Sep 4, 2024
1 parent 0020097 commit b5130cc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="164" id="com.barcodetopc" version="4.7.2" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="165" id="com.barcodetopc" version="4.7.2" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Barcode to PC</name>
<description>Turn your smartphone in a real barcode scanner</description>
<author email="[email protected]" href="https://github.com/fttx">Filippo Tortomasi</author>
<content src="index.html" />
<access origin="https://intel.barcodetopc.com" />
<access origin="*" />
<allow-navigation href="*" />
<allow-intent href="http://*/*" />
Expand Down
2 changes: 2 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import { BtpToastComponent } from '../components/btp-toast/btp-toast';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { BtpToastService } from '../components/btp-toast/btp-toast.service';
import { BtpAlertController } from '../providers/btp-alert-controller/btp-alert-controller';
import { IntelProvider } from '../providers/intel/intel';

// Modules
// Ionic-native
Expand Down Expand Up @@ -147,6 +148,7 @@ import { BtpAlertController } from '../providers/btp-alert-controller/btp-alert-
ZebraProvider,
BtpToastService,
BtpAlertController,
IntelProvider,
]
})
export class AppModule { }
Expand Down
2 changes: 2 additions & 0 deletions src/providers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export class Config {
public static URL_FAQ = 'https://barcodetopc.com/frequently-asked-questions/';
public static URL_GITHUB_CHANGELOG = 'https://raw.githubusercontent.com/fttx/barcode-to-pc-server/master/CHANGELOG.md';

public static URL_INTEL = 'https://intel.barcodetopc.com/api/v1'

public static DOCS_ANDROID_PDA = 'https://docs.barcodetopc.com/examples/android-pda-devices/';
public static DOCS_QRBILL = 'https://docs.barcodetopc.com/special-barcodes/swiss-qr-codes/qr-bill/';

Expand Down
3 changes: 3 additions & 0 deletions src/providers/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { Utils } from './utils';
import { BtpToastService } from '../components/btp-toast/btp-toast.service';
import { BTPAlert, BtpAlertController } from './btp-alert-controller/btp-alert-controller';
import { TranslateService } from '@ngx-translate/core';
import { IntelProvider } from './intel/intel';
// Warning: do not import ScanProvider to prevent circular dependency
// To communicate with ScanProvider use global events.

Expand Down Expand Up @@ -77,6 +78,7 @@ export class ServerProvider {
private scanSessionsStorage: ScanSessionsStorage,
private utils: Utils,
private translateService: TranslateService,
private intel: IntelProvider,
) {
window['server'] = { connected: false };
}
Expand Down Expand Up @@ -640,6 +642,7 @@ export class ServerProvider {
return false;
}
this.send(new requestModelEmailIncentiveCompleted().fromObject({ email: data.email }));
this.intel.incentiveEmail(data.email);
this.alertCtrl.create({
title: this.translateService.instant('Success 🎉'),
message: this.translateService.instant('You have successfully unlocked the Free scans! Enjoy!'),
Expand Down

0 comments on commit b5130cc

Please sign in to comment.