Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
6dd56f2
added KeyManager class
chebizarro Dec 20, 2024
5d7bca8
Add key manager and related providers
chebizarro Dec 21, 2024
7ce5263
added full privacy mode setting to app settings
chebizarro Dec 21, 2024
dace285
Changed SecureStorageManager to SessionManager
chebizarro Dec 21, 2024
8cd3ac8
Moved session storage/retrieval to SessionManager
chebizarro Dec 23, 2024
90b0c06
Added separate wrap, seal and rumor functions
chebizarro Dec 23, 2024
d60899d
master key and trade key integration
chebizarro Dec 23, 2024
2d53182
minor edits
chebizarro Dec 23, 2024
0144d0e
Minor fixes to session expiration
chebizarro Dec 23, 2024
a27c70b
implementation of key manager features
chebizarro Dec 24, 2024
c731b63
verified sending new orders with full privacy
chebizarro Dec 24, 2024
7d299cb
message and session serialization and retrieval
chebizarro Dec 25, 2024
3290c1f
updated mostro message to handle cant-do
chebizarro Dec 25, 2024
b3615e0
Implementation of order persistence between restarts
chebizarro Dec 25, 2024
a055be9
change order > content to order > payload
chebizarro Dec 26, 2024
e993b95
Initialize and load sessions at startup
chebizarro Dec 26, 2024
76d5971
Change rumor content to array
chebizarro Dec 26, 2024
0bb91c6
Debugging signing
chebizarro Dec 30, 2024
4240723
Added support for cant-do
chebizarro Dec 31, 2024
da5b982
add buy/sell order now working
chebizarro Jan 2, 2025
3d17946
Update lib/data/models/cant_do.dart
chebizarro Jan 3, 2025
f295e4a
should fix https://github.com/MostroP2P/mobile/pull/34#pullrequestrev…
chebizarro Jan 10, 2025
d81f1cb
Update lib/features/take_order/screens/add_lightning_invoice_screen.dart
chebizarro Jan 11, 2025
be21a2d
added localization extension for retrieving localized strings based o…
chebizarro Jan 11, 2025
ab1b7c3
Consolidate all OrderNotifiers as subclasses of AbstractOrderNotifier
chebizarro Jan 11, 2025
b9888a3
minor changes to order notifier and notification notifiers
chebizarro Jan 14, 2025
54f3b6a
Filter user orders and updated Add Order screen to match web client
chebizarro Jan 18, 2025
64efd54
Added OrderBook feature
chebizarro Jan 21, 2025
60703fc
Added Drawer to Home Screen
chebizarro Jan 25, 2025
ff3e6d1
Unifed order provider fixed
chebizarro Jan 26, 2025
3749491
added Chat and Database support
chebizarro Jan 26, 2025
4da43b6
Rationalised TakeOrderNotifier
chebizarro Jan 26, 2025
330a05f
removed bloc dependancy
chebizarro Feb 8, 2025
bdb6edc
Added integration and mocked unit tests
chebizarro Feb 9, 2025
af60aa0
Integration tests for Create Sell Order
chebizarro Feb 9, 2025
7d30f8b
Added Key Management and Relay screens
chebizarro Feb 9, 2025
23a856b
Added extra key manager methods for importing existing key
chebizarro Feb 10, 2025
ef838ab
Added rating feature
chebizarro Feb 10, 2025
b4287c8
renamed order book and chat to trades and messages respectively
chebizarro Feb 10, 2025
ba68084
switch persistence to sembat and updated dart_nostr to latest version
chebizarro Feb 12, 2025
64d4a27
updated mostro storage to use sembast
chebizarro Feb 12, 2025
8f94142
Clear caches
chebizarro Feb 13, 2025
64b5293
update tests
chebizarro Feb 13, 2025
86d2d39
Added Mostro Instance Screen and updated OrderNotifier strings
chebizarro Feb 14, 2025
90436bb
Add QR Code Reader to Lightning Invoice screen
chebizarro Feb 14, 2025
af2c715
Separate our Lightning invoice components to widgets
chebizarro Feb 15, 2025
39e2c27
Consolidated Drawer Screens
chebizarro Feb 16, 2025
bb371f0
Order Screens complete
chebizarro Feb 16, 2025
e30068b
Updated launch icons
chebizarro Feb 16, 2025
33c41b7
Major revisions
chebizarro Feb 17, 2025
9ed07e4
Changes to startup and added web support
chebizarro Feb 18, 2025
83ff94b
Added public test nostr relay and daemon as default
chebizarro Feb 18, 2025
c8bc4f1
set permissions for secure storage
chebizarro Feb 20, 2025
f0f1ef9
UX clean up
chebizarro Feb 20, 2025
7585026
Add mostro pubkey filter getting events
grunch Feb 20, 2025
91dfaf4
fixed privacy mode
chebizarro Feb 21, 2025
0da6684
added default relay
chebizarro Feb 21, 2025
710797b
Updated Settings Screen
chebizarro Feb 21, 2025
d561602
update build workflow
chebizarro Feb 21, 2025
ae1dd1f
More buildflow fixes
chebizarro Feb 21, 2025
f37eb89
Updated Take Order Screen and Home Screen Order List
chebizarro Feb 21, 2025
58d0bcb
improve Lightning Invoice Screen
chebizarro Feb 21, 2025
12ffd00
Improve images
grunch Feb 22, 2025
2ab2654
Add currency flag to my trades widget
grunch Feb 23, 2025
a722f54
Fix alignment on currency flag
grunch Feb 23, 2025
c85d198
Fix take order bug
chebizarro Feb 25, 2025
32a07aa
Merge remote-tracking branch 'refs/remotes/upstream/wip' into wip
chebizarro Feb 25, 2025
db82cd2
fix for build action
chebizarro Feb 25, 2025
753c9fc
works in full privacy mode
chebizarro Feb 26, 2025
6f7c62c
refactored app settings to be more reactive
chebizarro Feb 26, 2025
66c28ce
More settings refactoring
chebizarro Feb 26, 2025
6d4862c
Modified signing function
chebizarro Feb 27, 2025
cfa160b
start of mostro service refactor
chebizarro Mar 4, 2025
781242f
Refactored Mostro Service
chebizarro Mar 13, 2025
54c3480
Fixes error creating new order with ln address #38
chebizarro Mar 14, 2025
95ea019
Addresses When creating a new identity, the orders from the previous …
chebizarro Mar 14, 2025
2ede4a5
Started ChatRoom refactor
chebizarro Mar 18, 2025
983f3b0
Updated i10n strings to latest suggestions
chebizarro Mar 19, 2025
7b6800a
Implementation of Rate Counterpart
chebizarro Mar 19, 2025
8483549
Partial implementation of Increment trade index only on success #35
chebizarro Mar 19, 2025
f55bc91
Changed AddLightingForm to back to the Home Screen on back/close
chebizarro Mar 19, 2025
4baa690
Revert Increment trade index only on success #35 fix
chebizarro Mar 20, 2025
9dcfca7
Major refactor of MostroService including deprecation of MostroReposi…
chebizarro Mar 20, 2025
686d853
Added BaseStorage abstract class
chebizarro Mar 21, 2025
2d90530
Pay Invoice button added as per Add a Show Invoice button to the sell…
chebizarro Mar 25, 2025
61a4ac0
Cancel button should appear for relevant order states Button cancel i…
chebizarro Mar 25, 2025
146c549
First cut of Mostro Chat
chebizarro Mar 28, 2025
7a09bcb
Updated Drawer
chebizarro Mar 29, 2025
2453ef4
Refdactored Data Storage and Notifiers
chebizarro Apr 4, 2025
917de9f
Updated Settings and Account Screens
chebizarro Apr 4, 2025
082250e
add IT locale
bitcoininvenice Apr 13, 2025
998ff24
added background services
chebizarro Apr 16, 2025
1a067c1
Added changes to background interface and upgraded MacOS settings
chebizarro Apr 16, 2025
d550173
synchronize background services
chebizarro Apr 18, 2025
414af2b
Now uses two separate databases
chebizarro Apr 19, 2025
8768fcb
ensure NostrService init
chebizarro Apr 19, 2025
fe47e24
Rebuild of out of date annotated classes
chebizarro Apr 19, 2025
8b3d5d0
add isRunning property to BackgroundService
chebizarro Apr 19, 2025
f2c8bea
Remove extra event call
chebizarro Apr 19, 2025
6b2faf2
Add lifecycle manager and refactor background service database paths
chebizarro Apr 20, 2025
1280eef
Revert MostrService and ChatRoomNotifier to subscribing directly in t…
chebizarro Apr 21, 2025
bd6a5d6
Set background services to only run on app suspend
chebizarro Apr 22, 2025
b3fbba8
Startup modifications
chebizarro Apr 22, 2025
4f4f63e
Refactored background service
chebizarro Apr 23, 2025
d8b56db
Replace route builders with pageBuilder to add fade transitions betwe…
chebizarro Apr 23, 2025
d2e574d
Added isRunning callback
chebizarro Apr 23, 2025
c4c8210
renamed notification icon
chebizarro Apr 24, 2025
0cca048
Add background service capabilities and persistent notifications for …
chebizarro Apr 25, 2025
27193bf
Mo background changes
chebizarro Apr 25, 2025
66a1f5c
Avoid race conditions when app is backgrounded
chebizarro Apr 25, 2025
471d615
Add logging and improve app state transitions between foreground/back…
chebizarro Apr 25, 2025
df567e4
Add NostrResponsiveButton widget and refactor order repository reload…
chebizarro Apr 25, 2025
d9bc94b
Add async state handling and refresh functionality to trades screen
chebizarro Apr 25, 2025
8a1d69e
Refactor buttons using NostrResponsiveButton and improve state manage…
chebizarro Apr 26, 2025
051187e
Refactor message handling to use Sembast storage streams instead of E…
chebizarro Apr 26, 2025
534e752
Add stream providers and watch methods for sessions and messages
chebizarro Apr 26, 2025
f8e61a2
Refactor storage and session providers, add error handling and remove…
chebizarro Apr 26, 2025
b9f8e13
Add auto-reset to button and improve order request ID generation for …
chebizarro Apr 26, 2025
5e4382b
Fix order stream to emit cached events immediately and handle empty s…
chebizarro Apr 26, 2025
ab34fe0
Refactor storage repositories to use base class and improve message h…
chebizarro Apr 26, 2025
31d7b20
Merge pull request #61 from bitcoininvenice/wip
chebizarro Apr 27, 2025
a027e54
Add FSM-based order status tracking and update UI to use canonical st…
chebizarro Apr 27, 2025
01fba26
Refactor message stream to use watchAllMessages and emit latest message
chebizarro Apr 27, 2025
6b6024c
More refactoring of MostroStorage
chebizarro Apr 27, 2025
689ed27
Modified status source in TradesDetailScreen and MostroMessageDetailW…
chebizarro Apr 27, 2025
d08026d
Change Lifecycle to mobile only and Modify MostroStorage
chebizarro Apr 27, 2025
4e7b6c0
Separated events and orders databases into separate files to prevent …
chebizarro Apr 27, 2025
bf7c471
Fix order not saving pubkeys when serialized
chebizarro Apr 27, 2025
5d2be24
Refactor message storage and retrieval to use latest messages consist…
chebizarro Apr 28, 2025
8a0c78b
Fix message watching and improve order notifier initialization
chebizarro Apr 28, 2025
ea13f29
Add TradeState model and providers to manage trade status and actions
chebizarro Apr 28, 2025
2ff522e
Cleanup TradeDetailScreen
chebizarro Apr 28, 2025
136aa0d
Convert FutureProvider to StreamProvider for real-time order updates
chebizarro Apr 29, 2025
965304a
Make mostroService and eventStorage providers keepAlive and remove ca…
chebizarro Apr 29, 2025
24d0e72
Add dispose logic for order notifiers and handle order cancellation c…
chebizarro Apr 29, 2025
0fe7d69
Refactor NostrResponsiveButton to use direct action/orderId instead o…
chebizarro Apr 29, 2025
a970c3a
Rename NostrResponsiveButton to MostroReactiveButton and update refer…
chebizarro Apr 29, 2025
c3bbb19
Fix chat message deduplication and add sorting by creation timestamp
chebizarro Apr 29, 2025
0a6ad39
Add notification permissions and enhance notification settings for An…
chebizarro Apr 29, 2025
c3dd554
Simplify reloadData by removing event clearing and empty list emission
chebizarro Apr 29, 2025
9d5399b
Improve chat reliability and add event persistence with lifecycle man…
chebizarro Apr 29, 2025
8bb0f58
Replace event provider with mostro storage and remove duplicate event…
chebizarro Apr 29, 2025
4c325a5
Only request notifications on Android and filter sessions newer than …
chebizarro Apr 29, 2025
2f07d2b
Only subscribe to sessions created within the last 24 hours
chebizarro Apr 29, 2025
c90865a
Refactor session updates and add terminal status checks for active or…
chebizarro Apr 30, 2025
ce672bb
Refactor button styles and remove hardcoded dimensions from reactive …
chebizarro Apr 30, 2025
0f39455
Filter chats older than 36h and fix session orderId update logic
chebizarro Apr 30, 2025
413d51f
Merge remote-tracking branch 'upstream/wip' into background
chebizarro May 4, 2025
6c28f4d
Merge remote-tracking branch 'upstream/main' into background
chebizarro May 4, 2025
4aca13c
Fix order notifier disposal and add Italian localization
chebizarro May 6, 2025
906e3bb
Refactor background service and storage management; remove unused rep…
chebizarro May 7, 2025
a88ba04
Refactor notification handling, improve order update logic, and enhan…
chebizarro May 8, 2025
cbcd51b
Refactor notification service to use a single instance of FlutterLoca…
chebizarro May 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
pull_request:
branches:
- main
push:
branches:
- wip

