session-ios/BUILDING.md

73 lines
1.9 KiB
Markdown
Raw Normal View History

2017-03-16 00:11:24 +01:00
# Building
We typically develop against the latest stable version of Xcode.
2018-07-20 15:48:22 +02:00
2021-01-11 23:46:43 +01:00
As of this writing, that's Xcode 12.3
2018-11-19 18:36:28 +01:00
## Prerequistes
2020-06-03 03:20:18 +02:00
Install [Carthage](https://github.com/Carthage/Carthage#installing-carthage).
2018-07-20 15:48:22 +02:00
2017-03-16 00:11:24 +01:00
## 1. Clone
Clone the repo to a working directory:
2017-03-16 00:11:24 +01:00
2018-07-20 15:48:22 +02:00
```
2020-02-05 04:05:41 +01:00
git clone --recurse-submodules https://github.com/loki-project/session-ios
2018-07-20 15:48:22 +02:00
```
Since we make use of submodules, you must use `git clone`, rather than
downloading a prepared zip file from Github.
We recommend you fork the repo on GitHub, then clone your fork:
```
2020-02-05 04:05:41 +01:00
git clone --recurse-submodules https://github.com/<USERNAME>/session-ios.git
```
2020-02-05 04:05:41 +01:00
You can then add the Session repo to sync with upstream changes:
```
2020-02-05 04:05:41 +01:00
git remote add upstream https://github.com/loki-project/session-ios
```
2020-11-30 04:28:01 +01:00
## 2. Pods
2017-03-16 00:11:24 +01:00
2020-02-05 04:05:41 +01:00
To build and configure the libraries Session uses, just run:
2017-03-16 00:11:24 +01:00
```
2020-11-30 04:28:01 +01:00
pod install
2017-03-16 00:11:24 +01:00
```
## 3. Xcode
2021-01-11 23:46:43 +01:00
Open the `Session.xcworkspace` in Xcode.
```
2021-01-11 23:46:43 +01:00
open Session.xcworkspace
```
2020-04-07 05:40:33 +02:00
In the TARGETS area of the General tab, change the Team dropdown to
2021-01-11 23:46:43 +01:00
your own. You will need to do that for all the listed targets, e.g.
2020-12-14 22:20:43 +01:00
Session, SessionShareExtension, and SessionNotificationServiceExtension. You
2020-11-30 04:28:01 +01:00
will need an Apple Developer account for this.
On the Capabilities tab, turn off Push Notifications and Data Protection,
while keeping Background Modes on. The App Groups capability will need to
2020-11-30 04:28:01 +01:00
remain on in order to access the shared data storage.
2017-03-16 00:11:24 +01:00
Build and Run and you are ready to go!
## Known issues
2020-11-30 04:35:47 +01:00
### PureLayout
2020-11-30 04:43:49 +01:00
The PureLayout post install hook doesn't get applied correctly upon running
`pod install` if you're on Xcode 12. See https://github.com/CocoaPods/CocoaPods/issues/10087
2020-11-30 04:35:47 +01:00
for more information.
### Push Notifications
2017-07-21 21:36:19 +02:00
Features related to push notifications are known to be not working for
third-party contributors since Apple's Push Notification service pushes
2020-05-21 00:38:55 +02:00
will only work with the Session production code signing
2017-07-21 21:36:19 +02:00
certificate.