Skip to content

Commit

Permalink
v6.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
agordn52 committed Jul 13, 2023
1 parent 6deab50 commit 3b350db
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 40 deletions.
5 changes: 4 additions & 1 deletion LabelStoreMax/.env
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ PRODUCT_PLACEHOLDER_IMAGE="https://woosignal.com/images/woocommerce-placeholder.
# Sets the default placeholder image for products with no image

AUTH_USER_KEY="AUTH_USER"
FCM_ENABLED=false
FCM_ENABLED=null

ENCRYPT_KEY=null
ENCRYPT_SECRET=null
7 changes: 7 additions & 0 deletions LabelStoreMax/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [6.9.0] - 2023-07-13

* Pull firebase config via woosignal api
* New encrypt key and secret added to .env
* fix fetchRelated to return "publish" products
* Pubspec.yaml dependency updates

## [6.8.2] - 2023-07-04

* Update gradle + kotlin versions.
Expand Down
7 changes: 5 additions & 2 deletions LabelStoreMax/lib/app/providers/app_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ class AppProvider implements NyProvider {
]);

await WooSignal.instance
.init(appKey: getEnv('APP_KEY'), debugMode: getEnv('APP_DEBUG'));
.init(appKey: getEnv('APP_KEY'), debugMode: getEnv('APP_DEBUG'),
encryptKey: getEnv('ENCRYPT_KEY', defaultValue: null),
encryptSecret: getEnv('ENCRYPT_SECRET', defaultValue: null)
);

AppHelper.instance.appConfig = WooSignalApp();
AppHelper.instance.appConfig!.themeFont = "Poppins";
Expand All @@ -46,7 +49,7 @@ class AppProvider implements NyProvider {
};

// WooSignal Setup
WooSignalApp? wooSignalApp = await (appWooSignal((api) => api.getApp()));
WooSignalApp? wooSignalApp = await (appWooSignal((api) => api.getApp(encrypted: shouldEncrypt())));
Locale locale = Locale('en');

