-
Notifications
You must be signed in to change notification settings - Fork 31
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
Importing into Objective-C++ / React Native project #16
Comments
#2 (comment) (don't use cocoapods) |
Correct me if I'm wrong, but isn't |
No idea. I just know that in a regular Objective-C project, the above syntax works fine if the package was added with SPM. |
Well, yeah – after extensive research, it would seem that Swift can only be used in Objective-C++ files when importing with Guess we will have to use the old SDK, at least for iOS. Any idea why importing doesn't work? Can it/will it be fixed in the future? Excluding the whole React Native community seems like a big deal. |
I don't use React Native, but it seems this a known problem with RN and something they're debating how to fix: react-native-community/discussions-and-proposals#587 I don't work for TikTok, but I wouldn't expect this library to move away from SPM/Swift. I don't know if this particular problem is a limitation with RN or your ability to convert your AppDelegate to Swift. If it's the latter, I suggest you just get it done and move on. |
Still, I find it quite weird that other imports (for example |
@dorkyboi sorry for the trouble you are experiencing. I am looking into this issue and will get back to you. |
Any update on this ? |
Same, I would love to use this within a React Native iOS app! @stephen-boyle |
Is there any updates on this? I am also looking forward for Tiktok Share Kit for React Native. |
我使用Choose File > Add Package Dependencies成功了! |
@a7510774 you mean you added the dependencies, but were you able to implement share kit in your react app. |
可以的,我已成功导入我的OC项目 |
@a7510774 Can you help me? If there is something that I can reference, can you send it to me. Is your project is shareable for reference? |
我不太清楚RN项目是不是这样操作,我使用的是原生的OC语言,按官方的指引,使用swift包依赖是成功加入了项目中,具体操作如官方的指引: Add the library to your XCode project as a Swift Package:
|
Hi, we are developing a React Native application which should integrate with TikTok. Because it is a React Native app, it is made in Objective-C and not Swift. It is also a quite old application with many changes to the codebase, so refactoring AppDelegate into Swift is not an option.
Disclosure: I know next to nothing when it comes to iOS development, so the more information – the better.
From what I understood, Swift code (when made right, e.g. with
@objc
) can be imported into Objective-C code directly using a-Swift
postfix. However, when I do#import <TikTokOpenSDKCore/TikTokOpenSDKCore-Swift.h>
the compiler says there's no such file. I have tried plenty of different variants in different files and languages, same using""
instead of<>
, also tried including using SPM instead of CocoaPods, but all to no avail.During my research, I have found out that importable headers are located in
/Pods/Headers/Public
. I've inspected TikTokOpenSDKCore folder and the only header present there isTikTokOpenSDKCore-umbrella.h
. But this header appears to be next to useless when it comes to importing actual classes and everything else. All it seems to do is importUIKit.h
and export a couple of variables. Still, I have tried importing it instead of-Swift.h
, of course it didn't work.One thought was that some of other libraries or project settings interfere, so I have tried installing TikTok SDK on a brand new React Native project – nothing has changed. So I doubt it has something to do with my project specifically.
At this point, I have spent an obscene number of hours trying to make this work, and I feel like my head is going to explode. Have to admit, I am desperate for any help, so please forgive me for tagging @stephen-boyle @nickdnk.
My podfile has:
My
AppDelegate.mm
:The text was updated successfully, but these errors were encountered: