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

Add Cocoapods RNAudioStreaming.podspec file #54

Merged
merged 3 commits into from
Dec 14, 2016
Merged
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
35 changes: 21 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,26 @@ If you are only looking to play local audio file with app in foreground, please
![Demo iOS](https://raw.githubusercontent.com/tlenclos/react-native-audio-streaming/master/demo_ios.gif)
![Demo android](https://raw.githubusercontent.com/tlenclos/react-native-audio-streaming/master/demo_android.gif)

## Getting started
## First installation step (applied for both iOS & Android)

`$ npm install react-native-audio-streaming --save`

### Mostly automatic installation
### Next installation steps for iOS (choose one of three options below)

#### 1. Cocoapods installation

1. add `pod 'RNAudioStreaming', :path => './node_modules/react-native-audio-streaming'` to `Podfile`
2. run `pod install`

#### 2. Mostly automatic installation

`$ react-native link react-native-audio-streaming`

Go to `node_modules` ➜ `react-native-audio-streaming` => `Pods` and drag/drop `Pods.xcodeproj` to the Libraries folder in your XCode project.

In XCode, in the project navigator, select your project. Add `libReactNativeAudioStreaming.a` and `libStreamingKit.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`

### Manual installation

#### iOS
#### 3. Manual installation

1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-audio-streaming` => `ios`
Expand All @@ -37,7 +42,17 @@ In XCode, in the project navigator, select your project. Add `libReactNativeAudi
3. In XCode, in the project navigator, select your project. Add `libReactNativeAudioStreaming.a` and `libStreamingKit.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
4. Run your project (`Cmd+R`)

#### Android
### Final step for iOS (required after doing any of three options above)

Update Info.plist file of your Xcode project and add audio background mode

```xml
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
```

### Next installation steps for Android

1. Open up `android/app/src/main/java/[...]/MainApplication.java`
- Add `import com.audioStreaming.ReactNativeAudioStreamingPackage;` to the imports at the top of the file
Expand All @@ -56,14 +71,6 @@ In XCode, in the project navigator, select your project. Add `libReactNativeAudi

## Usage

### iOS only : udate the Info.plist file of your project and add background mode

```xml
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
```

### Playing sound (similar code used by the player UI)

```javascript
Expand Down
26 changes: 26 additions & 0 deletions RNAudioStreaming.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
s.name = "RNAudioStreaming"
s.version = package['version']
s.summary = package['description']
s.homepage = "https://github.com/tlenclos/react-native-audio-streaming"
s.license = package['license']
s.author = package['author']
s.source = { :git => package['repository']['url'], :tag => "v#{s.version}" }
s.default_subspec = 'Main'
s.requires_arc = true
s.platform = :ios, "7.0"
s.preserve_paths = "**/*.js"

s.subspec 'Main' do |ss|
ss.source_files = "ios/ReactNativeAudioStreaming.{h,m}"
ss.dependency 'RNAudioStreaming/StreamingKit'
end

s.subspec 'StreamingKit' do |ss|
ss.source_files = "ios/Pods/StreamingKit/StreamingKit/StreamingKit/**/*.{h,m}"
end
end