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

Kotlin multiplatform support [Feedback]: #2038

Open
1 task done
salimisler28 opened this issue Mar 29, 2024 · 3 comments
Open
1 task done

Kotlin multiplatform support [Feedback]: #2038

salimisler28 opened this issue Mar 29, 2024 · 3 comments

Comments

@salimisler28
Copy link

salimisler28 commented Mar 29, 2024

What's on your mind?

It would be great to have a SDK for KMP (at least android and iOS targets).. Thank you

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jkasten2
Copy link
Member

Thanks for submitting this feature request, is there a specific benefit you are looking for?

I haven't used Kotlin Multiplatform myself but from what read about it you should be able to use this OneSignal-Android-SDK directly, then for iOS you can use the OneSignal-iOS-SDK and import that as well by following Kotlin's iOS import guide:
https://kotlinlang.org/docs/multiplatform-ios-dependencies.html

Having to import two libraries in different ways (OneSignal-iOS-SDK & OneSignal-Android-SDK) and use the correct one based on build time or runtime means you will probably want to encapsulate this logic into your own wrapper class. Is this basically what you are looking for to be provided by OneSignal?

@salimisler28
Copy link
Author

Thanks for submitting this feature request, is there a specific benefit you are looking for?

I haven't used Kotlin Multiplatform myself but from what read about it you should be able to use this OneSignal-Android-SDK directly, then for iOS you can use the OneSignal-iOS-SDK and import that as well by following Kotlin's iOS import guide:
https://kotlinlang.org/docs/multiplatform-ios-dependencies.html

Having to import two libraries in different ways (OneSignal-iOS-SDK & OneSignal-Android-SDK) and use the correct one based on build time or runtime means you will probably want to encapsulate this logic into your own wrapper class. Is this basically what you are looking for to be provided by OneSignal?

Hello, thanks for your quick response. Maybe my message was not clear, I would like to use some features like adding tags and the others in common part. Otherwise we have to write it separately for Android and iOS.

@jkasten2
Copy link
Member

To set expectations, we don't plan to adding support in the short term, so I think writing your own little wrapper class around OneSignal will be your best bet for now.

As some research in understanding how KMP should work for libraries / SDKs I found a few that already support it:

If anyone has any other guides or documentation how to enable KMP for libraries / SDKs please feel free to share.

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

No branches or pull requests

2 participants