diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..e0f15db2
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "java.configuration.updateBuildConfiguration": "automatic"
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index b90d909a..4aa912c0 100644
--- a/package.json
+++ b/package.json
@@ -57,6 +57,10 @@
"@aries-framework/react-hooks": "patch:@aries-framework/react-hooks@npm:0.4.2#./.yarn/patches/@aries-framework-react-hooks-npm-0.4.2-84b7eb8764.patch"
},
"dependencies": {
+ "lottie-react-native": "^6.6.0",
+ "react-native-ble-manager": "^11.5.3",
+ "react-native-ble-plx": "^3.1.2",
+ "react-native-maps": "^1.15.4",
"react-native-qrcode-svg": "^6.2.0",
"react-native-svg": "^14.1.0"
}
diff --git a/packages/legacy/app/android/app/build.gradle b/packages/legacy/app/android/app/build.gradle
index 9dce9ed5..ec1d11a6 100644
--- a/packages/legacy/app/android/app/build.gradle
+++ b/packages/legacy/app/android/app/build.gradle
@@ -143,7 +143,23 @@ dependencies {
} else {
implementation jscFlavor
}
+ implementation 'com.polidea.rxandroidble2:dagger-library-shadow:1.17.2'
+ implementation 'org.reactivestreams:reactive-streams:1.0.3'
+ implementation 'io.reactivex.rxjava2:rxjava:2.2.17'
+ implementation 'com.jakewharton.rxrelay2:rxrelay:2.1.1'
+ implementation 'com.polidea.rxandroidble2:rxandroidble:1.17.2'
}
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
+
+tasks.withType(JavaCompile) {
+ options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
+}
+
+// Explicitly declare the dependency between lintAnalyzeDebug and copyReactNativeVectorIconFonts
+tasks.whenTaskAdded { task ->
+ if (task.name.startsWith("lintAnalyze")) {
+ task.dependsOn("copyReactNativeVectorIconFonts")
+ }
+}
diff --git a/packages/legacy/app/android/app/src/main/AndroidManifest.xml b/packages/legacy/app/android/app/src/main/AndroidManifest.xml
index 8685f74d..bf0bc061 100644
--- a/packages/legacy/app/android/app/src/main/AndroidManifest.xml
+++ b/packages/legacy/app/android/app/src/main/AndroidManifest.xml
@@ -1,6 +1,22 @@
+ xmlns:tools="http://schemas.android.com/tools"
+ package="com.ariesbifold">
+
+
+
+
+
+
+
+
+
+
+
+
@@ -9,25 +25,27 @@
-
-
-
-
-
-
+ android:icon="@mipmap/basic_swish"
+ android:allowBackup="false"
+ android:resizeableActivity="false"
+ android:theme="@style/AppTheme"
+ android:usesCleartextTraffic="true"
+ tools:replace="android:label, android:icon, android:allowBackup, android:resizeableActivity, android:theme, android:usesCleartextTraffic">
+
+
+
+
+
+
diff --git a/packages/legacy/app/android/app/src/main/java/com/ariesbifold/BleAdvertiseModule.java b/packages/legacy/app/android/app/src/main/java/com/ariesbifold/BleAdvertiseModule.java
new file mode 100644
index 00000000..73a36b7a
--- /dev/null
+++ b/packages/legacy/app/android/app/src/main/java/com/ariesbifold/BleAdvertiseModule.java
@@ -0,0 +1,312 @@
+package com.ariesbifold;
+
+import com.facebook.react.common.StandardCharsets;
+import com.facebook.react.bridge.*;
+import com.facebook.react.modules.core.DeviceEventManagerModule;
+
+import android.bluetooth.BluetoothGattCharacteristic;
+import android.bluetooth.BluetoothGattServer;
+import android.bluetooth.BluetoothGattServerCallback;
+import android.bluetooth.BluetoothGattService;
+import android.content.Context;
+import android.util.Log;
+import android.bluetooth.BluetoothAdapter;
+import android.bluetooth.BluetoothManager;
+import android.bluetooth.le.AdvertiseCallback;
+import android.bluetooth.le.AdvertiseData;
+import android.bluetooth.le.AdvertiseSettings;
+import android.bluetooth.le.BluetoothLeAdvertiser;
+import android.content.BroadcastReceiver;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.ParcelUuid;
+
+import com.facebook.react.bridge.WritableMap;
+import com.facebook.react.bridge.Arguments;
+
+import java.util.UUID;
+import java.util.HashMap;
+import java.util.Map;
+import java.lang.Object;
+import java.util.Hashtable;
+import java.util.Set;
+
+public class BleAdvertiseModule extends ReactContextBaseJavaModule {
+ private static final UUID CHARACTERISTIC_UUID = UUID.fromString("d918d942-8516-4165-922f-dd6823d32b2f");
+ public static final String TAG = "BleAdvertise";
+ private BluetoothManager mBluetoothManager;
+ private BluetoothAdapter mBluetoothAdapter;
+ private BluetoothGattServer gattServer;
+ private static Hashtable mAdvertiserList;
+ private static Hashtable mAdvertiserCallbackList;
+ private int companyId;
+ private Boolean mObservedState;
+
+ //Constructor
+ public BleAdvertiseModule(ReactApplicationContext reactContext) {
+ super(reactContext);
+
+ mAdvertiserList = new Hashtable();
+ mAdvertiserCallbackList = new Hashtable();
+
+ mBluetoothManager = (BluetoothManager) reactContext.getApplicationContext()
+ .getSystemService(Context.BLUETOOTH_SERVICE);
+ if (mBluetoothManager != null) {
+ mBluetoothAdapter = mBluetoothManager.getAdapter();
+ }
+
+ if (mBluetoothAdapter != null) {
+ mObservedState = mBluetoothAdapter.isEnabled();
+ }
+
+ this.companyId = 0x0000;
+
+ IntentFilter filter = new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED);
+ reactContext.registerReceiver(mReceiver, filter);
+ }
+
+ private final BluetoothGattServerCallback gattServerCallback = new BluetoothGattServerCallback() {
+ @Override
+ public void onCharacteristicWriteRequest(android.bluetooth.BluetoothDevice device, int requestId, BluetoothGattCharacteristic characteristic, boolean preparedWrite, boolean responseNeeded, int offset, byte[] value) {
+ if (CHARACTERISTIC_UUID.equals(characteristic.getUuid())) {
+ characteristic.setValue(value);
+ if (responseNeeded) {
+ gattServer.sendResponse(device, requestId, android.bluetooth.BluetoothGatt.GATT_SUCCESS, offset, value);
+ }
+ WritableMap map = Arguments.createMap();
+ map.putString("data", new String(value, StandardCharsets.UTF_8));
+ Log.d(TAG, "data:" + value + "_________" + new String(value, StandardCharsets.UTF_8));
+ sendEvent("onRead", map);
+ }
+ }
+ };
+
+ @Override
+ public String getName() {
+ return "BleAdvertise";
+ }
+
+ @Override
+ public Map getConstants() {
+ final Map constants = new HashMap<>();
+ constants.put("ADVERTISE_MODE_BALANCED", AdvertiseSettings.ADVERTISE_MODE_BALANCED);
+ constants.put("ADVERTISE_MODE_LOW_LATENCY", AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY);
+ constants.put("ADVERTISE_MODE_LOW_POWER", AdvertiseSettings.ADVERTISE_MODE_LOW_POWER);
+ constants.put("ADVERTISE_TX_POWER_HIGH", AdvertiseSettings.ADVERTISE_TX_POWER_HIGH);
+ constants.put("ADVERTISE_TX_POWER_LOW", AdvertiseSettings.ADVERTISE_TX_POWER_LOW);
+ constants.put("ADVERTISE_TX_POWER_MEDIUM", AdvertiseSettings.ADVERTISE_TX_POWER_MEDIUM);
+ constants.put("ADVERTISE_TX_POWER_ULTRA_LOW", AdvertiseSettings.ADVERTISE_TX_POWER_ULTRA_LOW);
+
+ return constants;
+ }
+
+ @ReactMethod
+ public void setCompanyId(int companyId) {
+ this.companyId = companyId;
+ }
+
+ @ReactMethod
+ public void broadcast(String uid, String cuid, ReadableMap options, Promise promise) {
+ ReactApplicationContext reactContext = getReactApplicationContext();
+
+ if (companyId == 0x0000) {
+ Log.w("BleAdvertiseModule", "Invalid company id");
+ promise.reject("Invalid company id");
+ return;
+ }
+
+ if (mBluetoothAdapter == null) {
+ Log.w("BleAdvertiseModule", "mBluetoothAdapter unavailable");
+ promise.reject("mBluetoothAdapter unavailable");
+ return;
+ }
+
+ if (mObservedState != null && !mObservedState) {
+ Log.w("BleAdvertiseModule", "Bluetooth disabled");
+ promise.reject("Bluetooth disabled");
+ return;
+ }
+
+ BluetoothGattService service = new BluetoothGattService(UUID.fromString(uid), BluetoothGattService.SERVICE_TYPE_PRIMARY);
+ BluetoothGattCharacteristic characteristic = new BluetoothGattCharacteristic(
+ UUID.fromString(cuid),
+ BluetoothGattCharacteristic.PROPERTY_READ | BluetoothGattCharacteristic.PROPERTY_WRITE,
+ BluetoothGattCharacteristic.PERMISSION_READ | BluetoothGattCharacteristic.PERMISSION_WRITE
+ );
+ service.addCharacteristic(characteristic);
+ gattServer = mBluetoothManager.openGattServer(reactContext, gattServerCallback);
+ gattServer.addService(service);
+
+ BluetoothLeAdvertiser tempAdvertiser;
+ AdvertiseCallback tempCallback;
+
+ if (mAdvertiserList.containsKey(uid)) {
+ tempAdvertiser = mAdvertiserList.remove(uid);
+ tempCallback = mAdvertiserCallbackList.remove(uid);
+
+ tempAdvertiser.stopAdvertising(tempCallback);
+ } else {
+ tempAdvertiser = mBluetoothAdapter.getBluetoothLeAdvertiser();
+ tempCallback = new BleAdvertiseModule.SimpleAdvertiseCallback(promise);
+ }
+
+ if (tempAdvertiser == null) {
+ Log.w("BleAdvertiseModule", "Advertiser Not Available unavailable");
+ promise.reject("Advertiser unavailable on this device");
+ return;
+ }
+
+ AdvertiseSettings settings = buildAdvertiseSettings();
+ AdvertiseData data = buildAdvertiseData(ParcelUuid.fromString(uid), options);
+
+ tempAdvertiser.startAdvertising(settings, data, tempCallback);
+
+ mAdvertiserList.put(uid, tempAdvertiser);
+ mAdvertiserCallbackList.put(uid, tempCallback);
+ }
+
+ @ReactMethod
+ public void stopBroadcast(final Promise promise) {
+ Log.w("BleAdvertiseModule", "Stop Broadcast call");
+
+ if (mBluetoothAdapter == null) {
+ Log.w("BleAdvertiseModule", "mBluetoothAdapter unavailable");
+ promise.reject("mBluetoothAdapter unavailable");
+ return;
+ }
+
+ if (mObservedState != null && !mObservedState) {
+ Log.w("BleAdvertiseModule", "Bluetooth disabled");
+ promise.reject("Bluetooth disabled");
+ return;
+ }
+
+ WritableArray promiseArray = Arguments.createArray();
+
+ Set keys = mAdvertiserList.keySet();
+ for (String key : keys) {
+ BluetoothLeAdvertiser tempAdvertiser = mAdvertiserList.remove(key);
+ AdvertiseCallback tempCallback = mAdvertiserCallbackList.remove(key);
+ if (tempAdvertiser != null) {
+ tempAdvertiser.stopAdvertising(tempCallback);
+ promiseArray.pushString(key);
+ }
+ }
+
+ promise.resolve(promiseArray);
+ }
+
+ @ReactMethod
+ public void addListener(String eventName) {
+
+ }
+
+ @ReactMethod
+ public void removeListeners(Integer count) {
+
+ }
+
+ private AdvertiseSettings buildAdvertiseSettings() {
+ AdvertiseSettings.Builder settingsBuilder = new AdvertiseSettings.Builder()
+ .setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY)
+ .setTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_HIGH)
+ .setConnectable(true);
+
+ return settingsBuilder.build();
+ }
+
+ private AdvertiseData buildAdvertiseData(ParcelUuid uuid, ReadableMap options) {
+ AdvertiseData.Builder dataBuilder = new AdvertiseData.Builder()
+ .setIncludeDeviceName(true)
+ .setIncludeTxPowerLevel(false)
+ .addServiceUuid(uuid);
+
+ return dataBuilder.build();
+ }
+
+ private class SimpleAdvertiseCallback extends AdvertiseCallback {
+ Promise promise;
+
+ public SimpleAdvertiseCallback () {
+ }
+
+ public SimpleAdvertiseCallback (Promise promise) {
+ this.promise = promise;
+ }
+
+ @Override
+ public void onStartFailure(int errorCode) {
+ super.onStartFailure(errorCode);
+ Log.i(TAG, "Advertising failed with code "+ errorCode);
+
+ if (promise == null) return;
+
+ switch (errorCode) {
+ case ADVERTISE_FAILED_FEATURE_UNSUPPORTED:
+ promise.reject("This feature is not supported on this platform."); break;
+ case ADVERTISE_FAILED_TOO_MANY_ADVERTISERS:
+ promise.reject("Failed to start advertising because no advertising instance is available."); break;
+ case ADVERTISE_FAILED_ALREADY_STARTED:
+ promise.reject("Failed to start advertising as the advertising is already started."); break;
+ case ADVERTISE_FAILED_DATA_TOO_LARGE:
+ promise.reject("Failed to start advertising as the advertise data to be broadcasted is larger than 31 bytes."); break;
+ case ADVERTISE_FAILED_INTERNAL_ERROR:
+ promise.reject("Operation failed due to an internal error."); break;
+ }
+ }
+
+ @Override
+ public void onStartSuccess(AdvertiseSettings settingsInEffect) {
+ super.onStartSuccess(settingsInEffect);
+ Log.i(TAG, "Advertising successful");
+
+ if (promise == null) return;
+ promise.resolve(settingsInEffect.toString());
+ }
+ }
+
+ private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ final String action = intent.getAction();
+
+ if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
+ final int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR);
+ final int prevState = intent.getIntExtra(BluetoothAdapter.EXTRA_PREVIOUS_STATE, BluetoothAdapter.ERROR);
+
+ Log.d(TAG, String.valueOf(state));
+ switch (state) {
+ case BluetoothAdapter.STATE_OFF:
+ mObservedState = false;
+ break;
+ case BluetoothAdapter.STATE_TURNING_OFF:
+ mObservedState = false;
+ break;
+ case BluetoothAdapter.STATE_ON:
+ mObservedState = true;
+ break;
+ case BluetoothAdapter.STATE_TURNING_ON:
+ mObservedState = true;
+ break;
+ }
+
+ // Only send enabled when fully ready. Turning on and Turning OFF are seen as disabled.
+ if (state == BluetoothAdapter.STATE_ON && prevState != BluetoothAdapter.STATE_ON) {
+ WritableMap params = Arguments.createMap();
+ params.putBoolean("enabled", true);
+ sendEvent("onBTStatusChange", params);
+ } else if (state != BluetoothAdapter.STATE_ON && prevState == BluetoothAdapter.STATE_ON ) {
+ WritableMap params = Arguments.createMap();
+ params.putBoolean("enabled", false);
+ sendEvent("onBTStatusChange", params);
+ }
+ }
+ }
+ };
+
+ private void sendEvent(String eventName, WritableMap params) {
+ getReactApplicationContext()
+ .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
+ .emit(eventName, params);
+ }
+}
diff --git a/packages/legacy/app/android/app/src/main/java/com/ariesbifold/BleAdvertisePackage.java b/packages/legacy/app/android/app/src/main/java/com/ariesbifold/BleAdvertisePackage.java
new file mode 100644
index 00000000..19534116
--- /dev/null
+++ b/packages/legacy/app/android/app/src/main/java/com/ariesbifold/BleAdvertisePackage.java
@@ -0,0 +1,26 @@
+package com.ariesbifold;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.ArrayList;
+import com.facebook.react.ReactPackage;
+import com.facebook.react.bridge.JavaScriptModule;
+import com.facebook.react.bridge.NativeModule;
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.uimanager.ViewManager;
+
+public class BleAdvertisePackage implements ReactPackage {
+
+ @Override
+ public List createNativeModules(ReactApplicationContext reactContext) {
+ List modules = new ArrayList<>();
+ modules.add(new BleAdvertiseModule(reactContext));
+ return modules;
+ }
+
+ @Override
+ public List createViewManagers(ReactApplicationContext reactContext) {
+ return Arrays.asList();
+ }
+}
diff --git a/packages/legacy/app/android/app/src/main/java/com/ariesbifold/MainActivity.java b/packages/legacy/app/android/app/src/main/java/com/ariesbifold/MainActivity.java
index 8c147abc..9e5fb122 100644
--- a/packages/legacy/app/android/app/src/main/java/com/ariesbifold/MainActivity.java
+++ b/packages/legacy/app/android/app/src/main/java/com/ariesbifold/MainActivity.java
@@ -27,7 +27,7 @@ public void onConfigurationChanged(Configuration newConfig) {
*/
@Override
protected String getMainComponentName() {
- return "aries-bifold";
+ return "fhwa-wallet";
}
/**
diff --git a/packages/legacy/app/android/app/src/main/java/com/ariesbifold/MainApplication.java b/packages/legacy/app/android/app/src/main/java/com/ariesbifold/MainApplication.java
index edd91dfd..0f81905b 100644
--- a/packages/legacy/app/android/app/src/main/java/com/ariesbifold/MainApplication.java
+++ b/packages/legacy/app/android/app/src/main/java/com/ariesbifold/MainApplication.java
@@ -10,6 +10,7 @@
import com.facebook.soloader.SoLoader;
import java.util.List;
import org.wonday.orientation.OrientationActivityLifecycle;
+import com.ariesbifold.BleAdvertisePackage;
public class MainApplication extends Application implements ReactApplication {
@@ -24,6 +25,7 @@ public boolean getUseDeveloperSupport() {
protected List getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List packages = new PackageList(this).getPackages();
+ packages.add(new BleAdvertisePackage());
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
diff --git a/packages/legacy/app/android/build.gradle b/packages/legacy/app/android/build.gradle
index 736e0c37..d87845d4 100644
--- a/packages/legacy/app/android/build.gradle
+++ b/packages/legacy/app/android/build.gradle
@@ -37,11 +37,11 @@ allprojects {
}
subprojects {
configurations.all {
- it.resolutionStrategy.activateDependencyLocking()
+ // it.resolutionStrategy.activateDependencyLocking()
}
}
dependencyLocking {
- lockAllConfigurations()
+ // lockAllConfigurations()
}
diff --git a/packages/legacy/app/android/settings.gradle b/packages/legacy/app/android/settings.gradle
index 25abc3d7..a04584fb 100644
--- a/packages/legacy/app/android/settings.gradle
+++ b/packages/legacy/app/android/settings.gradle
@@ -1,4 +1,9 @@
-rootProject.name = 'aries-bifold'
+rootProject.name = 'fhwa-wallet'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
-includeBuild('../node_modules/@react-native/gradle-plugin')
\ No newline at end of file
+includeBuild('../node_modules/@react-native/gradle-plugin')
+include ':react-native-onesignal'
+project(':react-native-onesignal').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-onesignal/android')
+
+include ':react-native-maps'
+project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/android')
diff --git a/packages/legacy/app/app.json b/packages/legacy/app/app.json
index 97ddb286..a5e16238 100644
--- a/packages/legacy/app/app.json
+++ b/packages/legacy/app/app.json
@@ -1,4 +1,4 @@
{
- "name": "aries-bifold",
- "displayName": "Aries Bifold"
+ "name": "fhwa-wallet",
+ "displayName": "FHWA Wallet"
}
diff --git a/packages/legacy/app/ios/AriesBifold-Bridging-Header.h b/packages/legacy/app/ios/AriesBifold-Bridging-Header.h
index 1b2cb5d6..4380265e 100644
--- a/packages/legacy/app/ios/AriesBifold-Bridging-Header.h
+++ b/packages/legacy/app/ios/AriesBifold-Bridging-Header.h
@@ -2,3 +2,5 @@
// Use this file to import your target's public headers that you would like to expose to Swift.
//
+#import "React/RCTBridgeModule.h"
+#import
diff --git a/packages/legacy/app/ios/AriesBifoldTests-Bridging-Header.h b/packages/legacy/app/ios/AriesBifoldTests-Bridging-Header.h
new file mode 100644
index 00000000..1b2cb5d6
--- /dev/null
+++ b/packages/legacy/app/ios/AriesBifoldTests-Bridging-Header.h
@@ -0,0 +1,4 @@
+//
+// Use this file to import your target's public headers that you would like to expose to Swift.
+//
+
diff --git a/packages/legacy/app/ios/BLEPeripheralManager.h b/packages/legacy/app/ios/BLEPeripheralManager.h
new file mode 100644
index 00000000..75b08dbd
--- /dev/null
+++ b/packages/legacy/app/ios/BLEPeripheralManager.h
@@ -0,0 +1,18 @@
+//
+// BLEPeripheralManager.h
+// ariesbifold
+//
+// Created by amishfaldu on 6/7/24.
+//
+
+//#import
+#import
+#import
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface BleAdvertise : RCTEventEmitter
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/packages/legacy/app/ios/BLEPeripheralManager.m b/packages/legacy/app/ios/BLEPeripheralManager.m
new file mode 100644
index 00000000..f442e76b
--- /dev/null
+++ b/packages/legacy/app/ios/BLEPeripheralManager.m
@@ -0,0 +1,15 @@
+//
+// BLEPeripheralManager.m
+// ariesbifold
+//
+// Created by amishfaldu on 6/7/24.
+//
+
+#import
+#import
+
+@interface RCT_EXTERN_MODULE(BleAdvertise, NSObject)
+RCT_EXTERN_METHOD(setCompanyId:(NSInteger *)companyId)
+RCT_EXTERN_METHOD(broadcast:(NSString *)serviceUUID characteristicUUID:(NSString *)characteristicUUID config:(NSDictionary *)config resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
+RCT_EXTERN_METHOD(stopBroadcast)
+@end
diff --git a/packages/legacy/app/ios/BLEPeripheralManager.swift b/packages/legacy/app/ios/BLEPeripheralManager.swift
new file mode 100644
index 00000000..689dc560
--- /dev/null
+++ b/packages/legacy/app/ios/BLEPeripheralManager.swift
@@ -0,0 +1,132 @@
+//
+// BLEPeripheralManager.swift
+// ariesbifold
+//
+// Created by amishfaldu on 6/7/24.
+//
+
+import Foundation
+import CoreBluetooth
+import UIKit
+
+@objc(BleAdvertise)
+class BleAdvertise: RCTEventEmitter, CBPeripheralManagerDelegate {
+
+ var peripheralManager: CBPeripheralManager!
+ var customService: CBMutableService!
+
+ // Define your Service and Characteristic UUIDs
+ var serviceUUID: CBUUID!
+ var characteristicUUID: CBUUID!
+ var deviceName: String!
+
+ var startAdvertisePromise: RCTPromiseResolveBlock?
+ var startAdvertiseReject: RCTPromiseRejectBlock?
+
+// @objc
+// static var sharedInstance: BleAdvertise?
+
+ override init() {
+ deviceName = UIDevice.current.name // Fetch the device name
+ super.init()
+ peripheralManager = CBPeripheralManager(delegate: self, queue: nil)
+// BleAdvertise.sharedInstance = self
+ }
+
+ func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) {
+ if peripheral.state == .poweredOn {
+ print("Bluetooth is powered on and ready to use")
+// startAdvertising()
+ } else {
+ print("Bluetooth is not available")
+ }
+ }
+
+ @objc func setCompanyId(_ companyId: Int64) {
+
+ }
+
+ @objc(broadcast:characteristicUUID:config:resolver:rejecter:)
+ func broadcast(serviceUUIDString: String, characteristicUUIDString: String, config: NSDictionary, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
+ serviceUUID = CBUUID(string: serviceUUIDString)
+ characteristicUUID = CBUUID(string: characteristicUUIDString)
+ let characteristic = CBMutableCharacteristic(
+ type: characteristicUUID,
+ properties: [.read, .write, .notify],
+ value: nil,
+ permissions: [.readable, .writeable]
+ )
+
+ customService = CBMutableService(type: serviceUUID, primary: true)
+ customService.characteristics = [characteristic]
+
+ peripheralManager.add(customService)
+
+ let advertisementData: [String: Any] = [
+ CBAdvertisementDataServiceUUIDsKey: [serviceUUID],
+ CBAdvertisementDataLocalNameKey: deviceName
+ ]
+ peripheralManager.startAdvertising(advertisementData)
+
+ print("Started advertising service with UUID: \(String(describing: serviceUUID))")
+ }
+
+ @objc(stopBroadcast)
+ func stopBroadcast() {
+ peripheralManager.stopAdvertising()
+ print("Stopped advertising")
+ }
+
+ func peripheralManager(_ peripheral: CBPeripheralManager, didAdd service: CBService, error: Error?) {
+ if let error = error {
+ print("Error adding service: \(error.localizedDescription)")
+ } else {
+ print("Service added successfully")
+ }
+ }
+
+ func peripheralManagerDidStartAdvertising(_ peripheral: CBPeripheralManager, error: Error?) {
+ if let error = error {
+ print("Error starting advertising: \(error.localizedDescription)")
+ } else {
+ print("Started advertising successfully")
+ }
+ }
+
+ func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveRead request: CBATTRequest) {
+ // Handle read request
+ if request.characteristic.uuid == characteristicUUID {
+ // request.value = characteristic.value
+ peripheralManager.respond(to: request, withResult: .success)
+ }
+ }
+
+ func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) {
+ // Handle write requests
+ for request in requests {
+ if request.characteristic.uuid == characteristicUUID {
+ if let value = request.value {
+// characteristic.value = value
+ // Notify React Native about the received data
+ sendEvent(withName: "onRead", body: ["data": String(decoding:value, as: UTF8.self)])
+ peripheralManager.respond(to: request, withResult: .success)
+ }
+ }
+ }
+ }
+
+ override func supportedEvents() -> [String]! {
+ return ["onRead"]
+ }
+
+ override class func requiresMainQueueSetup() -> Bool {
+ return true
+ }
+
+ }
+
+ extension Data {
+ var hexString: String {
+ return map { String(format: "%02x", $0) }.joined()
+ }
+ }
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/1024.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/1024.png
new file mode 100644
index 00000000..140cec68
Binary files /dev/null and b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/1024.png differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/120 1.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/120 1.png
new file mode 100644
index 00000000..82fbded6
Binary files /dev/null and b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/120 1.png differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/120.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/120.png
new file mode 100644
index 00000000..82fbded6
Binary files /dev/null and b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/120.png differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/180.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/180.png
new file mode 100644
index 00000000..2e73d08e
Binary files /dev/null and b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/180.png differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/40.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/40.png
new file mode 100644
index 00000000..5f5e179b
Binary files /dev/null and b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/40.png differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/58.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/58.png
new file mode 100644
index 00000000..9b679956
Binary files /dev/null and b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/58.png differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/60.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/60.png
new file mode 100644
index 00000000..4a211c22
Binary files /dev/null and b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/60.png differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/80.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/80.png
new file mode 100644
index 00000000..27951d49
Binary files /dev/null and b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/80.png differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/87.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/87.png
new file mode 100644
index 00000000..d3865e3d
Binary files /dev/null and b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/87.png differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Contents.json b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Contents.json
index 866813af..fd81fca2 100644
--- a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Contents.json
+++ b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Contents.json
@@ -1,62 +1,62 @@
{
- "images": [
+ "images" : [
{
- "filename": "Icon-20@2x.png",
- "idiom": "iphone",
- "scale": "2x",
- "size": "20x20"
+ "filename" : "40.png",
+ "idiom" : "iphone",
+ "scale" : "2x",
+ "size" : "20x20"
},
{
- "filename": "Icon-20@3x.png",
- "idiom": "iphone",
- "scale": "3x",
- "size": "20x20"
+ "filename" : "60.png",
+ "idiom" : "iphone",
+ "scale" : "3x",
+ "size" : "20x20"
},
{
- "filename": "Icon-29@2x.png",
- "idiom": "iphone",
- "scale": "2x",
- "size": "29x29"
+ "filename" : "58.png",
+ "idiom" : "iphone",
+ "scale" : "2x",
+ "size" : "29x29"
},
{
- "filename": "Icon-29@3x.png",
- "idiom": "iphone",
- "scale": "3x",
- "size": "29x29"
+ "filename" : "87.png",
+ "idiom" : "iphone",
+ "scale" : "3x",
+ "size" : "29x29"
},
{
- "filename": "Icon-40@2x.png",
- "idiom": "iphone",
- "scale": "2x",
- "size": "40x40"
+ "filename" : "80.png",
+ "idiom" : "iphone",
+ "scale" : "2x",
+ "size" : "40x40"
},
{
- "filename": "Icon-40@3x.png",
- "idiom": "iphone",
- "scale": "3x",
- "size": "40x40"
+ "filename" : "120 1.png",
+ "idiom" : "iphone",
+ "scale" : "3x",
+ "size" : "40x40"
},
{
- "filename": "Icon-60@2x.png",
- "idiom": "iphone",
- "scale": "2x",
- "size": "60x60"
+ "filename" : "120.png",
+ "idiom" : "iphone",
+ "scale" : "2x",
+ "size" : "60x60"
},
{
- "filename": "Icon-60@3x-1.png",
- "idiom": "iphone",
- "scale": "3x",
- "size": "60x60"
+ "filename" : "180.png",
+ "idiom" : "iphone",
+ "scale" : "3x",
+ "size" : "60x60"
},
{
- "filename": "iTunesArtwork.png",
- "idiom": "ios-marketing",
- "scale": "1x",
- "size": "1024x1024"
+ "filename" : "1024.png",
+ "idiom" : "ios-marketing",
+ "scale" : "1x",
+ "size" : "1024x1024"
}
],
- "info": {
- "author": "xcode",
- "version": 1
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
}
}
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-20@2x.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-20@2x.png
deleted file mode 100644
index 8d36cd84..00000000
Binary files a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-20@2x.png and /dev/null differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-20@3x.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-20@3x.png
deleted file mode 100644
index 69e1f04e..00000000
Binary files a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-20@3x.png and /dev/null differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-29@2x.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-29@2x.png
deleted file mode 100644
index a0c6eac2..00000000
Binary files a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-29@2x.png and /dev/null differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-29@3x.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-29@3x.png
deleted file mode 100644
index 6ae6ac4a..00000000
Binary files a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-29@3x.png and /dev/null differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-40@2x.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-40@2x.png
deleted file mode 100644
index 9154036d..00000000
Binary files a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-40@2x.png and /dev/null differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-40@3x.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-40@3x.png
deleted file mode 100644
index a00ec476..00000000
Binary files a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-40@3x.png and /dev/null differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-60@2x.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-60@2x.png
deleted file mode 100644
index a00ec476..00000000
Binary files a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-60@2x.png and /dev/null differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-60@3x-1.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-60@3x-1.png
deleted file mode 100644
index 4c153938..00000000
Binary files a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/Icon-60@3x-1.png and /dev/null differ
diff --git a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/iTunesArtwork.png b/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/iTunesArtwork.png
deleted file mode 100644
index 6614f667..00000000
Binary files a/packages/legacy/app/ios/Media.xcassets/AppIcon.appiconset/iTunesArtwork.png and /dev/null differ
diff --git a/packages/legacy/app/ios/Podfile b/packages/legacy/app/ios/Podfile
index 54fc58f6..5de716eb 100644
--- a/packages/legacy/app/ios/Podfile
+++ b/packages/legacy/app/ios/Podfile
@@ -1,9 +1,34 @@
source 'https://cdn.cocoapods.org'
require_relative '../node_modules/react-native/scripts/react_native_pods'
+require_relative '../node_modules/react-native-permissions/scripts/setup'
platform :ios, min_ios_version_supported
prepare_react_native_project!
+# ⬇️ uncomment wanted permissions
+setup_permissions([
+ # 'AppTrackingTransparency',
+ 'Bluetooth',
+ # 'Calendars',
+ # 'CalendarsWriteOnly',
+ 'Camera',
+ # 'Contacts',
+ 'FaceID',
+ # 'LocationAccuracy',
+ 'LocationAlways',
+ 'LocationWhenInUse',
+ # 'MediaLibrary',
+ # 'Microphone',
+ # 'Motion',
+ # 'Notifications',
+ # 'PhotoLibrary',
+ # 'PhotoLibraryAddOnly',
+ # 'Reminders',
+ # 'Siri',
+ # 'SpeechRecognition',
+ # 'StoreKit',
+])
+
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
diff --git a/packages/legacy/app/ios/Podfile.lock b/packages/legacy/app/ios/Podfile.lock
index d09fcb86..45d43cf4 100644
--- a/packages/legacy/app/ios/Podfile.lock
+++ b/packages/legacy/app/ios/Podfile.lock
@@ -29,6 +29,7 @@ PODS:
- React-callinvoker
- React-Core
- libevent (2.1.12)
+ - MultiplatformBleAdapter (0.2.0)
- RCT-Folly (2021.07.22.00):
- boost
- DoubleConversion
@@ -329,13 +330,11 @@ PODS:
- React-jsinspector (0.72.5)
- React-logger (0.72.5):
- glog
- - react-native-camera (3.44.3):
+ - react-native-ble-manager (11.5.3):
- React-Core
- - react-native-camera/RCT (= 3.44.3)
- - react-native-camera/RN (= 3.44.3)
- - react-native-camera/RCT (3.44.3):
- - React-Core
- - react-native-camera/RN (3.44.3):
+ - react-native-ble-plx (3.1.2):
+ - MultiplatformBleAdapter (= 0.2.0)
+ - RCT-Folly (= 2021.07.22.00)
- React-Core
- react-native-config (1.5.0):
- react-native-config/App (= 1.5.0)
@@ -347,6 +346,8 @@ PODS:
- React-Core
- react-native-netinfo (9.3.7):
- React-Core
+ - react-native-orientation-locker (1.6.0):
+ - React-Core
- react-native-safe-area-context (3.4.1):
- React-Core
- react-native-splash-screen (3.3.0):
@@ -483,37 +484,8 @@ PODS:
- React-Core
- RNLocalize (2.2.6):
- React-Core
- - RNPermissions (3.9.2):
- - React-Core
- - RNReanimated (3.5.4):
- - DoubleConversion
- - FBLazyVector
- - glog
- - hermes-engine
- - RCT-Folly
- - RCTRequired
- - RCTTypeSafety
- - React-callinvoker
+ - RNPermissions (4.1.5):
- React-Core
- - React-Core/DevSupport
- - React-Core/RCTWebSocket
- - React-CoreModules
- - React-cxxreact
- - React-hermes
- - React-jsi
- - React-jsiexecutor
- - React-jsinspector
- - React-RCTActionSheet
- - React-RCTAnimation
- - React-RCTAppDelegate
- - React-RCTBlob
- - React-RCTImage
- - React-RCTLinking
- - React-RCTNetwork
- - React-RCTSettings
- - React-RCTText
- - ReactCommon/turbomodule/core
- - Yoga
- RNScreens (3.25.0):
- React-Core
- React-RCTImage
@@ -522,6 +494,10 @@ PODS:
- RNVectorIcons (10.0.0):
- React-Core
- SocketRocket (0.6.1)
+ - VisionCamera (3.6.16):
+ - React
+ - React-callinvoker
+ - React-Core
- Yoga (1.14.0)
DEPENDENCIES:
@@ -551,11 +527,13 @@ DEPENDENCIES:
- React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`)
- React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`)
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- - react-native-camera (from `../node_modules/react-native-camera`)
+ - react-native-ble-manager (from `../node_modules/react-native-ble-manager`)
+ - react-native-ble-plx (from `../node_modules/react-native-ble-plx`)
- react-native-config (from `../node_modules/react-native-config`)
- react-native-encrypted-storage (from `../node_modules/react-native-encrypted-storage`)
- react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
- "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
+ - react-native-orientation-locker (from `../node_modules/react-native-orientation-locker`)
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- react-native-splash-screen (from `../node_modules/react-native-splash-screen`)
- react-native-tcp-socket (from `../node_modules/react-native-tcp-socket`)
@@ -586,10 +564,10 @@ DEPENDENCIES:
- RNKeychain (from `../node_modules/react-native-keychain`)
- RNLocalize (from `../node_modules/react-native-localize`)
- RNPermissions (from `../node_modules/react-native-permissions`)
- - RNReanimated (from `../node_modules/react-native-reanimated`)
- RNScreens (from `../node_modules/react-native-screens`)
- RNSVG (from `../node_modules/react-native-svg`)
- RNVectorIcons (from `../node_modules/react-native-vector-icons`)
+ - VisionCamera (from `../node_modules/react-native-vision-camera`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
SPEC REPOS:
@@ -598,6 +576,7 @@ SPEC REPOS:
- CocoaAsyncSocket
- fmt
- libevent
+ - MultiplatformBleAdapter
- SocketRocket
EXTERNAL SOURCES:
@@ -650,8 +629,10 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/jsinspector"
React-logger:
:path: "../node_modules/react-native/ReactCommon/logger"
- react-native-camera:
- :path: "../node_modules/react-native-camera"
+ react-native-ble-manager:
+ :path: "../node_modules/react-native-ble-manager"
+ react-native-ble-plx:
+ :path: "../node_modules/react-native-ble-plx"
react-native-config:
:path: "../node_modules/react-native-config"
react-native-encrypted-storage:
@@ -660,6 +641,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-get-random-values"
react-native-netinfo:
:path: "../node_modules/@react-native-community/netinfo"
+ react-native-orientation-locker:
+ :path: "../node_modules/react-native-orientation-locker"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
react-native-splash-screen:
@@ -720,14 +703,14 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-localize"
RNPermissions:
:path: "../node_modules/react-native-permissions"
- RNReanimated:
- :path: "../node_modules/react-native-reanimated"
RNScreens:
:path: "../node_modules/react-native-screens"
RNSVG:
:path: "../node_modules/react-native-svg"
RNVectorIcons:
:path: "../node_modules/react-native-vector-icons"
+ VisionCamera:
+ :path: "../node_modules/react-native-vision-camera"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"
@@ -745,6 +728,7 @@ SPEC CHECKSUMS:
hermes-engine: f6cf92a471053245614d9d8097736f6337d5b86c
indy-vdr: 85cd66089f151256581323440e78988891f4082e
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
+ MultiplatformBleAdapter: b1fddd0d499b96b607e00f0faa8e60648343dc1d
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: df81ab637d35fac9e6eb94611cfd20f0feb05455
RCTTypeSafety: 4636e4a36c7c2df332bda6d59b19b41c443d4287
@@ -760,11 +744,13 @@ SPEC CHECKSUMS:
React-jsiexecutor: ff70a72027dea5cc7d71cfcc6fad7f599f63987a
React-jsinspector: aef73cbd43b70675f572214d10fa438c89bf11ba
React-logger: 2e4aee3e11b3ec4fa6cfd8004610bbb3b8d6cca4
- react-native-camera: b8cc03e2feec0c04403d0998e37cf519d8fd4c6f
+ react-native-ble-manager: d63955f48a45306ae02b3d313ca46ad928a4645a
+ react-native-ble-plx: 669899d2fd4d360d541b05ce19c6ee77d95853bf
react-native-config: 5330c8258265c1e5fdb8c009d2cabd6badd96727
react-native-encrypted-storage: db300a3f2f0aba1e818417c1c0a6be549038deb7
react-native-get-random-values: a6ea6a8a65dc93e96e24a11105b1a9c8cfe1d72a
react-native-netinfo: 2517ad504b3d303e90d7a431b0fcaef76d207983
+ react-native-orientation-locker: 4409c5b12b65f942e75449872b4f078b6f27af81
react-native-safe-area-context: 9e40fb181dac02619414ba1294d6c2a807056ab9
react-native-splash-screen: 4312f786b13a81b5169ef346d76d33bc0c6dc457
react-native-tcp-socket: e724380c910c2e704816ec817ed28f1342246ff7
@@ -794,14 +780,14 @@ SPEC CHECKSUMS:
RNGestureHandler: a479ebd5ed4221a810967000735517df0d2db211
RNKeychain: ff836453cba46938e0e9e4c22e43d43fa2c90333
RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81
- RNPermissions: 7f93fea75d6ea684fe600b08e2c244098a49244b
- RNReanimated: ab2e96c6d5591c3dfbb38a464f54c8d17fb34a87
+ RNPermissions: 2ce48c298b55586f6ad873ddda0a5fe65d251e8d
RNScreens: 85d3880b52d34db7b8eeebe2f1a0e807c05e69fa
RNSVG: d7d7bc8229af3842c9cfc3a723c815a52cdd1105
RNVectorIcons: 8b5bb0fa61d54cd2020af4f24a51841ce365c7e9
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
+ VisionCamera: b236f548d6507923857dade542c7e0a148ed3492
Yoga: 86fed2e4d425ee4c6eab3813ba1791101ee153c6
-PODFILE CHECKSUM: 702646d9563d22bf09e336926a5fb0e2d3239409
+PODFILE CHECKSUM: 4749f46ac279359c9f99a5af9e25e8db7aa3264c
-COCOAPODS: 1.13.0
+COCOAPODS: 1.15.2
diff --git a/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj b/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj
index 02181965..4b1b5fb8 100644
--- a/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj
+++ b/packages/legacy/app/ios/ariesbifold.xcodeproj/project.pbxproj
@@ -8,6 +8,10 @@
/* Begin PBXBuildFile section */
00E356F31AD99517003FC87E /* AriesBifoldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* AriesBifoldTests.m */; };
+ 0BE4E0DD2C140BCD00636F44 /* BLEPeripheralManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BE4E0DC2C140BCD00636F44 /* BLEPeripheralManager.swift */; };
+ 0BE4E0DE2C140BCD00636F44 /* BLEPeripheralManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0BE4E0DC2C140BCD00636F44 /* BLEPeripheralManager.swift */; };
+ 0BE4E0E12C140C1800636F44 /* BLEPeripheralManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BE4E0E02C140C1800636F44 /* BLEPeripheralManager.m */; };
+ 0BE4E0E22C140C1800636F44 /* BLEPeripheralManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BE4E0E02C140C1800636F44 /* BLEPeripheralManager.m */; };
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
@@ -45,7 +49,12 @@
00E356EE1AD99517003FC87E /* AriesBifoldTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AriesBifoldTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
00E356F21AD99517003FC87E /* AriesBifoldTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AriesBifoldTests.m; sourceTree = ""; };
- 13B07F961A680F5B00A75B9A /* AriesBifold.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AriesBifold.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ 0BE4E0DA2C140BCD00636F44 /* AriesBifold-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AriesBifold-Bridging-Header.h"; sourceTree = ""; };
+ 0BE4E0DB2C140BCD00636F44 /* AriesBifoldTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AriesBifoldTests-Bridging-Header.h"; sourceTree = ""; };
+ 0BE4E0DC2C140BCD00636F44 /* BLEPeripheralManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BLEPeripheralManager.swift; sourceTree = ""; };
+ 0BE4E0DF2C140C1800636F44 /* BLEPeripheralManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BLEPeripheralManager.h; sourceTree = ""; };
+ 0BE4E0E02C140C1800636F44 /* BLEPeripheralManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BLEPeripheralManager.m; sourceTree = ""; };
+ 13B07F961A680F5B00A75B9A /* FHWA.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FHWA.app; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = AriesBifold/AppDelegate.h; sourceTree = ""; };
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = AriesBifold/AppDelegate.m; sourceTree = ""; };
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = AriesBifold/Images.xcassets; sourceTree = ""; };
@@ -144,6 +153,9 @@
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
+ 0BE4E0DC2C140BCD00636F44 /* BLEPeripheralManager.swift */,
+ 0BE4E0DF2C140C1800636F44 /* BLEPeripheralManager.h */,
+ 0BE4E0E02C140C1800636F44 /* BLEPeripheralManager.m */,
566FB1F1273B158E003E9BEE /* Media.xcassets */,
13B07FAE1A68108700A75B9A /* AriesBifold */,
00E356EF1AD99517003FC87E /* AriesBifoldTests */,
@@ -152,6 +164,8 @@
2D16E6871FA4F8E400B85C8A /* Frameworks */,
56A83D5927D95BBF002FE8FE /* Resources */,
8ACF6F3B2962FE31C0EE5408 /* Pods */,
+ 0BE4E0DA2C140BCD00636F44 /* AriesBifold-Bridging-Header.h */,
+ 0BE4E0DB2C140BCD00636F44 /* AriesBifoldTests-Bridging-Header.h */,
);
indentWidth = 2;
sourceTree = "";
@@ -161,7 +175,7 @@
83CBBA001A601CBA00E9B192 /* Products */ = {
isa = PBXGroup;
children = (
- 13B07F961A680F5B00A75B9A /* AriesBifold.app */,
+ 13B07F961A680F5B00A75B9A /* FHWA.app */,
00E356EE1AD99517003FC87E /* AriesBifoldTests.xctest */,
);
name = Products;
@@ -222,7 +236,7 @@
);
name = AriesBifold;
productName = AriesBifold;
- productReference = 13B07F961A680F5B00A75B9A /* AriesBifold.app */;
+ productReference = 13B07F961A680F5B00A75B9A /* FHWA.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
@@ -235,10 +249,11 @@
TargetAttributes = {
00E356ED1AD99517003FC87E = {
CreatedOnToolsVersion = 6.2;
+ LastSwiftMigration = 1540;
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
- LastSwiftMigration = 1120;
+ LastSwiftMigration = 1540;
};
};
};
@@ -284,7 +299,7 @@
/* Begin PBXShellScriptBuildPhase section */
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
+ buildActionMask = 12;
files = (
);
inputPaths = (
@@ -294,7 +309,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
+ shellScript = "\nset -e\n\nif [[ -s \"$HOME/.nvm/nvm.sh\" ]]; then\n. \"$HOME/.nvm/nvm.sh\"\nelif [[ -x \"$(command -v brew)\" && -s \"$(brew --prefix nvm)/nvm.sh\" ]]; then\n. \"$(brew --prefix nvm)/nvm.sh\"\nfi\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
};
04A23698871F60D02E13ACB0 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
@@ -435,6 +450,8 @@
buildActionMask = 2147483647;
files = (
00E356F31AD99517003FC87E /* AriesBifoldTests.m in Sources */,
+ 0BE4E0E22C140C1800636F44 /* BLEPeripheralManager.m in Sources */,
+ 0BE4E0DE2C140BCD00636F44 /* BLEPeripheralManager.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -442,8 +459,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 0BE4E0DD2C140BCD00636F44 /* BLEPeripheralManager.swift in Sources */,
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
13B07FC11A68108700A75B9A /* main.m in Sources */,
+ 0BE4E0E12C140C1800636F44 /* BLEPeripheralManager.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -462,7 +481,9 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 9337C17A2E512FDE0E677F2E /* Pods-AriesBifold-AriesBifoldTests.debug.xcconfig */;
buildSettings = {
+ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
+ CLANG_ENABLE_MODULES = YES;
DEVELOPMENT_TEAM = "";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
@@ -482,6 +503,9 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "AriesBifoldTests-Bridging-Header.h";
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AriesBifold.app/AriesBifold";
};
name = Debug;
@@ -490,7 +514,9 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 65B4BCEABB8190F24B4588BC /* Pods-AriesBifold-AriesBifoldTests.release.xcconfig */;
buildSettings = {
+ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
+ CLANG_ENABLE_MODULES = YES;
COPY_PHASE_STRIP = NO;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = AriesBifoldTests/Info.plist;
@@ -507,6 +533,8 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_OBJC_BRIDGING_HEADER = "AriesBifoldTests-Bridging-Header.h";
+ SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/AriesBifold.app/AriesBifold";
};
name = Release;
@@ -518,7 +546,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
- DEVELOPMENT_TEAM = G9667JTP83;
+ DEVELOPMENT_TEAM = X4AZ3Y5536;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = AriesBifold/Info.plist;
@@ -535,11 +563,12 @@
"-ObjC",
"-lc++",
);
- PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.AriesBifold;
- PRODUCT_NAME = AriesBifold;
+ PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.AriesBifoldNJIT;
+ PRODUCT_NAME = FHWA;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
+ SWIFT_OBJC_BRIDGING_HEADER = "AriesBifold-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -554,7 +583,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
- DEVELOPMENT_TEAM = G9667JTP83;
+ DEVELOPMENT_TEAM = X4AZ3Y5536;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = AriesBifold/Info.plist;
@@ -571,11 +600,12 @@
"-ObjC",
"-lc++",
);
- PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.AriesBifold;
- PRODUCT_NAME = AriesBifold;
+ PRODUCT_BUNDLE_IDENTIFIER = org.reactjs.native.example.AriesBifoldNJIT;
+ PRODUCT_NAME = FHWA;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES;
+ SWIFT_OBJC_BRIDGING_HEADER = "AriesBifold-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
@@ -648,7 +678,13 @@
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
- " ",
+ "-Wl",
+ "-ld_classic",
+ "-Wl",
+ "-ld_classic",
+ "-Wl",
+ "-ld_classic",
+ "-Wl -ld_classic ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
@@ -716,7 +752,13 @@
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
OTHER_LDFLAGS = (
"$(inherited)",
- " ",
+ "-Wl",
+ "-ld_classic",
+ "-Wl",
+ "-ld_classic",
+ "-Wl",
+ "-ld_classic",
+ "-Wl -ld_classic ",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
diff --git a/packages/legacy/app/ios/ariesbifold.xcodeproj/xcshareddata/xcschemes/AriesBifold.xcscheme b/packages/legacy/app/ios/ariesbifold.xcodeproj/xcshareddata/xcschemes/AriesBifold.xcscheme
index c4acecf8..2a567b21 100644
--- a/packages/legacy/app/ios/ariesbifold.xcodeproj/xcshareddata/xcschemes/AriesBifold.xcscheme
+++ b/packages/legacy/app/ios/ariesbifold.xcodeproj/xcshareddata/xcschemes/AriesBifold.xcscheme
@@ -15,9 +15,9 @@
+ ReferencedContainer = "container:ariesbifold.xcodeproj">
@@ -35,7 +35,7 @@
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "AriesBifoldTests.xctest"
BlueprintName = "AriesBifoldTests"
- ReferencedContainer = "container:AriesBifold.xcodeproj">
+ ReferencedContainer = "container:ariesbifold.xcodeproj">
@@ -55,9 +55,9 @@
+ ReferencedContainer = "container:ariesbifold.xcodeproj">
@@ -72,9 +72,9 @@
+ ReferencedContainer = "container:ariesbifold.xcodeproj">
diff --git a/packages/legacy/app/ios/ariesbifold/AppDelegate.m b/packages/legacy/app/ios/ariesbifold/AppDelegate.m
index 6e2e9b64..7abb2f92 100644
--- a/packages/legacy/app/ios/ariesbifold/AppDelegate.m
+++ b/packages/legacy/app/ios/ariesbifold/AppDelegate.m
@@ -7,7 +7,7 @@ @implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
- self.moduleName = @"aries-bifold";
+ self.moduleName = @"fhwa-wallet";
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};
diff --git a/packages/legacy/app/ios/ariesbifold/Info.plist b/packages/legacy/app/ios/ariesbifold/Info.plist
index 765de7a0..f7fe8ef0 100644
--- a/packages/legacy/app/ios/ariesbifold/Info.plist
+++ b/packages/legacy/app/ios/ariesbifold/Info.plist
@@ -5,7 +5,7 @@
CFBundleDevelopmentRegion
en
CFBundleDisplayName
- AriesBifold
+ FHWA
CFBundleExecutable
$(EXECUTABLE_NAME)
CFBundleIdentifier
@@ -37,6 +37,10 @@
+ NSBluetoothAlwaysUsageDescription
+ $(PRODUCT_NAME) wants to use Bluetooth
+ NSBluetoothPeripheralUsageDescription
+ $(PRODUCT_NAME) wants to use Bluetooth
NSCameraUsageDescription
Camera used for in-app QR Code scanning
NSFaceIDUsageDescription
@@ -48,6 +52,11 @@
MaterialIcons.ttf
MaterialCommunityIcons.ttf
+ UIBackgroundModes
+
+ bluetooth-central
+ location
+
UILaunchStoryboardName
LaunchScreen
UIRequiredDeviceCapabilities
@@ -70,4 +79,4 @@
UIViewControllerBasedStatusBarAppearance
-
+
\ No newline at end of file
diff --git a/packages/legacy/app/package.json b/packages/legacy/app/package.json
index 23b562a2..935ab6b0 100644
--- a/packages/legacy/app/package.json
+++ b/packages/legacy/app/package.json
@@ -2,7 +2,7 @@
"name": "aries-bifold-app",
"version": "1.0.0",
"private": true,
- "description": "Aries Bifold Wallet App",
+ "description": "FHWA Wallet App",
"scripts": {
"android": "react-native run-android",
"gradle": "./android/gradlew --project-dir=./android --no-daemon",
@@ -56,6 +56,8 @@
"react-native": "*",
"react-native-animated-pagination-dots": "^0.1.72",
"react-native-argon2": "^2.0.1",
+ "react-native-ble-manager": "^11.5.3",
+ "react-native-ble-plx": "^3.1.2",
"react-native-bouncy-checkbox": "^3.0.5",
"react-native-collapsible": "^1.6.1",
"react-native-config": "^1.4.2",
diff --git a/packages/legacy/core/.prettierrc b/packages/legacy/core/.prettierrc
index cbe842ac..f547d59a 100644
--- a/packages/legacy/core/.prettierrc
+++ b/packages/legacy/core/.prettierrc
@@ -1,5 +1,6 @@
{
"printWidth": 120,
"semi": false,
- "singleQuote": true
+ "singleQuote": true,
+ "endOfLine": "auto"
}
diff --git a/packages/legacy/core/App/assets/img/FHWA-Logo.svg b/packages/legacy/core/App/assets/img/FHWA-Logo.svg
new file mode 100644
index 00000000..2cfba0b8
--- /dev/null
+++ b/packages/legacy/core/App/assets/img/FHWA-Logo.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/packages/legacy/core/App/assets/img/activity-indicator-circle.svg b/packages/legacy/core/App/assets/img/activity-indicator-circle.svg
index 439aa184..dad219a0 100644
--- a/packages/legacy/core/App/assets/img/activity-indicator-circle.svg
+++ b/packages/legacy/core/App/assets/img/activity-indicator-circle.svg
@@ -1,90 +1,17 @@
-