jobs:
build:
Expand Down
120 changes: 120 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Contributing to Mostro Mobile

Welcome! Thank you for your interest in contributing to the Mostro Mobile project. This guide will help you get started, understand the project architecture, and contribute effectively.

---

## Table of Contents
- [How to Contribute](#how-to-contribute)
- [Project Architecture Overview](#project-architecture-overview)
- [Getting Started](#getting-started)
- [Best Practices & Tips](#best-practices--tips)
- [Contact & Further Resources](#contact--further-resources)

---

## How to Contribute

We follow the standard GitHub workflow:

1. **Fork the repository**
2. **Create a new branch** for your feature or bugfix
3. **Write clear, descriptive commit messages**
4. **Push your branch** and open a Pull Request (PR)
5. **Describe your changes** thoroughly in the PR
6. **Participate in code review** and address feedback

For bug reports and feature requests, please [open an issue](https://github.com/MostroP2P/mobile/issues) with:
- Clear title and description
- Steps to reproduce (for bugs)
- Screenshots/logs if relevant

---

## Project Architecture Overview

Mostro Mobile is a Flutter app designed with modularity and maintainability in mind. Here’s a high-level overview of the architecture and key technologies:

### 1. State Management: Riverpod & Notifier Pattern
- **Riverpod** is used for dependency injection and state management.
- Providers are organized by feature, e.g., `features/order/providers/order_notifier_provider.dart`.
- The **Notifier pattern** is used for complex state logic (e.g., order submission, authentication). Notifiers encapsulate business logic and expose state via providers.
- Dedicated state providers are often used to track transient UI states, such as submission progress or error messages.

### 2. Data Persistence: Sembast
- **Sembast** is a NoSQL database used for local data persistence.
- Database initialization is handled in `shared/providers/mostro_database_provider.dart`.
- Data repositories (e.g., `data/repositories/base_storage.dart`) abstract CRUD operations and encode/decode models.
- All local data access should go through repository classes, not direct database calls.

### 3. Connectivity: NostrService
- Connectivity with the Nostr protocol is handled by `services/nostr_service.dart`.
- The `NostrService` manages relay connections, event subscriptions, and message handling.
- All Nostr-related logic should be routed through this service or its providers.

### 4. Routing: GoRouter
- Navigation is managed using **GoRouter**.
- The main router configuration is set up in `core/app.dart` (see the `goRouter` instance).
- Route definitions are centralized for maintainability and deep linking.

### 5. Internationalization (i18n)
- Internationalization is handled using the `intl` package and Flutter’s localization tools.
- Localization files are in `lib/l10n/` and generated code in `lib/generated/`.
- Use `S.of(context).yourKey` for all user-facing strings.

### 6. Other Key Patterns & Utilities
- **Background Services:** Found in `lib/background/` for handling background tasks (e.g., notifications, data sync).
- **Notifications:** Managed via `notifications/` and corresponding providers.
- **Shared Utilities:** Common widgets, helpers, and providers live in `shared/`.
- **Testing:** Tests are in the `test/` and `integration_test/` directories.

---

## Getting Started

1. **Clone the repo:**
```sh
git clone https://github.com/chebizarro/mobile.git
cd mobile
```
2. **Install dependencies:**
```sh
flutter pub get
```
3. **Run the app:**
```sh
flutter run
```
4. **Configure environment:**
- Localization: Run `flutter gen-l10n` if you add new strings.
- Platform-specific setup: See `README.md` for details.

5. **Testing:**
- Unit tests: `flutter test`
- Integration tests: `flutter test integration_test/`

6. **Linting & Formatting:**
- Check code style: `flutter analyze`
- Format code: `flutter format .`

---

## Best Practices & Tips

- **Follow the existing folder and provider structure.**
- **Use Riverpod for all state management.** Avoid mixing with other state solutions.
- **Encapsulate business logic in Notifiers** and expose state via providers.
- **Use repositories for all data access** (Sembast or Nostr).
- **Keep UI code declarative and side-effect free.**
- **For SnackBars, dialogs, or overlays,** always use a post-frame callback to avoid build-phase errors (see `NostrResponsiveButton` pattern).
- **Refer to existing features** (e.g., order submission, chat) for implementation examples.

---

## Contact & Further Resources

- **Main repo:** [https://github.com/MostroP2P/mobile](https://github.com/MostroP2P/mobile)
- **Questions/Help:** Open a GitHub issue or discussion
- **Docs:** See `README.md` and code comments for more details

Happy contributing!
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ flutter run
cargo run
```

See the README.md in the mostro repository for more details.

## Setting up Polar for Testing

1. Launch Polar and create a new Lightning Network.
Expand All @@ -106,18 +108,17 @@ This project is licensed under the MIT License. See the `LICENSE` file for detai
- [x] Displays order list
- [x] Take orders (Buy & Sell)
- [x] Posts Orders (Buy & Sell)
- [ ] Direct message with peers (use nip-17)
- [ ] Fiat sent
- [ ] Release
- [ ] Maker cancel pending order
- [ ] Cooperative cancellation
- [x] Direct message with peers
- [x] Fiat sent
- [x] Release
- [x] Maker cancel pending order
- [x] Cooperative cancellation
- [ ] Buyer: add new invoice if payment fails
- [ ] Rate users
- [ ] List own orders
- [x] Rate users
- [x] List own orders
- [ ] Dispute flow (users)
- [ ] Dispute management (for admins)
- [ ] Conversation key management
- [ ] Create buy orders with LN address
- [ ] Nip-06 support (identity management)
- [ ] Settings tab
- [ ] Notifications
- [x] Create buy orders with LN address
- [x] Settings tab
- [x] Notifications
12 changes: 9 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ android {
ndkVersion = "26.3.11579264" //flutter.ndkVersion

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
coreLibraryDesugaringEnabled true

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = "11"
}

defaultConfig {
Expand All @@ -42,3 +44,7 @@ android {
flutter {
source = "../.."
}

dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4'
}
42 changes: 27 additions & 15 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application
android:label="Mostro P2P"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon"
android:allowBackup="false"
android:fullBackupContent="false">
android:fullBackupContent="false"
android:enableOnBackInvokedCallback="true">

<activity
android:name=".MainActivity"
android:exported="true"
Expand All @@ -14,35 +17,44 @@
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:resource="@style/NormalTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->

<service
android:name="id.flutter.flutter_background_service.BackgroundService"
android:exported="false"
android:foregroundServiceType="dataSync"
android:permission="android.permission.FOREGROUND_SERVICE"
tools:replace="android:exported" />

<receiver
android:exported="false"
android:name="com.dexterous.flutterlocalnotifications.ActionBroadcastReceiver" />
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@drawable/ic_bg_service_small" />

</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<uses-permission android:name="android.permission.INTERNET" />

<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT" />
<data android:mimeType="text/plain" />
</intent>
</queries>
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
43 changes: 43 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
target 'RunnerTests' do
inherit! :search_paths
end
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
10 changes: 8 additions & 2 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Mostro P2P</string>
<string>Mostro P2P</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Mostro P2P</string>
<string>Mostro P2P</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
Expand Down Expand Up @@ -47,5 +47,11 @@
<true />
<key>NSCameraUsageDescription</key>
<string>This app needs camera access to scan QR codes</string>
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
<string>processing</string>
<string>remote-notification</string>
</array>
</dict>
</plist>
13 changes: 13 additions & 0 deletions lib/background/abstract_background_service.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import 'package:dart_nostr/dart_nostr.dart';
import 'package:mostro_mobile/features/settings/settings.dart';

abstract class BackgroundService {
Future<void> init();
void subscribe(List<NostrFilter> filters);
void updateSettings(Settings settings);
Future<void> setForegroundStatus(bool isForeground);
Future<bool> unsubscribe(String subscriptionId);
Future<void> unsubscribeAll();
Future<int> getActiveSubscriptionCount();
bool get isRunning;
}
Loading