if (wooSignalApp != null) {
Expand Down
8 changes: 7 additions & 1 deletion LabelStoreMax/lib/app/providers/firebase_provider.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter_app/bootstrap/app_helper.dart';
import 'package:flutter_app/firebase_options.dart';
import 'package:nylo_framework/nylo_framework.dart';
import 'package:woosignal/woosignal.dart';
Expand All @@ -14,7 +15,12 @@ class FirebaseProvider implements NyProvider {

@override
afterBoot(Nylo nylo) async {
if (getEnv('FCM_ENABLED', defaultValue: false) != true) return;
bool? firebaseFcmIsEnabled = AppHelper.instance.appConfig?.firebaseFcmIsEnabled;
if (firebaseFcmIsEnabled == null) {
firebaseFcmIsEnabled = getEnv('FCM_ENABLED', defaultValue: false);
}

if (firebaseFcmIsEnabled != true) return;

await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
Expand Down
2 changes: 1 addition & 1 deletion LabelStoreMax/lib/app/providers/payments/stripe_pay.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ stripePay(context,
return;
}

Navigator.pushNamed(context, "/checkout-status", arguments: order);
routeTo('/checkout-status', navigationType: NavigationType.pushAndForgetAll, data: order);
} on StripeException catch (e) {
if (getEnv('APP_DEBUG', defaultValue: true)) {
NyLogger.error(e.error.message!);
Expand Down
12 changes: 12 additions & 0 deletions LabelStoreMax/lib/bootstrap/helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -667,4 +667,16 @@ bool isProductNew(Product? product) {
NyLogger.error(e.toString());
}
return false;
}

bool shouldEncrypt() {
String? encryptKey = getEnv('ENCRYPT_KEY', defaultValue: "");
if (encryptKey == null || encryptKey == "") {
return false;
}
String? encryptSecret = getEnv('ENCRYPT_KEY', defaultValue: "");
if (encryptSecret == null || encryptSecret == "") {
return false;
}
return true;
}
47 changes: 27 additions & 20 deletions LabelStoreMax/lib/firebase_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
import 'package:flutter_app/bootstrap/app_helper.dart';

/// Default [FirebaseOptions] for use with your Firebase apps.
class DefaultFirebaseOptions {
Expand All @@ -14,9 +15,33 @@ class DefaultFirebaseOptions {
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
if (AppHelper.instance.appConfig?.firebaseOptionsAndroid == null) {
throw UnsupportedError(
'Add a valid Firebase json config on https://woosignal.com for your WooCommerce store',
);
}
return FirebaseOptions(
apiKey: AppHelper.instance.appConfig!.firebaseOptionsAndroid!['apiKey'],
appId: AppHelper.instance.appConfig!.firebaseOptionsAndroid!['appId'],
messagingSenderId: AppHelper.instance.appConfig!.firebaseOptionsAndroid!['messagingSenderId'],
projectId: AppHelper.instance.appConfig!.firebaseOptionsAndroid!['projectId'],
storageBucket: AppHelper.instance.appConfig!.firebaseOptionsAndroid!['storageBucket'],
);
case TargetPlatform.iOS:
return ios;
if (AppHelper.instance.appConfig?.firebaseOptionsIos == null) {
throw UnsupportedError(
'Add a valid Firebase plist config on https://woosignal.com for your WooCommerce store',
);
}
return FirebaseOptions(
apiKey: AppHelper.instance.appConfig!.firebaseOptionsIos!['apiKey'],
appId: AppHelper.instance.appConfig!.firebaseOptionsIos!['appId'],
messagingSenderId: AppHelper.instance.appConfig!.firebaseOptionsIos!['messagingSenderId'],
projectId: AppHelper.instance.appConfig!.firebaseOptionsIos!['projectId'],
storageBucket: AppHelper.instance.appConfig!.firebaseOptionsIos!['storageBucket'],
iosClientId: AppHelper.instance.appConfig!.firebaseOptionsIos!['iosClientId'],
iosBundleId: AppHelper.instance.appConfig!.firebaseOptionsIos!['iosBundleId'],
);
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
Expand All @@ -38,22 +63,4 @@ class DefaultFirebaseOptions {
);
}
}

static const FirebaseOptions android = FirebaseOptions(
apiKey: '',
appId: '',
messagingSenderId: '',
projectId: '',
storageBucket: '',
);

static const FirebaseOptions ios = FirebaseOptions(
apiKey: '',
appId: '',
messagingSenderId: '',
projectId: '',
storageBucket: '',
iosClientId: '',
iosBundleId: '',
);
}
2 changes: 1 addition & 1 deletion LabelStoreMax/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ void main() async {
debugShowCheckedModeBanner: false,
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ class ProductDetailRelatedProductsWidget extends StatelessWidget {
}

Future<List<Product>> fetchRelated() async => await (appWooSignal(
(api) => api.getProducts(perPage: 100, include: product!.relatedIds),
(api) => api.getProducts(perPage: 100, include: product!.relatedIds, status: "publish"),
));
}
34 changes: 25 additions & 9 deletions LabelStoreMax/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.4.2"
asn1lib:
dependency: transitive
description:
name: asn1lib
sha256: b74e3842a52c61f8819a1ec8444b4de5419b41a7465e69d4aa681445377398b0
url: "https://pub.dev"
source: hosted
version: "1.4.1"
async:
dependency: transitive
description:
Expand Down Expand Up @@ -209,6 +217,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.2.1+1"
encrypt:
dependency: transitive
description:
name: encrypt
sha256: "4fd4e4fdc21b9d7d4141823e1e6515cd94e7b8d84749504c232999fba25d9bbb"
url: "https://pub.dev"
source: hosted
version: "5.0.1"
eventify:
dependency: transitive
description:
Expand Down Expand Up @@ -617,18 +633,18 @@ packages:
dependency: "direct main"
description:
name: nylo_framework
sha256: a10e1ea240e04aa64a90a6170bc2eebd585b9c0f85b1557e323c5a49312add2b
sha256: cfd9f98313672d06ccee6db7dfe75e584e1f72d7465c649b9bb765b1112f9f2a
url: "https://pub.dev"
source: hosted
version: "5.1.1"
version: "5.1.2"
nylo_support:
dependency: transitive
description:
name: nylo_support
sha256: "09c5eace0c4fa4cef5148b3b7820fd0a8b24154c964c34c1396372315ef815d6"
sha256: "35e4938f7c18f518a9cc09dc02cadd85183530c95217fa05fe6de08d8f25fbfe"
url: "https://pub.dev"
source: hosted
version: "5.3.1"
version: "5.4.0"
octo_image:
dependency: transitive
description:
Expand Down Expand Up @@ -998,10 +1014,10 @@ packages:
dependency: "direct main"
description:
name: url_launcher
sha256: eb1e00ab44303d50dd487aab67ebc575456c146c6af44422f9c13889984c00f3
sha256: "781bd58a1eb16069412365c98597726cd8810ae27435f04b3b4d3a470bacd61e"
url: "https://pub.dev"
source: hosted
version: "6.1.11"
version: "6.1.12"
url_launcher_android:
dependency: transitive
description:
Expand Down Expand Up @@ -1142,10 +1158,10 @@ packages:
dependency: "direct main"
description:
name: woosignal
sha256: "5059a0f531149e3bd9ee70a24e76315644663462509c84771d3bb8ca403726ab"
sha256: "089a373122ae0e202e64e214ce4a549af29e589128bdc8c8a54f3da68a2355aa"
url: "https://pub.dev"
source: hosted
version: "3.7.1"
version: "3.8.0"
wp_json_api:
dependency: "direct main"
description:
Expand Down Expand Up @@ -1180,4 +1196,4 @@ packages:
version: "3.1.2"
sdks:
dart: ">=3.0.0 <4.0.0"
flutter: ">=3.7.0-0"
flutter: ">=3.10.0"
8 changes: 4 additions & 4 deletions LabelStoreMax/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Official WooSignal App Template for WooCommerce

# Label StoreMax
# Version: 6.8.2
# Version: 6.9.0
# Author: Anthony Gordon
# Homepage: https://woosignal.com
# Documentation: https://woosignal.com/docs/app/label-storemax
Expand Down Expand Up @@ -29,16 +29,16 @@ dependencies:
google_fonts: ^4.0.5
analyzer: ^5.12.0
intl: ^0.18.0
nylo_framework: ^5.1.1
woosignal: ^3.7.1
nylo_framework: ^5.1.2
woosignal: ^3.8.0
wp_json_api: ^3.3.2
cached_network_image: ^3.2.3
package_info_plus: ^4.0.2
money_formatter: ^0.0.3
flutter_web_browser: ^0.17.1
webview_flutter: 3.0.4
pull_to_refresh_flutter3: 2.0.1
url_launcher: ^6.1.6
url_launcher: ^6.1.12
bubble_tab_indicator: ^0.1.5
status_alert: ^1.0.1
math_expressions: ^2.4.0
Expand Down

0 comments on commit 3b350db

Please sign in to comment.