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

Update Readme how to build for iOS #305

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 8 additions & 26 deletions INSTALL_IOS.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,15 @@
## iOS

### Option 1: Cocoapods
### Option 1: Create your static library or download precompiled version

```
pod 'SocketIO-Client-CPP'
```

### Option 2: Create a static library

1. Create a static library
1. Copy the header files into xcode

Use the static libraries generated by the example project [iOS example project](examples/iOS)
Follow the recent tutorial under https://github.com/kim-company/socket.io-client-cpp-ios-static to build from scrattch or download precompiled versions.

Create one for
- release iphoneos
- release simulator
- debug iphoneos
- debug simulator

Join the debug libraries and the release libraries with e.g.
### Option 2: Cocoapods
__Note__: this is the outdated version 1.6.1.
```
libtool -static -o libUniversalRelease.a Release-iphoneos/libsioclient.a Release-iphonesimulator/libsioclient.a
libtool -static -o libUniversalDebug.a Debug-iphoneos/libsioclient.a Debug-iphonesimulator/libsioclient.a
pod 'SocketIO-Client-CPP'
```


### Option 3: Manual integration

Use this [shell](https://gist.github.com/melode11/a90114a2abf009ca22ea) to download and build boost completely automattically. It installs boost to `<shell folder>/prefix`.

See the [iOS example project](examples/iOS) for how to integrate the rest.
### Notes
* See the [iOS example project](examples/iOS) for how to integrate the rest.
* Since commit https://github.com/socketio/socket.io-client-cpp/commit/af68bf3067ab45dc6a53261284e0da9afd21b636 the boost library is not needed anymore.
17 changes: 4 additions & 13 deletions examples/iOS/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#SIOClient iOS chat room demo
# SIOClient iOS chat room demo
## What is this
This is a iOS project run on xcode 6, you can use this single view application chatting in the official [chat room demo](https://github.com/Automattic/socket.io/tree/master/examples/chat).
This is a iOS project run on Xcode, you can use this single view application chatting in the official [chat room demo](https://github.com/Automattic/socket.io/tree/master/examples/chat).

## How to setup
Suppose you're using your Mac's shell, under your workspace folder, run
Expand All @@ -11,21 +11,12 @@ Step in the demo folder
```shell
cd ./socket.io-client-cpp/examples/iOS/SioChatDemo
```
you will see a shell script named `boost.sh` under folder `boost`,Run
```shell
cd ./boost
bash ./boost.sh
```
Please stand by with patient, this step will take about one or two hours depends on your network.
Follow [Build&Download for iOS](https://github.com/socketio/socket.io-client-cpp/blob/master/INSTALL_IOS.md) how to get the compiled version of socket.io-client-cpp for iOS.

When done, open `SioChatDemo.xcodeproj` file in the parent folder with xcode.
Just compile and run the `SioChatDemo` target.
Now, if you have your chat room server run on your local machine, you can chat with device to device or device to web.

## Use sioclient as static lib on iOS
There's a target named `sioclient` in the Demo project, That is the exactly right config for buiding the `sioclient` as a static library on iOS.
With the static library file `libsioclient.a` and two exported headers `sio_client.h` and `sio_message.h`, you won't need to config anything again and again in your integrating projects.

## About the `boost.sh`
The `boost.sh` is copied from [boostmake_ios](https://github.com/alist/boostmake_ios),it is worked on my machine for boost 1.55.0
there're lot's versions of boost build shells, you can choose what you like.

4 changes: 0 additions & 4 deletions examples/iOS/SioChatDemo/boost/.gitignore

This file was deleted.

Loading