Skip to content

Commit

Permalink
v3.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
agordn52 committed Feb 28, 2024
1 parent bdcbf64 commit d3cc7c1
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.0.3/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.2.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.0.3/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_android-2.1.4/","native_build":true,"dependencies":[]}],"macos":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.0.3/","native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.2.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.0.3/","native_build":false,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.8/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.2.0/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.0.3/","native_build":false,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.6/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.2.0/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.0.3/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_web-2.1.0/","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2024-01-01 18:16:59.337550","version":"3.16.5"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.1.2/","native_build":true,"dependencies":[]},{"name":"flutter_secure_storage","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.2.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"android":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.1.2/","native_build":true,"dependencies":[]},{"name":"flutter_secure_storage","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage-9.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/","native_build":true,"dependencies":[]},{"name":"shared_preferences_android","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_android-2.1.4/","native_build":true,"dependencies":[]}],"macos":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.1.2/","native_build":true,"dependencies":[]},{"name":"flutter_secure_storage_macos","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_macos-3.0.1/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.4/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"shared_preferences_foundation","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_foundation-2.2.2/","shared_darwin_source":true,"native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.1.2/","native_build":false,"dependencies":[]},{"name":"flutter_secure_storage_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_linux-1.2.0/","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.8/","native_build":false,"dependencies":[]},{"name":"shared_preferences_linux","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_linux-2.2.0/","native_build":false,"dependencies":["path_provider_linux"]}],"windows":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.1.2/","native_build":false,"dependencies":[]},{"name":"flutter_secure_storage_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_windows-3.0.0/","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.7/","native_build":false,"dependencies":[]},{"name":"shared_preferences_windows","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_windows-2.2.0/","native_build":false,"dependencies":["path_provider_windows"]}],"web":[{"name":"device_info_plus","path":"/Users/anthony/.pub-cache/hosted/pub.dev/device_info_plus-9.1.2/","dependencies":[]},{"name":"flutter_secure_storage_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/flutter_secure_storage_web-1.1.2/","dependencies":[]},{"name":"shared_preferences_web","path":"/Users/anthony/.pub-cache/hosted/pub.dev/shared_preferences_web-2.1.0/","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"flutter_secure_storage","dependencies":["flutter_secure_storage_linux","flutter_secure_storage_macos","flutter_secure_storage_web","flutter_secure_storage_windows"]},{"name":"flutter_secure_storage_linux","dependencies":[]},{"name":"flutter_secure_storage_macos","dependencies":[]},{"name":"flutter_secure_storage_web","dependencies":[]},{"name":"flutter_secure_storage_windows","dependencies":["path_provider"]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_android","shared_preferences_foundation","shared_preferences_linux","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_android","dependencies":[]},{"name":"shared_preferences_foundation","dependencies":[]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]}],"date_created":"2024-02-28 19:15:10.930011","version":"3.19.1"}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [3.9.2] - 2024-02-28

* Pubspec.yaml dependency updates.

## [3.8.2] - 2024-01-01

* Update license date
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ In your flutter project add the dependency:
``` dart
dependencies:
...
woosignal: ^3.8.2
woosignal: ^3.9.2
```

### Usage example #
Expand Down
53 changes: 0 additions & 53 deletions lib/helpers/shared_pref.dart

This file was deleted.

60 changes: 36 additions & 24 deletions lib/networking/api_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

import 'dart:convert';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:device_meta/device_meta.dart';
import 'package:dio/dio.dart';
import 'package:woosignal/helpers/shared_pref.dart';
import 'dart:io' show Platform;
import 'package:flutter/foundation.dart' show kIsWeb;

class ApiProvider {
late Dio _dio;
Expand All @@ -28,34 +28,46 @@ class ApiProvider {

/// Set the device meta
Future<void> setDeviceMeta() async {
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
DeviceMeta deviceMeta =
await DeviceMeta.init(storageKey: "woosignal_woocommerce");

String? uuid = await getUUID();

if (Platform.isAndroid) {
AndroidDeviceInfo androidDeviceInfo = await deviceInfo.androidInfo;
if (kIsWeb) {
_deviceMeta = {
"model": androidDeviceInfo.device,
"brand":
androidDeviceInfo.brand.replaceAll(RegExp('[^\u0001-\u007F]'), '_'),
"manufacturer": androidDeviceInfo.manufacturer,
"version": androidDeviceInfo.version.sdkInt.toString(),
"uuid": uuid,
"platform_type": "android",
"api_version": "$_version/v3"
"model": 'X Model',
"brand": 'X Brand',
"manufacturer": "X Manufacturer",
"version": 'X Version',
"uuid": '1234567890',
"platform_type": "web",
"api_version": "$_version/v1",
"sdk_name": "woosignal-woocommerce"
};
} else if (Platform.isIOS) {
IosDeviceInfo iosDeviceInfo = await deviceInfo.iosInfo;
return;
}

if (Platform.environment.containsKey('FLUTTER_TEST')) {
_deviceMeta = {
"model": iosDeviceInfo.model,
"brand": iosDeviceInfo.name.replaceAll(RegExp('[^\u0001-\u007F]'), '_'),
"manufacturer": "Apple",
"version": iosDeviceInfo.systemVersion,
"uuid": uuid,
"platform_type": "ios",
"api_version": "$_version/v3"
"model": 'X Model',
"brand": 'X Brand',
"manufacturer": "X Manufacturer",
"version": 'X Version',
"uuid": '1234567890',
"platform_type": "testing",
"api_version": "$_version/v1",
"sdk_name": "woosignal-woocommerce"
};
return;
}
_deviceMeta = {
"model": deviceMeta.model,
"brand": deviceMeta.brand,
"manufacturer": deviceMeta.manufacturer,
"version": deviceMeta.version,
"uuid": deviceMeta.uuid,
"platform_type": deviceMeta.platformType,
"api_version": "$_version/v1",
"sdk_name": "woosignal-woocommerce"
};
}

/// set the FCM token
Expand Down
2 changes: 1 addition & 1 deletion lib/woosignal.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import 'package:encrypt/encrypt.dart' as enc;
import 'package:encrypt/encrypt.dart';

/// WooSignal Package version
const String wooSignalVersion = "3.8.1";
const String wooSignalVersion = "3.9.2";

class WooSignal {
WooSignal._privateConstructor();
Expand Down
6 changes: 2 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: woosignal
description: WooCommerce REST API for dart, connect a WooCommerce store and start developing with our interface for their API endpoints.
version: 3.8.2
version: 3.9.2
homepage: https://woosignal.com
repository: https://github.com/woosignal/flutter-woocommerce-api
issue_tracker: https://github.com/woosignal/flutter-woocommerce-api/issues
Expand All @@ -11,10 +11,8 @@ environment:

dependencies:
dio: ^5.4.0
device_info_plus: ^9.0.3
shared_preferences: ^2.2.2
device_meta: ^1.1.11
encrypt: ^5.0.3
uuid: ^4.1.0

flutter:
sdk: flutter
Expand Down

0 comments on commit d3cc7c1

Please sign in to comment.