forked from veeklabs/react-native-blip-chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 961d297
Showing
25 changed files
with
6,055 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.pbxproj -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
|
||
# OSX | ||
# | ||
.DS_Store | ||
|
||
# node.js | ||
# | ||
node_modules/ | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
|
||
# Xcode | ||
# | ||
build/ | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata | ||
*.xccheckout | ||
*.moved-aside | ||
DerivedData | ||
*.hmap | ||
*.ipa | ||
*.xcuserstate | ||
project.xcworkspace | ||
|
||
|
||
# Android/IntelliJ | ||
# | ||
build/ | ||
.idea | ||
.gradle | ||
local.properties | ||
*.iml | ||
|
||
# BUCK | ||
buck-out/ | ||
\.buckd/ | ||
*.keystore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
# react-native-blip-chat | ||
|
||
## Getting started | ||
|
||
`$ npm install react-native-blip-chat --save` | ||
|
||
### Mostly automatic installation | ||
|
||
`$ react-native link react-native-blip-chat` | ||
|
||
### Manual installation | ||
|
||
|
||
#### iOS | ||
|
||
1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]` | ||
2. Go to `node_modules` ➜ `react-native-blip-chat` and add `RNReactNativeBlipChat.xcodeproj` | ||
3. In XCode, in the project navigator, select your project. Add `libRNReactNativeBlipChat.a` to your project's `Build Phases` ➜ `Link Binary With Libraries` | ||
4. Run your project (`Cmd+R`)< | ||
|
||
#### Android | ||
|
||
1. Open up `android/app/src/main/java/[...]/MainActivity.java` | ||
- Add `import com.reactlibrary.RNReactNativeBlipChatPackage;` to the imports at the top of the file | ||
- Add `new RNReactNativeBlipChatPackage()` to the list returned by the `getPackages()` method | ||
2. Append the following lines to `android/settings.gradle`: | ||
``` | ||
include ':react-native-blip-chat' | ||
project(':react-native-blip-chat').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-blip-chat/android') | ||
``` | ||
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: | ||
``` | ||
compile project(':react-native-blip-chat') | ||
``` | ||
|
||
#### Windows | ||
[Read it! :D](https://github.com/ReactWindows/react-native) | ||
|
||
1. In Visual Studio add the `RNReactNativeBlipChat.sln` in `node_modules/react-native-blip-chat/windows/RNReactNativeBlipChat.sln` folder to their solution, reference from their app. | ||
2. Open up your `MainPage.cs` app | ||
- Add `using React.Native.Blip.Chat.RNReactNativeBlipChat;` to the usings at the top of the file | ||
- Add `new RNReactNativeBlipChatPackage()` to the `List<IReactPackage>` returned by the `Packages` method | ||
|
||
|
||
## Usage | ||
```javascript | ||
import RNReactNativeBlipChat from 'react-native-blip-chat'; | ||
|
||
// TODO: What to do with the module? | ||
RNReactNativeBlipChat; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require 'json' | ||
|
||
package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) | ||
|
||
Pod::Spec.new do |s| | ||
s.name = "RNBlipChat" | ||
s.version = package['version'] | ||
s.summary = package['description'] | ||
s.license = package['license'] | ||
|
||
s.authors = package['author'] | ||
s.homepage = package['repository']['url'] | ||
s.platform = :ios, "9.0" | ||
s.ios.deployment_target = '9.0' | ||
|
||
s.source = { :git => "https://github.com/veeklabs/react-native-blip-chat.git", :tag => "master" } | ||
s.source_files = "ios/**/*.{h,m}" | ||
s.requires_arc = true | ||
|
||
|
||
s.dependency "React" | ||
s.dependency "BlipChat" | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
|
||
dependencies { | ||
classpath 'com.android.tools.build:gradle:1.3.1' | ||
} | ||
} | ||
|
||
apply plugin: 'com.android.library' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion "23.0.1" | ||
|
||
defaultConfig { | ||
minSdkVersion 16 | ||
targetSdkVersion 22 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
lintOptions { | ||
abortOnError false | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
compile 'com.facebook.react:react-native:+' | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.reactlibrary"> | ||
|
||
</manifest> | ||
|
22 changes: 22 additions & 0 deletions
22
android/src/main/java/com/reactlibrary/RNReactNativeBlipChatModule.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
package com.reactlibrary; | ||
|
||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule; | ||
import com.facebook.react.bridge.ReactMethod; | ||
import com.facebook.react.bridge.Callback; | ||
|
||
public class RNReactNativeBlipChatModule extends ReactContextBaseJavaModule { | ||
|
||
private final ReactApplicationContext reactContext; | ||
|
||
public RNReactNativeBlipChatModule(ReactApplicationContext reactContext) { | ||
super(reactContext); | ||
this.reactContext = reactContext; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "RNReactNativeBlipChat"; | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
android/src/main/java/com/reactlibrary/RNReactNativeBlipChatPackage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
package com.reactlibrary; | ||
|
||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
import com.facebook.react.ReactPackage; | ||
import com.facebook.react.bridge.NativeModule; | ||
import com.facebook.react.bridge.ReactApplicationContext; | ||
import com.facebook.react.uimanager.ViewManager; | ||
import com.facebook.react.bridge.JavaScriptModule; | ||
public class RNReactNativeBlipChatPackage implements ReactPackage { | ||
@Override | ||
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) { | ||
return Arrays.<NativeModule>asList(new RNReactNativeBlipChatModule(reactContext)); | ||
} | ||
|
||
// Deprecated from RN 0.47 | ||
public List<Class<? extends JavaScriptModule>> createJSModules() { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) { | ||
return Collections.emptyList(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
import { NativeModules } from 'react-native'; | ||
|
||
const { RNBlipChat } = NativeModules; | ||
|
||
export default { | ||
openThread: () => { | ||
RNBlipChat.addEvent('Test'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
#if __has_include("RCTBridgeModule.h") | ||
#import "RCTBridgeModule.h" | ||
#else | ||
#import <React/RCTBridgeModule.h> | ||
#endif | ||
|
||
@interface RNReactNativeBlipChat : NSObject <RCTBridgeModule> | ||
|
||
@end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
#import "RNReactNativeBlipChat.h" | ||
#import "BlipChat/BlipChat.h" | ||
|
||
|
||
@implementation RNReactNativeBlipChat | ||
|
||
- (dispatch_queue_t)methodQueue | ||
{ | ||
return dispatch_get_main_queue(); | ||
} | ||
RCT_EXPORT_MODULE(); | ||
|
||
RCT_EXPORT_METHOD(addEvent:(NSString *)name) | ||
{ | ||
[BlipClient openBlipThreadWithMyView:self appKey:(NSString*) @"bm92YXZlZWs6NGEwMDY4NzktMWZjYS00ZjBkLThmNDEtYmJiMTg3MmE4NmMy" options:options error: nil]; | ||
} | ||
|
||
@end |
Oops, something went wrong.