mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-01 11:39:40 +01:00
DEL: Widget center package
This commit is contained in:
parent
72439f36c1
commit
d6982c92a5
16 changed files with 68 additions and 91 deletions
|
@ -83,9 +83,3 @@ subprojects {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
subprojects { subproject ->
|
|
||||||
if(project['name'] == 'react-native-widget-center') {
|
|
||||||
project.configurations { compile { } }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import Realm from 'realm';
|
||||||
import { LegacyWallet, SegwitBech32Wallet, SegwitP2SHWallet, TaprootWallet } from '../class';
|
import { LegacyWallet, SegwitBech32Wallet, SegwitP2SHWallet, TaprootWallet } from '../class';
|
||||||
import presentAlert from '../components/Alert';
|
import presentAlert from '../components/Alert';
|
||||||
import loc from '../loc';
|
import loc from '../loc';
|
||||||
import { reloadAllTimelines } from '../components/WidgetCommunication';
|
|
||||||
import RNFS from 'react-native-fs';
|
import RNFS from 'react-native-fs';
|
||||||
|
|
||||||
const ElectrumClient = require('electrum-client');
|
const ElectrumClient = require('electrum-client');
|
||||||
|
@ -212,8 +211,6 @@ export async function connectMain(): Promise<void> {
|
||||||
await DefaultPreference.set(ELECTRUM_TCP_PORT, usingPeer.tcp ?? '');
|
await DefaultPreference.set(ELECTRUM_TCP_PORT, usingPeer.tcp ?? '');
|
||||||
await DefaultPreference.set(ELECTRUM_SSL_PORT, usingPeer.ssl ?? '');
|
await DefaultPreference.set(ELECTRUM_SSL_PORT, usingPeer.ssl ?? '');
|
||||||
}
|
}
|
||||||
|
|
||||||
reloadAllTimelines();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Must be running on Android
|
// Must be running on Android
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
@ -340,7 +337,6 @@ const presentNetworkErrorAlert = async (usingPeer?: Peer) => {
|
||||||
await DefaultPreference.clear(ELECTRUM_HOST);
|
await DefaultPreference.clear(ELECTRUM_HOST);
|
||||||
await DefaultPreference.clear(ELECTRUM_SSL_PORT);
|
await DefaultPreference.clear(ELECTRUM_SSL_PORT);
|
||||||
await DefaultPreference.clear(ELECTRUM_TCP_PORT);
|
await DefaultPreference.clear(ELECTRUM_TCP_PORT);
|
||||||
reloadAllTimelines();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Must be running on Android
|
// Must be running on Android
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
function WidgetCommunication() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
WidgetCommunication.isBalanceDisplayAllowed = () => {};
|
|
||||||
WidgetCommunication.setBalanceDisplayAllowed = () => {};
|
|
||||||
WidgetCommunication.reloadAllTimelines = () => {};
|
|
||||||
|
|
||||||
export default WidgetCommunication;
|
|
|
@ -3,7 +3,6 @@ import DefaultPreference from 'react-native-default-preference';
|
||||||
import * as RNLocalize from 'react-native-localize';
|
import * as RNLocalize from 'react-native-localize';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
import { FiatUnit, FiatUnitType, getFiatRate } from '../models/fiatUnit';
|
import { FiatUnit, FiatUnitType, getFiatRate } from '../models/fiatUnit';
|
||||||
import { reloadAllTimelines } from '../components/WidgetCommunication';
|
|
||||||
|
|
||||||
const PREFERRED_CURRENCY_STORAGE_KEY = 'preferredCurrency';
|
const PREFERRED_CURRENCY_STORAGE_KEY = 'preferredCurrency';
|
||||||
const PREFERRED_CURRENCY_LOCALE_STORAGE_KEY = 'preferredCurrencyLocale';
|
const PREFERRED_CURRENCY_LOCALE_STORAGE_KEY = 'preferredCurrencyLocale';
|
||||||
|
@ -32,8 +31,6 @@ async function setPreferredCurrency(item: FiatUnitType): Promise<void> {
|
||||||
await DefaultPreference.setName(GROUP_IO_BLUEWALLET);
|
await DefaultPreference.setName(GROUP_IO_BLUEWALLET);
|
||||||
await DefaultPreference.set(PREFERRED_CURRENCY_STORAGE_KEY, item.endPointKey);
|
await DefaultPreference.set(PREFERRED_CURRENCY_STORAGE_KEY, item.endPointKey);
|
||||||
await DefaultPreference.set(PREFERRED_CURRENCY_LOCALE_STORAGE_KEY, item.locale.replace('-', '_'));
|
await DefaultPreference.set(PREFERRED_CURRENCY_LOCALE_STORAGE_KEY, item.locale.replace('-', '_'));
|
||||||
// @ts-ignore: Convert to TSX later
|
|
||||||
reloadAllTimelines();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getPreferredCurrency(): Promise<FiatUnitType> {
|
async function getPreferredCurrency(): Promise<FiatUnitType> {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import React, { useContext, useEffect } from 'react';
|
import React, { useContext, useEffect } from 'react';
|
||||||
import DefaultPreference from 'react-native-default-preference';
|
import DefaultPreference from 'react-native-default-preference';
|
||||||
// @ts-ignore: no type definitions
|
|
||||||
import RNWidgetCenter from 'react-native-widget-center';
|
|
||||||
import { BlueStorageContext } from '../blue_modules/storage-context';
|
import { BlueStorageContext } from '../blue_modules/storage-context';
|
||||||
import { TWallet } from '../class/wallets/types';
|
import { TWallet } from '../class/wallets/types';
|
||||||
import { useSettings } from './Context/SettingsContext';
|
import { useSettings } from './Context/SettingsContext';
|
||||||
|
@ -13,10 +11,6 @@ enum WidgetCommunicationKeys {
|
||||||
LatestTransactionIsUnconfirmed = 'WidgetCommunicationLatestTransactionIsUnconfirmed',
|
LatestTransactionIsUnconfirmed = 'WidgetCommunicationLatestTransactionIsUnconfirmed',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const reloadAllTimelines = (): void => {
|
|
||||||
RNWidgetCenter.reloadAllTimelines();
|
|
||||||
};
|
|
||||||
|
|
||||||
export const isBalanceDisplayAllowed = async (): Promise<boolean> => {
|
export const isBalanceDisplayAllowed = async (): Promise<boolean> => {
|
||||||
try {
|
try {
|
||||||
await DefaultPreference.setName('group.io.bluewallet.bluewallet');
|
await DefaultPreference.setName('group.io.bluewallet.bluewallet');
|
||||||
|
@ -34,7 +28,6 @@ export const setBalanceDisplayAllowed = async (value: boolean): Promise<void> =>
|
||||||
} else {
|
} else {
|
||||||
await DefaultPreference.clear(WidgetCommunicationKeys.DisplayBalanceAllowed);
|
await DefaultPreference.clear(WidgetCommunicationKeys.DisplayBalanceAllowed);
|
||||||
}
|
}
|
||||||
reloadAllTimelines();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const syncWidgetBalanceWithWallets = async (wallets: TWallet[], walletsInitialized: boolean): Promise<void> => {
|
export const syncWidgetBalanceWithWallets = async (wallets: TWallet[], walletsInitialized: boolean): Promise<void> => {
|
||||||
|
@ -42,7 +35,6 @@ export const syncWidgetBalanceWithWallets = async (wallets: TWallet[], walletsIn
|
||||||
const { allWalletsBalance, latestTransactionTime } = await allWalletsBalanceAndTransactionTime(wallets, walletsInitialized);
|
const { allWalletsBalance, latestTransactionTime } = await allWalletsBalanceAndTransactionTime(wallets, walletsInitialized);
|
||||||
await DefaultPreference.set(WidgetCommunicationKeys.AllWalletsSatoshiBalance, String(allWalletsBalance));
|
await DefaultPreference.set(WidgetCommunicationKeys.AllWalletsSatoshiBalance, String(allWalletsBalance));
|
||||||
await DefaultPreference.set(WidgetCommunicationKeys.AllWalletsLatestTransactionTime, String(latestTransactionTime));
|
await DefaultPreference.set(WidgetCommunicationKeys.AllWalletsLatestTransactionTime, String(latestTransactionTime));
|
||||||
reloadAllTimelines();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const allWalletsBalanceAndTransactionTime = async (
|
const allWalletsBalanceAndTransactionTime = async (
|
||||||
|
|
|
@ -7,8 +7,6 @@ export const isBalanceDisplayAllowed = async (): Promise<boolean> => {
|
||||||
|
|
||||||
export const setBalanceDisplayAllowed = async (value: boolean): Promise<void> => {};
|
export const setBalanceDisplayAllowed = async (value: boolean): Promise<void> => {};
|
||||||
|
|
||||||
export const reloadAllTimelines = (): void => {};
|
|
||||||
|
|
||||||
export const syncWidgetBalanceWithWallets = async (_wallets: TWallet[], _walletsInitialized: boolean): Promise<void> => {};
|
export const syncWidgetBalanceWithWallets = async (_wallets: TWallet[], _walletsInitialized: boolean): Promise<void> => {};
|
||||||
|
|
||||||
const WidgetCommunication: React.FC = () => {
|
const WidgetCommunication: React.FC = () => {
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
// Use this file to import your target's public headers that you would like to expose to Swift.
|
// Use this file to import your target's public headers that you would like to expose to Swift.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#import "AppDelegate.h"
|
||||||
#import <React/RCTBridgeModule.h>
|
#import <React/RCTBridgeModule.h>
|
||||||
|
|
|
@ -153,9 +153,12 @@
|
||||||
B4A29A3D2B55C990002A67DF /* WidgetsExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 6DD4109C266CADF10087DE03 /* WidgetsExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
B4A29A3D2B55C990002A67DF /* WidgetsExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 6DD4109C266CADF10087DE03 /* WidgetsExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||||
B4AB225D2B02AD12001F4328 /* XMLParserDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4AB225C2B02AD12001F4328 /* XMLParserDelegate.swift */; };
|
B4AB225D2B02AD12001F4328 /* XMLParserDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4AB225C2B02AD12001F4328 /* XMLParserDelegate.swift */; };
|
||||||
B4AB225E2B02AD12001F4328 /* XMLParserDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4AB225C2B02AD12001F4328 /* XMLParserDelegate.swift */; };
|
B4AB225E2B02AD12001F4328 /* XMLParserDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4AB225C2B02AD12001F4328 /* XMLParserDelegate.swift */; };
|
||||||
|
B4B1A4622BFA73110072E3BB /* WidgetHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4B1A4612BFA73110072E3BB /* WidgetHelper.swift */; };
|
||||||
|
B4B1A4642BFA73110072E3BB /* WidgetHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4B1A4612BFA73110072E3BB /* WidgetHelper.swift */; };
|
||||||
|
B4B1A4652BFA73110072E3BB /* WidgetHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4B1A4612BFA73110072E3BB /* WidgetHelper.swift */; };
|
||||||
B4EE583C226703320003363C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B40D4E35225841ED00428FCC /* Assets.xcassets */; };
|
B4EE583C226703320003363C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B40D4E35225841ED00428FCC /* Assets.xcassets */; };
|
||||||
C59F90CE0D04D3E4BB39BC5D /* libPods-BlueWalletUITests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F02C2F7CA3591E4E0B06EBA /* libPods-BlueWalletUITests.a */; };
|
C59F90CE0D04D3E4BB39BC5D /* libPods-BlueWalletUITests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F02C2F7CA3591E4E0B06EBA /* libPods-BlueWalletUITests.a */; };
|
||||||
C978A716948AB7DEC5B6F677 /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
|
C978A716948AB7DEC5B6F677 /* (null) in Frameworks */ = {isa = PBXBuildFile; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
|
@ -444,6 +447,7 @@
|
||||||
B4A29A452B55C990002A67DF /* BlueWallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BlueWallet.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
B4A29A452B55C990002A67DF /* BlueWallet.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BlueWallet.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
B4A29A462B55C990002A67DF /* BlueWallet-NoLDK.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BlueWallet-NoLDK.plist"; sourceTree = "<absolute>"; };
|
B4A29A462B55C990002A67DF /* BlueWallet-NoLDK.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "BlueWallet-NoLDK.plist"; sourceTree = "<absolute>"; };
|
||||||
B4AB225C2B02AD12001F4328 /* XMLParserDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XMLParserDelegate.swift; sourceTree = "<group>"; };
|
B4AB225C2B02AD12001F4328 /* XMLParserDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XMLParserDelegate.swift; sourceTree = "<group>"; };
|
||||||
|
B4B1A4612BFA73110072E3BB /* WidgetHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetHelper.swift; sourceTree = "<group>"; };
|
||||||
B4D3235A177F4580BA52F2F9 /* libRNCSlider.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCSlider.a; sourceTree = "<group>"; };
|
B4D3235A177F4580BA52F2F9 /* libRNCSlider.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNCSlider.a; sourceTree = "<group>"; };
|
||||||
B642AFB13483418CAB6FF25E /* libRCTQRCodeLocalImage.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTQRCodeLocalImage.a; sourceTree = "<group>"; };
|
B642AFB13483418CAB6FF25E /* libRCTQRCodeLocalImage.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTQRCodeLocalImage.a; sourceTree = "<group>"; };
|
||||||
B68F8552DD4428F64B11DCFB /* Pods-BlueWallet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BlueWallet.debug.xcconfig"; path = "Target Support Files/Pods-BlueWallet/Pods-BlueWallet.debug.xcconfig"; sourceTree = "<group>"; };
|
B68F8552DD4428F64B11DCFB /* Pods-BlueWallet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BlueWallet.debug.xcconfig"; path = "Target Support Files/Pods-BlueWallet/Pods-BlueWallet.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
|
@ -470,7 +474,7 @@
|
||||||
files = (
|
files = (
|
||||||
782F075B5DD048449E2DECE9 /* libz.tbd in Frameworks */,
|
782F075B5DD048449E2DECE9 /* libz.tbd in Frameworks */,
|
||||||
764B49B1420D4AEB8109BF62 /* libsqlite3.0.tbd in Frameworks */,
|
764B49B1420D4AEB8109BF62 /* libsqlite3.0.tbd in Frameworks */,
|
||||||
C978A716948AB7DEC5B6F677 /* BuildFile in Frameworks */,
|
C978A716948AB7DEC5B6F677 /* (null) in Frameworks */,
|
||||||
773E382FE62E836172AAB98B /* libPods-BlueWallet.a in Frameworks */,
|
773E382FE62E836172AAB98B /* libPods-BlueWallet.a in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
@ -705,6 +709,7 @@
|
||||||
83CBB9F61A601CBA00E9B192 = {
|
83CBB9F61A601CBA00E9B192 = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
B4B1A4612BFA73110072E3BB /* WidgetHelper.swift */,
|
||||||
B44033C82BCC34AC00162242 /* Shared */,
|
B44033C82BCC34AC00162242 /* Shared */,
|
||||||
B41C2E552BB3DCB8000FE097 /* PrivacyInfo.xcprivacy */,
|
B41C2E552BB3DCB8000FE097 /* PrivacyInfo.xcprivacy */,
|
||||||
B4549F2E2B80FEA1002E3153 /* ci_scripts */,
|
B4549F2E2B80FEA1002E3153 /* ci_scripts */,
|
||||||
|
@ -1110,7 +1115,7 @@
|
||||||
);
|
);
|
||||||
mainGroup = 83CBB9F61A601CBA00E9B192;
|
mainGroup = 83CBB9F61A601CBA00E9B192;
|
||||||
packageReferences = (
|
packageReferences = (
|
||||||
6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode.git" */,
|
6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode" */,
|
||||||
B41B76832B66B2FF002C48D5 /* XCRemoteSwiftPackageReference "bugsnag-cocoa" */,
|
B41B76832B66B2FF002C48D5 /* XCRemoteSwiftPackageReference "bugsnag-cocoa" */,
|
||||||
);
|
);
|
||||||
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
|
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
|
||||||
|
@ -1508,6 +1513,7 @@
|
||||||
B44034072BCC38A000162242 /* FiatUnit.swift in Sources */,
|
B44034072BCC38A000162242 /* FiatUnit.swift in Sources */,
|
||||||
B44034002BCC37F800162242 /* Bundle+decode.swift in Sources */,
|
B44034002BCC37F800162242 /* Bundle+decode.swift in Sources */,
|
||||||
B44033E22BCC36CB00162242 /* Placeholders.swift in Sources */,
|
B44033E22BCC36CB00162242 /* Placeholders.swift in Sources */,
|
||||||
|
B4B1A4622BFA73110072E3BB /* WidgetHelper.swift in Sources */,
|
||||||
B44033DA2BCC369A00162242 /* Colors.swift in Sources */,
|
B44033DA2BCC369A00162242 /* Colors.swift in Sources */,
|
||||||
B44033D32BCC368800162242 /* UserDefaultsGroupKey.swift in Sources */,
|
B44033D32BCC368800162242 /* UserDefaultsGroupKey.swift in Sources */,
|
||||||
32B5A32A2334450100F8D608 /* Bridge.swift in Sources */,
|
32B5A32A2334450100F8D608 /* Bridge.swift in Sources */,
|
||||||
|
@ -1528,6 +1534,7 @@
|
||||||
B40FC3FA29CCD1D00007EBAC /* SwiftTCPClient.swift in Sources */,
|
B40FC3FA29CCD1D00007EBAC /* SwiftTCPClient.swift in Sources */,
|
||||||
6DD410A1266CADF10087DE03 /* Widgets.swift in Sources */,
|
6DD410A1266CADF10087DE03 /* Widgets.swift in Sources */,
|
||||||
6DD410AC266CAE470087DE03 /* PriceWidget.swift in Sources */,
|
6DD410AC266CAE470087DE03 /* PriceWidget.swift in Sources */,
|
||||||
|
B4B1A4642BFA73110072E3BB /* WidgetHelper.swift in Sources */,
|
||||||
B44033D52BCC368800162242 /* UserDefaultsGroupKey.swift in Sources */,
|
B44033D52BCC368800162242 /* UserDefaultsGroupKey.swift in Sources */,
|
||||||
6DD410B2266CAF5C0087DE03 /* WalletInformationView.swift in Sources */,
|
6DD410B2266CAF5C0087DE03 /* WalletInformationView.swift in Sources */,
|
||||||
B44034022BCC37F800162242 /* Bundle+decode.swift in Sources */,
|
B44034022BCC37F800162242 /* Bundle+decode.swift in Sources */,
|
||||||
|
@ -1624,6 +1631,7 @@
|
||||||
B44033C72BCC332400162242 /* Balance.swift in Sources */,
|
B44033C72BCC332400162242 /* Balance.swift in Sources */,
|
||||||
B44033FC2BCC379200162242 /* WidgetDataStore.swift in Sources */,
|
B44033FC2BCC379200162242 /* WidgetDataStore.swift in Sources */,
|
||||||
B44033C22BCC32F800162242 /* BitcoinUnit.swift in Sources */,
|
B44033C22BCC32F800162242 /* BitcoinUnit.swift in Sources */,
|
||||||
|
B4B1A4652BFA73110072E3BB /* WidgetHelper.swift in Sources */,
|
||||||
B44033F12BCC374500162242 /* Numeric+abbreviated.swift in Sources */,
|
B44033F12BCC374500162242 /* Numeric+abbreviated.swift in Sources */,
|
||||||
B44034032BCC37F800162242 /* Bundle+decode.swift in Sources */,
|
B44034032BCC37F800162242 /* Bundle+decode.swift in Sources */,
|
||||||
B44033CD2BCC350A00162242 /* Currency.swift in Sources */,
|
B44033CD2BCC350A00162242 /* Currency.swift in Sources */,
|
||||||
|
@ -2619,7 +2627,7 @@
|
||||||
/* End XCConfigurationList section */
|
/* End XCConfigurationList section */
|
||||||
|
|
||||||
/* Begin XCRemoteSwiftPackageReference section */
|
/* Begin XCRemoteSwiftPackageReference section */
|
||||||
6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode.git" */ = {
|
6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode" */ = {
|
||||||
isa = XCRemoteSwiftPackageReference;
|
isa = XCRemoteSwiftPackageReference;
|
||||||
repositoryURL = "https://github.com/EFPrefix/EFQRCode.git";
|
repositoryURL = "https://github.com/EFPrefix/EFQRCode.git";
|
||||||
requirement = {
|
requirement = {
|
||||||
|
@ -2640,7 +2648,7 @@
|
||||||
/* Begin XCSwiftPackageProductDependency section */
|
/* Begin XCSwiftPackageProductDependency section */
|
||||||
6DFC806F24EA0B6C007B8700 /* EFQRCode */ = {
|
6DFC806F24EA0B6C007B8700 /* EFQRCode */ = {
|
||||||
isa = XCSwiftPackageProductDependency;
|
isa = XCSwiftPackageProductDependency;
|
||||||
package = 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode.git" */;
|
package = 6DFC806E24EA0B6C007B8700 /* XCRemoteSwiftPackageReference "EFQRCode" */;
|
||||||
productName = EFQRCode;
|
productName = EFQRCode;
|
||||||
};
|
};
|
||||||
B41B76842B66B2FF002C48D5 /* Bugsnag */ = {
|
B41B76842B66B2FF002C48D5 /* Bugsnag */ = {
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
#import <React/RCTRootView.h>
|
#import <React/RCTRootView.h>
|
||||||
#import <Bugsnag/Bugsnag.h>
|
#import <Bugsnag/Bugsnag.h>
|
||||||
|
|
||||||
|
#import "BlueWallet-Swift.h"
|
||||||
|
|
||||||
@interface AppDelegate() <UNUserNotificationCenterDelegate>
|
@interface AppDelegate() <UNUserNotificationCenterDelegate>
|
||||||
|
|
||||||
@property (nonatomic, strong) UIView *launchScreenView;
|
@property (nonatomic, strong) UIView *launchScreenView;
|
||||||
|
@ -21,7 +23,7 @@
|
||||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||||
{
|
{
|
||||||
[self clearFilesIfNeeded];
|
[self clearFilesIfNeeded];
|
||||||
NSUserDefaults *group = [[NSUserDefaults alloc] initWithSuiteName:@"group.io.bluewallet.bluewallet"];
|
NSUserDefaults *group = [[NSUserDefaults alloc] initWithSuiteName:@"group.io.bluewallet.bluewallet"];
|
||||||
NSString *isDoNotTrackEnabled = [group stringForKey:@"donottrack"];
|
NSString *isDoNotTrackEnabled = [group stringForKey:@"donottrack"];
|
||||||
if (![isDoNotTrackEnabled isEqualToString:@"1"]) {
|
if (![isDoNotTrackEnabled isEqualToString:@"1"]) {
|
||||||
// Set the appType based on the current platform
|
// Set the appType based on the current platform
|
||||||
|
@ -50,7 +52,9 @@ NSUserDefaults *group = [[NSUserDefaults alloc] initWithSuiteName:@"group.io.blu
|
||||||
|
|
||||||
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
|
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
|
||||||
center.delegate = self;
|
center.delegate = self;
|
||||||
|
|
||||||
|
[self setupUserDefaultsListener];
|
||||||
|
|
||||||
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,6 +73,22 @@ NSUserDefaults *group = [[NSUserDefaults alloc] initWithSuiteName:@"group.io.blu
|
||||||
{
|
{
|
||||||
[self copyDeviceUID];
|
[self copyDeviceUID];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NSArray *keys = @[
|
||||||
|
@"WidgetCommunicationAllWalletsSatoshiBalance",
|
||||||
|
@"WidgetCommunicationAllWalletsLatestTransactionTime",
|
||||||
|
@"WidgetCommunicationDisplayBalanceAllowed",
|
||||||
|
@"WidgetCommunicationLatestTransactionIsUnconfirmed",
|
||||||
|
@"preferredCurrency",
|
||||||
|
@"preferredCurrencyLocale",
|
||||||
|
@"electrum_host",
|
||||||
|
@"electrum_tcp_port",
|
||||||
|
@"electrum_ssl_port"
|
||||||
|
];
|
||||||
|
|
||||||
|
if ([keys containsObject:keyPath]) {
|
||||||
|
[WidgetHelper reloadAllWidgets];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)copyDeviceUID {
|
- (void)copyDeviceUID {
|
||||||
|
@ -86,6 +106,24 @@ NSUserDefaults *group = [[NSUserDefaults alloc] initWithSuiteName:@"group.io.blu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setupUserDefaultsListener {
|
||||||
|
NSString *appGroup = @"group.io.bluewallet.bluewallet";
|
||||||
|
NSUserDefaults *userDefaults = [[NSUserDefaults alloc] initWithSuiteName:appGroup];
|
||||||
|
|
||||||
|
NSArray *keys = @[
|
||||||
|
@"WidgetCommunicationAllWalletsSatoshiBalance",
|
||||||
|
@"WidgetCommunicationAllWalletsLatestTransactionTime",
|
||||||
|
@"WidgetCommunicationDisplayBalanceAllowed",
|
||||||
|
@"WidgetCommunicationLatestTransactionIsUnconfirmed",
|
||||||
|
@"preferredCurrency",
|
||||||
|
@"preferredCurrencyLocale"
|
||||||
|
];
|
||||||
|
|
||||||
|
for (NSString *key in keys) {
|
||||||
|
[userDefaults addObserver:self forKeyPath:key options:NSKeyValueObservingOptionNew context:NULL];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity
|
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity
|
||||||
restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
|
restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler
|
||||||
{
|
{
|
||||||
|
@ -134,8 +172,8 @@ NSUserDefaults *group = [[NSUserDefaults alloc] initWithSuiteName:@"group.io.blu
|
||||||
[builder removeMenuForIdentifier:UIMenuToolbar];
|
[builder removeMenuForIdentifier:UIMenuToolbar];
|
||||||
|
|
||||||
// File -> Add Wallet (Command + A)
|
// File -> Add Wallet (Command + A)
|
||||||
UIKeyCommand *addWalletCommand = [UIKeyCommand keyCommandWithInput:@"A"
|
UIKeyCommand *addWalletCommand = [UIKeyCommand keyCommandWithInput:@"A"
|
||||||
modifierFlags:UIKeyModifierCommand | UIKeyModifierShift
|
modifierFlags:UIKeyModifierCommand | UIKeyModifierShift
|
||||||
action:@selector(addWalletAction:)];
|
action:@selector(addWalletAction:)];
|
||||||
[addWalletCommand setTitle:@"Add Wallet"];
|
[addWalletCommand setTitle:@"Add Wallet"];
|
||||||
|
|
||||||
|
@ -290,5 +328,4 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -352,8 +352,6 @@ PODS:
|
||||||
- react-native-tcp-socket (6.0.6):
|
- react-native-tcp-socket (6.0.6):
|
||||||
- CocoaAsyncSocket
|
- CocoaAsyncSocket
|
||||||
- React-Core
|
- React-Core
|
||||||
- react-native-widget-center (0.0.9):
|
|
||||||
- React
|
|
||||||
- React-NativeModulesApple (0.72.14):
|
- React-NativeModulesApple (0.72.14):
|
||||||
- hermes-engine
|
- hermes-engine
|
||||||
- React-callinvoker
|
- React-callinvoker
|
||||||
|
@ -561,7 +559,6 @@ DEPENDENCIES:
|
||||||
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
|
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
|
||||||
- react-native-secure-key-store (from `../node_modules/react-native-secure-key-store`)
|
- react-native-secure-key-store (from `../node_modules/react-native-secure-key-store`)
|
||||||
- react-native-tcp-socket (from `../node_modules/react-native-tcp-socket`)
|
- react-native-tcp-socket (from `../node_modules/react-native-tcp-socket`)
|
||||||
- react-native-widget-center (from `../node_modules/react-native-widget-center`)
|
|
||||||
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
|
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
|
||||||
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
|
- React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`)
|
||||||
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
|
- React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`)
|
||||||
|
@ -688,8 +685,6 @@ EXTERNAL SOURCES:
|
||||||
:path: "../node_modules/react-native-secure-key-store"
|
:path: "../node_modules/react-native-secure-key-store"
|
||||||
react-native-tcp-socket:
|
react-native-tcp-socket:
|
||||||
:path: "../node_modules/react-native-tcp-socket"
|
:path: "../node_modules/react-native-tcp-socket"
|
||||||
react-native-widget-center:
|
|
||||||
:path: "../node_modules/react-native-widget-center"
|
|
||||||
React-NativeModulesApple:
|
React-NativeModulesApple:
|
||||||
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios"
|
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios"
|
||||||
React-perflogger:
|
React-perflogger:
|
||||||
|
@ -817,7 +812,6 @@ SPEC CHECKSUMS:
|
||||||
react-native-safe-area-context: dcab599c527c2d7de2d76507a523d20a0b83823d
|
react-native-safe-area-context: dcab599c527c2d7de2d76507a523d20a0b83823d
|
||||||
react-native-secure-key-store: 910e6df6bc33cb790aba6ee24bc7818df1fe5898
|
react-native-secure-key-store: 910e6df6bc33cb790aba6ee24bc7818df1fe5898
|
||||||
react-native-tcp-socket: e724380c910c2e704816ec817ed28f1342246ff7
|
react-native-tcp-socket: e724380c910c2e704816ec817ed28f1342246ff7
|
||||||
react-native-widget-center: 12dfba20a4fa995850b52cf0afecf734397f4b9c
|
|
||||||
React-NativeModulesApple: 3107f777453f953906d9ba9dc5f8cbd91a6ef913
|
React-NativeModulesApple: 3107f777453f953906d9ba9dc5f8cbd91a6ef913
|
||||||
React-perflogger: daabc494c6328efc1784a4b49b8b74fca305d11c
|
React-perflogger: daabc494c6328efc1784a4b49b8b74fca305d11c
|
||||||
React-RCTActionSheet: 0e0e64a7cf6c07f1de73d1f0a92d26a70262b256
|
React-RCTActionSheet: 0e0e64a7cf6c07f1de73d1f0a92d26a70262b256
|
||||||
|
|
11
ios/WidgetHelper.swift
Normal file
11
ios/WidgetHelper.swift
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import WidgetKit
|
||||||
|
|
||||||
|
@objc class WidgetHelper: NSObject {
|
||||||
|
@objc static func reloadAllWidgets() {
|
||||||
|
if #available(iOS 14.0, *) {
|
||||||
|
WidgetCenter.shared.reloadAllTimelines()
|
||||||
|
} else {
|
||||||
|
// Fallback on earlier versions
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
14
package-lock.json
generated
14
package-lock.json
generated
|
@ -97,7 +97,6 @@
|
||||||
"react-native-tcp-socket": "6.0.6",
|
"react-native-tcp-socket": "6.0.6",
|
||||||
"react-native-vector-icons": "10.1.0",
|
"react-native-vector-icons": "10.1.0",
|
||||||
"react-native-watch-connectivity": "1.1.0",
|
"react-native-watch-connectivity": "1.1.0",
|
||||||
"react-native-widget-center": "https://github.com/BlueWallet/react-native-widget-center#a128c38",
|
|
||||||
"readable-stream": "3.6.2",
|
"readable-stream": "3.6.2",
|
||||||
"realm": "12.8.1",
|
"realm": "12.8.1",
|
||||||
"rn-ldk": "github:BlueWallet/rn-ldk#v0.8.4",
|
"rn-ldk": "github:BlueWallet/rn-ldk#v0.8.4",
|
||||||
|
@ -19873,15 +19872,6 @@
|
||||||
"react-native": ">=0.40"
|
"react-native": ">=0.40"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-native-widget-center": {
|
|
||||||
"version": "0.0.9",
|
|
||||||
"resolved": "git+ssh://git@github.com/BlueWallet/react-native-widget-center.git#a128c389526d55afdd67937494f2fec224dd0009",
|
|
||||||
"license": "MIT",
|
|
||||||
"peerDependencies": {
|
|
||||||
"react": "^16.8.1",
|
|
||||||
"react-native": ">=0.60.0-rc.0 <1.0.x"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/react-native/node_modules/@jest/types": {
|
"node_modules/react-native/node_modules/@jest/types": {
|
||||||
"version": "26.6.2",
|
"version": "26.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz",
|
||||||
|
@ -37426,10 +37416,6 @@
|
||||||
"lodash.sortby": "^4.7.0"
|
"lodash.sortby": "^4.7.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"react-native-widget-center": {
|
|
||||||
"version": "git+ssh://git@github.com/BlueWallet/react-native-widget-center.git#a128c389526d55afdd67937494f2fec224dd0009",
|
|
||||||
"from": "react-native-widget-center@https://github.com/BlueWallet/react-native-widget-center#a128c38"
|
|
||||||
},
|
|
||||||
"react-refresh": {
|
"react-refresh": {
|
||||||
"version": "0.4.3",
|
"version": "0.4.3",
|
||||||
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.4.3.tgz",
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
"android:clean": "cd android; ./gradlew clean ; cd .. ; npm run android",
|
"android:clean": "cd android; ./gradlew clean ; cd .. ; npm run android",
|
||||||
"ios": "react-native run-ios",
|
"ios": "react-native run-ios",
|
||||||
"postinstall": "rn-nodeify --install buffer,events,process,stream,inherits,path,assert,crypto --hack; npm run releasenotes2json; npm run branch2json; npm run patches",
|
"postinstall": "rn-nodeify --install buffer,events,process,stream,inherits,path,assert,crypto --hack; npm run releasenotes2json; npm run branch2json; npm run patches",
|
||||||
"patches": "patch -p1 < scripts/rn-ldk.patch; patch -p1 < scripts/react-native-camera-kit.patch; patch -p1 < scripts/react-native-widget-center.patch",
|
"patches": "patch -p1 < scripts/rn-ldk.patch; patch -p1 < scripts/react-native-camera-kit.patch;",
|
||||||
"test": "npm run tslint && npm run lint && npm run unit && npm run jest",
|
"test": "npm run tslint && npm run lint && npm run unit && npm run jest",
|
||||||
"jest": "jest -b tests/integration/*",
|
"jest": "jest -b tests/integration/*",
|
||||||
"e2e:debug-build": "detox build -c android.debug",
|
"e2e:debug-build": "detox build -c android.debug",
|
||||||
|
@ -182,7 +182,6 @@
|
||||||
"react-native-tcp-socket": "6.0.6",
|
"react-native-tcp-socket": "6.0.6",
|
||||||
"react-native-vector-icons": "10.1.0",
|
"react-native-vector-icons": "10.1.0",
|
||||||
"react-native-watch-connectivity": "1.1.0",
|
"react-native-watch-connectivity": "1.1.0",
|
||||||
"react-native-widget-center": "https://github.com/BlueWallet/react-native-widget-center#a128c38",
|
|
||||||
"readable-stream": "3.6.2",
|
"readable-stream": "3.6.2",
|
||||||
"realm": "12.8.1",
|
"realm": "12.8.1",
|
||||||
"rn-ldk": "github:BlueWallet/rn-ldk#v0.8.4",
|
"rn-ldk": "github:BlueWallet/rn-ldk#v0.8.4",
|
||||||
|
|
|
@ -28,7 +28,6 @@ import {
|
||||||
BlueDismissKeyboardInputAccessory,
|
BlueDismissKeyboardInputAccessory,
|
||||||
} from '../../BlueComponents';
|
} from '../../BlueComponents';
|
||||||
import { BlueCurrentTheme } from '../../components/themes';
|
import { BlueCurrentTheme } from '../../components/themes';
|
||||||
import { reloadAllTimelines } from '../../components/WidgetCommunication';
|
|
||||||
import { BlueStorageContext } from '../../blue_modules/storage-context';
|
import { BlueStorageContext } from '../../blue_modules/storage-context';
|
||||||
import presentAlert from '../../components/Alert';
|
import presentAlert from '../../components/Alert';
|
||||||
import { scanQrHelper } from '../../helpers/scan-qr';
|
import { scanQrHelper } from '../../helpers/scan-qr';
|
||||||
|
@ -170,7 +169,6 @@ export default class ElectrumSettings extends Component {
|
||||||
await DefaultPreference.clear(BlueElectrum.ELECTRUM_HOST);
|
await DefaultPreference.clear(BlueElectrum.ELECTRUM_HOST);
|
||||||
await DefaultPreference.clear(BlueElectrum.ELECTRUM_SSL_PORT);
|
await DefaultPreference.clear(BlueElectrum.ELECTRUM_SSL_PORT);
|
||||||
await DefaultPreference.clear(BlueElectrum.ELECTRUM_TCP_PORT);
|
await DefaultPreference.clear(BlueElectrum.ELECTRUM_TCP_PORT);
|
||||||
reloadAllTimelines();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Must be running on Android
|
// Must be running on Android
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
@ -199,7 +197,6 @@ export default class ElectrumSettings extends Component {
|
||||||
await DefaultPreference.set(BlueElectrum.ELECTRUM_HOST, host);
|
await DefaultPreference.set(BlueElectrum.ELECTRUM_HOST, host);
|
||||||
await DefaultPreference.set(BlueElectrum.ELECTRUM_TCP_PORT, port);
|
await DefaultPreference.set(BlueElectrum.ELECTRUM_TCP_PORT, port);
|
||||||
await DefaultPreference.set(BlueElectrum.ELECTRUM_SSL_PORT, sslPort);
|
await DefaultPreference.set(BlueElectrum.ELECTRUM_SSL_PORT, sslPort);
|
||||||
reloadAllTimelines();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Must be running on Android
|
// Must be running on Android
|
||||||
console.log(e);
|
console.log(e);
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
--- ../node_modules/react-native-widget-center/android/build.gradle 2023-11-10 11:25:36
|
|
||||||
+++ ../node_modules/react-native-widget-center/android/build.gradle 2023-11-10 11:25:42
|
|
||||||
|
|
||||||
@@ -103,12 +103,12 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
|
|
||||||
- classifier = 'javadoc'
|
|
||||||
+ archiveClassifier.set('javadoc')
|
|
||||||
from androidJavadoc.destinationDir
|
|
||||||
}
|
|
||||||
|
|
||||||
task androidSourcesJar(type: Jar) {
|
|
||||||
- classifier = 'sources'
|
|
||||||
+ archiveClassifier.set('sources')
|
|
||||||
from android.sourceSets.main.java.srcDirs
|
|
||||||
include '**/*.java'
|
|
||||||
}
|
|
|
@ -188,12 +188,6 @@ jest.mock('react-native-share', () => {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
jest.mock('../components/WidgetCommunication', () => {
|
|
||||||
return {
|
|
||||||
reloadAllTimelines: jest.fn(),
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
const mockKeychain = {
|
const mockKeychain = {
|
||||||
SECURITY_LEVEL_ANY: 'MOCK_SECURITY_LEVEL_ANY',
|
SECURITY_LEVEL_ANY: 'MOCK_SECURITY_LEVEL_ANY',
|
||||||
SECURITY_LEVEL_SECURE_SOFTWARE: 'MOCK_SECURITY_LEVEL_SECURE_SOFTWARE',
|
SECURITY_LEVEL_SECURE_SOFTWARE: 'MOCK_SECURITY_LEVEL_SECURE_SOFTWARE',
|
||||||
|
|
Loading…
Add table
Reference in a new issue