Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you export a framework that has .modulemap file? #1

Open
JeroldLiu777 opened this issue May 30, 2023 · 10 comments
Open

Could you export a framework that has .modulemap file? #1

JeroldLiu777 opened this issue May 30, 2023 · 10 comments

Comments

@JeroldLiu777
Copy link

At present, it not contain a .modulemap file which cause a integrate issue from my side. Thanks

@alanslattery
Copy link
Contributor

Can you provide some more details on the kind of project you are trying to integrate the SDK with? (i.e. is it swift-based, objective-c etc.) Can you also provide some more information on the error you are getting?

@JeroldLiu777
Copy link
Author

yes, I am using a swift project, I cannot find the head file. I try to import your module, but it doesn't work without modulemap

@alanslattery
Copy link
Contributor

I tried following the instructions here: https://welcm.uk/blog/connecting-an-objective-c-framework-to-your-swift-app
This allowed me to import the framework into a Swift App by just adding a bridging header to the app's project.
In the bridging header, I just added:
#import <BPHeadset.h>

Then, I set the filename of the bridging header as the "Objective-C Bridging Header" in the "Swift Compiler - General" settings.
After that I was able to access all the BPHeadset methods, and I could declare my ViewController like this:

class ViewController: UIViewController, BPHeadsetListener {
  private var headset: BPHeadset?

  override func viewDidLoad() {
    headset = BPHeadset.sharedInstance()
    headset?.add(self)
    super.viewDidLoad()
  }

After that, I could run the app and receive events from the BPHeadset class.
Is this a possible workaround for you, or is something preventing this approach?

@JeroldLiu777
Copy link
Author

I tried following the instructions here: https://welcm.uk/blog/connecting-an-objective-c-framework-to-your-swift-app This allowed me to import the framework into a Swift App by just adding a bridging header to the app's project. In the bridging header, I just added: #import <BPHeadset.h>

Then, I set the filename of the bridging header as the "Objective-C Bridging Header" in the "Swift Compiler - General" settings. After that I was able to access all the BPHeadset methods, and I could declare my ViewController like this:

class ViewController: UIViewController, BPHeadsetListener {
  private var headset: BPHeadset?

  override func viewDidLoad() {
    headset = BPHeadset.sharedInstance()
    headset?.add(self)
    super.viewDidLoad()
  }

After that, I could run the app and receive events from the BPHeadset class. Is this a possible workaround for you, or is something preventing this approach?

Many thanks, yes, indeed, it works with a bridge header file, but in my project, it is not recommended. We use the .modulemap instead. Code reviews may fail. So I seek your help.

@JeroldLiu777
Copy link
Author

We can't directly add a modulemap file to your SDK, we need your help. This feature is very important to us, please.

@gna-sw
Copy link
Owner

gna-sw commented Jun 14, 2023

Hello Lu, I am going to email you directly.

@JeroldLiu777
Copy link
Author

Thanks!

@gna-sw
Copy link
Owner

gna-sw commented Jun 21, 2023

Thanks!

Hello @lucifer717 did you get the email? Did you have a better email for us to contact you with?

@JeroldLiu777
Copy link
Author

Yes, I got your email from [email protected]. I have answered your email, please check it.

@JeroldLiu777
Copy link
Author

Thanks!

Hello @lucifer717 did you get the email? Did you have a better email for us to contact you with?

And what do you mean by a 'better' email? Official email from my organization?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants