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

[Question] How do to integrate it to IOS without introducing cocoapods. #20

Closed
Kabangi opened this issue May 8, 2017 · 17 comments
Closed

Comments

@Kabangi
Copy link
Contributor

Kabangi commented May 8, 2017

Am trying to build my react native app on ios that has this library fully working on android. The problem is I don't have prior experience with IOS and I can't figure out how to integrate this library without having to introduce cocoapods.

I do know though that majority of react native projects do not use cocoapods and am trying to follow that principle. I have followed this docs http://facebook.github.io/react-native/docs/linking-libraries-ios.html but I get stack of <TwilioChatClient/headerFile not found errors even though I have the twilio framework as part of the linked libraries.

I would appreciate pointers on how to proceed on this and eventually I want to send a PR on docs with setup instructions for the ios.

@bradbyte
Copy link
Contributor

bradbyte commented May 8, 2017

That error is that the TwilioChat SKD isn't there.. since you would normally get that with the podfile. Check out this doc on Twilio for how to install the SDK manually without CocoaPods: https://www.twilio.com/docs/api/chat/sdks#ios-sdk. I haven't tested the library without CocoaPod installation, though, and theres a good chance it would take more than a doc update to get it to work... just FYI.

@Kabangi
Copy link
Contributor Author

Kabangi commented May 8, 2017

I have read those docs but somehow am getting this erroR <TwilioChatClient/TCHUserInfo.h> not found am using SDK 0.17.1 and access manager 0.1.3` even though I can see this header file as part of the framework am not sure what's going on. Am just starting on IOS development.

@bradbyte
Copy link
Contributor

bradbyte commented May 8, 2017

Are you adding the product files to your project? Most likely the header search paths for the React Native Twilio Chat piece are only looking for the Pod installation.

@bradbyte
Copy link
Contributor

bradbyte commented May 8, 2017

@Kabangi
Copy link
Contributor Author

Kabangi commented May 8, 2017

Let me try that. Pulled my hair since yesterday on this. Thanks

@bradbyte
Copy link
Contributor

bradbyte commented May 8, 2017

Sorry! it's hard to wrap your mind around everything when just starting out... basically you have to get the dependancies linked to your project somehow (automatically with CocoaPods... similar to npm) or manually installing and linking through your node_modules. Then, you have to tell the projects how they should "search" for the header files. Right now it's all configured to look at the directory where the Pods get installed. But since you don't reference the Twilio SDKs directly in your projects, it's the RN Twilio Chat project that would need to be updated to link to the right headers.

@Kabangi
Copy link
Contributor Author

Kabangi commented May 8, 2017

Thanks for this.

After trying the solution you suggested am now receiving errors related to the library itself like no such file or directory: 'react-native-twilio-chat/ios/RCTTwilioIPMessaging/RCTTwilioChatChannels.m' clang: error: no input files

Seems like there are RCTTwilioIPMessaging traces of RCTTwilioIPMessaging in the current version

@Kabangi
Copy link
Contributor Author

Kabangi commented May 8, 2017

Finally got it to build and archive . I had to change RCTTwilioIPMessaging to RCTTwilioChat and also there are some .h and .m files that have wrong references under project.pbxproj. eg RCTTwilioIChatMembers instead of RCTTwilioChatMembers

@bradbyte
Copy link
Contributor

bradbyte commented May 8, 2017

Did you previously install the older react-native-twilio-ip-messaging project? If so, checkout the migration guide. https://github.com/ccm-innovation/react-native-twilio-chat/blob/master/MIGRATION.md.

@Kabangi
Copy link
Contributor Author

Kabangi commented May 8, 2017

I had removed it completely. Seems like the library itself still has those traces. https://github.com/ccm-innovation/react-native-twilio-chat/blob/master/ios/RCTTwilioChat.xcodeproj/project.pbxproj

Open the link above and search for RCTTwilioIPMessaging

@bradbyte
Copy link
Contributor

bradbyte commented May 8, 2017

Interesting.. let me look into that.

@Kabangi
Copy link
Contributor Author

Kabangi commented May 8, 2017

Also do check the typos on RCTTwilioIChatMembers.h instead of RCTTwilioChatMembers

@bradbyte bradbyte mentioned this issue May 8, 2017
bradbyte pushed a commit that referenced this issue May 8, 2017
These still require you to use CocoaPods, ideally these would be fully manual without needing CP by installing the SDK directly from twilio. See #2 and #20.
bradbyte pushed a commit that referenced this issue May 8, 2017
* use include quotes instead of angled ones

* set the platform in the Podfile example and format it

* add link to the full Podfile example in the readme

* Add logLevel constants and empty setLogLevelMethod

* update the client documentation specifying setLogLevel is iOS only

* Fix spacing

* make compatible with react-native 0.40.0

* Update package.json

Updated version to 0.3.0

* removed iOS only note for setLogLevel

* removed Android note from setLogLevel

* removed old ip-messaging files

* updated access manager docs

* update to channel docs

* updated client docs
also fixed android not sending an object for userInfoChanged event

* corrected readme's use of IP Messaging

* removed references to ip-messaging

* Removing manual instructions for now
These still require you to use CocoaPods, ideally these would be fully manual without needing CP by installing the SDK directly from twilio. See #2 and #20.
@benoist
Copy link
Contributor

benoist commented May 9, 2017

There are still some issues with the 0.3.0 version, I managed to get it compiled by making a few adjustments. Will test if the code actually works and then submit a pull request with my changes.

@bradbyte
Copy link
Contributor

bradbyte commented May 9, 2017

Thank you!! I tried to test everything first but I appreciate anything you could provide for help.

@Kabangi
Copy link
Contributor Author

Kabangi commented May 9, 2017

@benoist Is right had to change some code too for it to work. I could submit a PR but I also upgraded to latest version of react native. Which requires change of headers imports to something like <React/RCTBridge.h

@benoist
Copy link
Contributor

benoist commented May 9, 2017

@Kabangi I did the same change to the header imports :-)

@bradbyte
Copy link
Contributor

This should be fixed now with #22 released in 0.3.1. Please open a new issue if you encounter new issues.

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

3 participants