From b5e7bebfdba2b1ee29302b16e37bc7abbb225712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Pab=C3=B3n?= Date: Tue, 7 Nov 2023 13:54:18 +0800 Subject: [PATCH] [iOS] Fix: library symbols stripped on release For debug, a dummy call to any function in the library was enough; on release, ALL need to be dummy-called. --- .../dart/ios/Classes/SwiftOuisyncPlugin.swift | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/bindings/dart/ios/Classes/SwiftOuisyncPlugin.swift b/bindings/dart/ios/Classes/SwiftOuisyncPlugin.swift index 00b6c50c9..73e48daae 100644 --- a/bindings/dart/ios/Classes/SwiftOuisyncPlugin.swift +++ b/bindings/dart/ios/Classes/SwiftOuisyncPlugin.swift @@ -14,6 +14,39 @@ public class SwiftOuisyncPlugin: NSObject, FlutterPlugin { public func dummyMethodToEnforceBundling() { // This will never be executed - session_close() + + let session: SessionHandle = 0 + let port: Int64 = 0 + let pointer: Int64 = 0 + let function: PostDartCObjectFn? = nil + let payload: UnsafeMutablePointer? = nil + let length: UInt64 = 0 + let handle: UInt64 = 0 + let stringPointer: UnsafeMutablePointer? = nil + let level: UInt8 = 0 + + let resultCreate = session_create_dart("", "", function, port) + print(resultCreate) + + let resultClose = session_close(session) + print(resultClose) + + let resultSend = session_channel_send(session, payload, length) + print(resultSend) + + let resultShutdown = session_shutdown_network_and_close(session) + print(resultShutdown) + + let resultFileCopy = file_copy_to_raw_fd_dart(session, handle, 0, function, port) + print(resultFileCopy) + + let resultFileCopy2 = file_copy_to_raw_fd_dart(session, handle, 0, function, port) + print(resultFileCopy2) + + let resultFreeString = free_string(stringPointer) + print(resultFreeString) + + let resultLogPrint = log_print(level, "", "") + print(resultLogPrint) } }