Skip to content

Commit

Permalink
Feature/release setup ios (#182)
Browse files Browse the repository at this point in the history
* - renaming of clients to Bisq Connect

* - fix crash on take offer (when offer cannot be taken)

* - ios release setup
  • Loading branch information
rodvar authored Feb 3, 2025
1 parent 5e173e2 commit ebc6446
Show file tree
Hide file tree
Showing 11 changed files with 373 additions and 56 deletions.
2 changes: 1 addition & 1 deletion androidClient/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ android {
val variant = this
outputs.all {
val output = this as com.android.build.gradle.internal.api.BaseVariantOutputImpl
val appName = "BisqCli"
val appName = "Bisq Connect"
val version = variant.versionName
val fileName = "$appName-$version.apk"
output.outputFileName = fileName
Expand Down
2 changes: 1 addition & 1 deletion androidClient/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Bisq Cli proguard file
# Bisq Connect proguard file

## Ktor
### Keep Ktor Client Core
Expand Down
2 changes: 1 addition & 1 deletion androidClient/src/androidDebug/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Bisq Cli (debug)</string>
<string name="app_name">Bisq Connect (debug)</string>
</resources>
2 changes: 1 addition & 1 deletion androidClient/src/androidMain/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Bisq Cli</string>
<string name="app_name">Bisq Connect</string>
</resources>
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ shared.version=0.0.11
node.name=Bisq
node.android.version=0.0.15

client.name=Bisq Cli
client.name=Bisq Connect
client.android.version=0.0.9
client.ios.version=0.0.9

Expand Down
2 changes: 1 addition & 1 deletion iosClient/Configuration/Config.xcconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TEAM_ID=UC4273Y485
BUNDLE_ID=network.bisq.mobile.ios
APP_NAME=Bisq Cli
APP_NAME=Bisq Connect
248 changes: 238 additions & 10 deletions iosClient/iosClient.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1620"
version = "2.2">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "NO"
buildForRunning = "NO"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7555FF7A242A565900829871"
BuildableName = "Bisq Connect.app"
BlueprintName = "Bisq Connect Debug"
ReferencedContainer = "container:iosClient.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<AutocreatedTestPlanReference>
</AutocreatedTestPlanReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "74831B692D5088E600B729F4"
BuildableName = "Bisq Connect.app"
BlueprintName = "Bisq Connect"
ReferencedContainer = "container:iosClient.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "74831B692D5088E600B729F4"
BuildableName = "Bisq Connect.app"
BlueprintName = "Bisq Connect"
ReferencedContainer = "container:iosClient.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
6 changes: 2 additions & 4 deletions iosClient/iosClient/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,13 @@
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,28 @@ class TakeOfferAmountPresenter(
private lateinit var baseAmount: CoinVO

override fun onViewAttached() {
takeOfferModel = takeOfferPresenter.takeOfferModel
val offerListItem = takeOfferModel.offerItemPresentationVO
quoteCurrencyCode = offerListItem.bisqEasyOffer.market.quoteCurrencyCode

val rangeAmountSpec: RangeAmountSpecVO =
offerListItem.bisqEasyOffer.amountSpec as RangeAmountSpecVO
minAmount = maxOf(getMinAmountValue(), rangeAmountSpec.minAmount)
maxAmount = minOf(getMaxAmountValue(), rangeAmountSpec.maxAmount)

formattedMinAmount = AmountFormatter.formatAmount(FiatVOFactory.from(minAmount, quoteCurrencyCode))
formattedMinAmountWithCode = AmountFormatter.formatAmount(FiatVOFactory.from(minAmount, quoteCurrencyCode), true, true)
formattedMaxAmountWithCode = AmountFormatter.formatAmount(FiatVOFactory.from(maxAmount, quoteCurrencyCode), true, true)

_formattedQuoteAmount.value = offerListItem.formattedQuoteAmount
_formattedBaseAmount.value = offerListItem.formattedBaseAmount.value

sliderPosition = 0.5f
applySliderValue(sliderPosition)
runCatching {
takeOfferModel = takeOfferPresenter.takeOfferModel
val offerListItem = takeOfferModel.offerItemPresentationVO
quoteCurrencyCode = offerListItem.bisqEasyOffer.market.quoteCurrencyCode

val rangeAmountSpec: RangeAmountSpecVO =
offerListItem.bisqEasyOffer.amountSpec as RangeAmountSpecVO
minAmount = maxOf(getMinAmountValue(), rangeAmountSpec.minAmount)
maxAmount = minOf(getMaxAmountValue(), rangeAmountSpec.maxAmount)

formattedMinAmount = AmountFormatter.formatAmount(FiatVOFactory.from(minAmount, quoteCurrencyCode))
formattedMinAmountWithCode = AmountFormatter.formatAmount(FiatVOFactory.from(minAmount, quoteCurrencyCode), true, true)
formattedMaxAmountWithCode = AmountFormatter.formatAmount(FiatVOFactory.from(maxAmount, quoteCurrencyCode), true, true)

_formattedQuoteAmount.value = offerListItem.formattedQuoteAmount
_formattedBaseAmount.value = offerListItem.formattedBaseAmount.value

sliderPosition = 0.5f
applySliderValue(sliderPosition)
}.onFailure { e ->
log.e(e) { "Failed to present view" }
}
}

//todo convert to selected currency from USD value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ class TakeOfferReviewPresenter(
private val takeOfferErrorMessage: MutableStateFlow<String?> = MutableStateFlow(null)

override fun onViewAttached() {
presenterScope.launch {
takeOfferStatus.collect { value ->
log.i { "takeOfferStatus: $value" }
//todo show state
}
}
presenterScope.launch {
takeOfferErrorMessage.collect { message ->
showSnackbar(message ?: "Unexpected error occurred, please try again", true)
}
}

takeOfferModel = takeOfferPresenter.takeOfferModel

quoteSidePaymentMethodDisplayString = appStrings.paymentMethod.toDisplayString(takeOfferModel.quoteSidePaymentMethod)
Expand Down Expand Up @@ -81,30 +93,18 @@ class TakeOfferReviewPresenter(
}

fun onTakeOffer() {
presenterScope.launch {
launch {
takeOfferStatus.collect { value ->
log.i { "takeOfferStatus: $value" }
//todo show state
}
}
launch {
takeOfferErrorMessage.collect { value ->
log.i { "takeOfferErrorMessage: $value" }
//todo show error
}
}
}
backgroundScope.launch {
// TODO deactivate buttons, show waiting state
try {
enableInteractive(false)
takeOfferPresenter.takeOffer(takeOfferStatus, takeOfferErrorMessage)
} catch (e: Exception) {
log.e("Take offer failed", e)
// show error to user
// TODO this is not working (probably the snackbar is being rendered underneath?)
takeOfferErrorMessage.value = e.message ?: "Offer cannot be taken at this time"
} finally {
onNavigateToMyTrades()
enableInteractive()
}
// TODO hide waiting state, show successfully published state, show button to open offer book, clear navigation backstack
onNavigateToMyTrades()
}
}

Expand Down

0 comments on commit ebc6446

Please sign in to comment.