Closed OmerFlame closed 2 years ago
There is no direct support for the only Objective-C packages but it is something we are investigating. At the moment we have converted the ones that we needed to Swift. Could you please send us which ones you need?
In order to add Swift Packages, the packages will need to be able to compile in Android so again it depends on their dependencies. You will need to add them as dependencies in the Package.swift
file in build/iOSSources
and then compiler should find them. Could you please send us the github repos of the needed swift packages?
The first one is Haptica (I am not sure what Objective-C dependencies this has or anything of the sort), and the second one I need is Sentry.
Regarding the Package.swift step, does the file get overwritten every time I run 100-UpdateAndRun.sh
? From the very limited testing I did, it seems to do that...
Haptica: It should work without any changes. We are looking at it and will have an update in the next hours.
Sentry: Are you using any special feature of it or just the setup in their Readme
import Sentry
// ....
SentrySDK.start { options in
options.dsn = "___PUBLIC_DSN___"
options.debug = true // Helpful to see what's going on
}
I am definitely just using Sentry as is. And no, Haptica doesn't just work for me, it says that it has issues with the Objective-C runtime or something like that. Long story short, it didn't compile whatsoever. I am very sure that this is reproducible. If you somehow get it to compile in a project then let me know how you did it.
Yeah, we just saw the Haptica problem. Could you please send me the ways that you are using Haptica? Which functions are you using? And I will create an Android version of it today which you will be able to compile.
About Sentry we are working on making the code to use Android SDK when run on Mutata.
Also, about SentrySDK. Could you please send us the code on how you initialize it? Of course, remove your personal details.
The way you sent is exactly how I do it.
I am currently checking about Haptica.
Yeah, we just saw the Haptica problem. Could you please send me the ways that you are using Haptica? Which functions are you using? And I will create an Android version of it today which you will be able to compile.
This is the only time where I use Haptica in my app:
var shouldBeSelected = false {
didSet {
if self.shouldBeSelected {
self.doneAnimationView.removeAnimatableLayer()
}
UIView.animate(withDuration: 0.4, animations: {
self.dimView.alpha = self.shouldBeSelected ? 0.6 : 0
}, completion: { _ in
if self.shouldBeSelected {
self.doneAnimationView.isHidden = false
self.doneAnimationView.show()
Haptic.notification(.success).generate()
} else {
self.doneAnimationView.isHidden = true
}
})
}
}
That Haptic.notification
line is the line.
If this is the only place that you are using Haptica then you can use the official UIKit code which we already support.
Just replace Haptic.notification(.success).generate()
with
let generator = UINotificationFeedbackGenerator()
generator.prepare()
generator.notificationOccurred(.success)
and remove the import of it. It should work in both iOS and Android.
For Sentry we are creating now the code but you can temporary comment it out
For Sentry we are creating now the code but you can temporary comment it out
Essentially what I did already.
If this is the only place that you are using Haptica then you can use the official UIKit code which we already support.
Just replace
Haptic.notification(.success).generate()
withlet generator = UINotificationFeedbackGenerator() generator.prepare() generator.notificationOccurred(.success)
and remove the import of it. It should work in both iOS and Android.
I will try it out now, thank you very much! I will tell you if it worked or not.
Also, do you have support for SPAlert? Or is it just supposed to work out of the box as well?
Also, do you have support for SPAlert? Or is it just supposed to work out of the box as well?
No, it will not work out of the box as it uses some low-level CALayer functions, but it doesn't look impossible to implement it in Android.
As far as I know, I got all SPM issues solved for the time being, but now comes Cocoapods. This is beyond the scope of this issue though, and I will talk about it in another issue.
I am trying to compile my app that uses Swift Package Manager packages from repos around GitHub. It gives me errors like this:
https://app.warp.dev/block/BphzG0hwZshxBzkbGPqizs
The first issue is that the package is not resolved at all. The second issue (which is outside the scope of the log I sent) is packages that interface with the Objective-C runtime as well as packages fully written in Objective-C.
Can you help me compile my project along with my Swift Package Manager dependencies? You have no documentation about this...