RestComm / restcomm-ios-sdk

iOS Mobile SDK to easily integrate communication features (WebRTC, messaging, presence, voice, video, screensharing) based on RestComm into native Mobile Applications
http://www.restcomm.com/
GNU Affero General Public License v3.0
38 stars 43 forks source link

POD Issues with Swift use_frameworks! keyword #512

Closed ForGuru closed 7 years ago

ForGuru commented 7 years ago

I have tried to integrate POD in a project where I am using

use_frameworks! keyword in pod file

it doesn't find some header files. We know that this is the known issue with PODS for a project with mixed languages (Swift and Objective C).

https://github.com/CocoaPods/CocoaPods/issues/4605

Have you been able to find a workaround for this situation ??

TheEngineerz commented 7 years ago

@atsakiridis Facing the same issue

atsakiridis commented 7 years ago

Managed to reproduce this too :(. I'm afraid the way to properly fix that is to address the issue in CocoaPods, so that headers are picked up correctly. So I would suggest that you post in CocoaPods issue to try to push them to fix it.

A possible workaround could be to make the header files of Sofia SIP flat, and update the code in the Restcomm SDK to reference them correctly. The problem with that is that, is that it's difficult to automate, since when building Sofia using autotools the dirs are expected to be non flat. Will try to work on that when I find some free cycles.

Until either fix is ready you could use one of the workarounds found at CocoaPods/CocoaPods#4605 so that you can build successfully and not be blocked.

ForGuru commented 7 years ago

@atsakiridis thanks

How can I integrate previous version of sdk which was without pods in swift project, can guide me through it ??

atsakiridis commented 7 years ago

You could try following the previous Quick Start Guide, that is before cocoapods were introduced, which references the respective SDK release. But keep in mind that it is obsolete.

atsakiridis commented 7 years ago

Forgot to add a link to the prev guide, sorry: https://github.com/RestComm/Restcomm-Connect/blob/213e7450b8aa2f96982ca70737c51784a260a60f/restcomm/restcomm.docs/sources-asciidoc/src/main/asciidoc/sdks/restcomm-client-ios-sdk-quick-start.adoc

ForGuru commented 7 years ago

@atsakiridis and @TheEngineerz
I did a trick

1- Created a Swift project and added the POD of Rest-comm 2- removed the use_frameworks! keyword 3- Built and it was success full

4- performed same action on my old project with use_frameworks! keyword 5- and there was an error as expected 6- I copied "${PODS_ROOT}/Headers/" from new project and manually placed in my old project "${PODS_ROOT}/Headers/" 7- Compiled and it did now testing other things 8- Can we develop a script so it can copy all required files as I did manually ??

atsakiridis commented 7 years ago

Yeah, this seems like on of the things the submitter of CocoaPods/CocoaPods#4605 did as a workaround. But I think it's going to be messy, having to build first without the offending cocoapod option and then building anew, but having kept the previous build somewhere so that we can copy the headers over... Its going to become unmanageable in no time :(

Any chance there are other workarounds in that issue that we could use?

TheEngineerz commented 7 years ago

But @atsakiridis I think there is some other issues with Restcomm pods itself.

I simply created a new project Init the Podfile like below

target 'TestRestComm' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  pod "restcomm-ios-sdk"
  # Pods for TestRestComm

end

Every thing go successfully but i am not able to

import RestCommClient

in my ViewController.swift. It gives me error that no such module exist

Using Xcode 8.1 and Swift 3.0. Please advice

screen shot 2016-11-24 at 7 40 15 pm screen shot 2016-11-24 at 7 40 33 pm

TheEngineerz commented 7 years ago

@atsakiridis @ForGuru I resolved my issue by creating Bridge header file and add this line

#import <restcomm-ios-sdk/RestCommClient.h>

Now everything is working fine.

atsakiridis commented 7 years ago

Sounds great @TheEngineerz. So you 're able to integrate the Restcomm iOS SDK from Swift without using use_frameworks! in your Podfile?

ForGuru commented 7 years ago

@atsakiridis @TheEngineerz i am abele to integrate in swift and have made few test calls

Currently its not refreshing registrations following is the log error.

Nov 27 13:17:03 MyTest[4631] <Error>: (sofsip_cli.mm:633) sofsip_handle_input_cb(), marking for restart, stackIsShuttingDown: 0

ForGuru commented 7 years ago

@atsakiridis @TheEngineerz Sorry that was not it was due to running the event loop again.

But ree-registration has some issues.

atsakiridis commented 7 years ago

@ForGuru let's keep the registration issue separate and discuss in the context of #513

atsakiridis commented 7 years ago

Closing this as the issue isn't SDK related. The gist of this issue is the following for future reference: