diff --git a/README.md b/README.md index 68d92554..be516c7c 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,17 @@ You will probably want to disable Analytics on the Flutter Tool: `flutter config - Follow the steps above to fetch `libCwtch-go` and `tor` (these will fetch Android versions of these binaries also) - run `flutter run` with an Android phone connect via USB (or some other valid debug mode) +### Building Experimental iOS + +We currently do not auto build iOS libCwtch-go libraries so you'll need to make your own: + +- `git clone https://git.openprivacy.ca/cwtch.im/libcwtch-go.git` +- `cd libcwtch-go` +- `make ios` +- `cp ios/cwtch.a ../ios` + +then you should be able to build with flutter in the project root + ### Known Platform Issues - **Windows**: Flutter engine has a [known bug](https://github.com/flutter/flutter/issues/75675) around the Right Shift key being sticky. diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 00000000..b29247c8 --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.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! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock new file mode 100644 index 00000000..85559ed8 --- /dev/null +++ b/ios/Podfile.lock @@ -0,0 +1,34 @@ +PODS: + - Flutter (1.0.0) + - integration_test (0.0.1): + - Flutter + - package_info_plus (0.4.5): + - Flutter + - path_provider (0.0.1): + - Flutter + +DEPENDENCIES: + - Flutter (from `Flutter`) + - integration_test (from `.symlinks/plugins/integration_test/ios`) + - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) + - path_provider (from `.symlinks/plugins/path_provider/ios`) + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + integration_test: + :path: ".symlinks/plugins/integration_test/ios" + package_info_plus: + :path: ".symlinks/plugins/package_info_plus/ios" + path_provider: + :path: ".symlinks/plugins/path_provider/ios" + +SPEC CHECKSUMS: + Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c + integration_test: 5ed24a436eb7ec17b6a13046e9bf7ca4a404e59e + package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e + path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c + +PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c + +COCOAPODS: 1.10.1 \ No newline at end of file diff --git a/lib/cwtch/ffi.dart b/lib/cwtch/ffi.dart index fdd3e801..f5758b3b 100644 --- a/lib/cwtch/ffi.dart +++ b/lib/cwtch/ffi.dart @@ -76,7 +76,6 @@ class CwtchFfi implements Cwtch { } else if (Platform.isLinux) { library = DynamicLibrary.open("libCwtch.so"); } else if (Platform.isIOS) { - print(Platform.environment); library = DynamicLibrary.open("cwtch.a"); } else { print("OS ${Platform.operatingSystem} not supported by cwtch/ffi");