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

Fix/revamp sdk #21

Open
wants to merge 19 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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ local.properties
buck-out/
\.buckd/
*.keystore



# Ruby / CocoaPods
/ios/Pods/
/vendor/bundle/
21 changes: 5 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

`$ npm install react-native-verloop-sdk --save`

### Mostly automatic installation

`$ react-native link react-native-verloop-sdk`

### If you are using proguard in android add the following

```
Expand All @@ -18,17 +14,14 @@
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
```

### Manual installation
### Installation


#### iOS
#### iOS - Cocoapods

1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-verloop-sdk` and add `VerloopSdk.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libVerloopSdk.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
4. Run your project (`Cmd+R`)<
1. After adding the dependency `react-native-verloop-sdk` in `package.json` and running `npm install`, go to `ios` subdirectory and run `pod install`. You should find two dependencies getting installed, `RNVerloopSDK` and `VerloopSDKiOS`. You should be good to go.

#### Android
#### Android - Manual

1. Open up `android/app/src/main/java/[...]/MainApplication.java`
- Add `import com.reactlibrary.VerloopSdkPackage;` to the imports at the top of the file
Expand All @@ -43,10 +36,6 @@
compile project(':react-native-verloop-sdk')
```

#### Additional iOS step:

* Add a line in podfile (ios ->Podfile) : ENV['SWIFT_VERSION'] = '4.2'
* Run pod install in the same folder

## Usage
```javascript
Expand All @@ -58,7 +47,7 @@ export default class VerloopLiveChat extends Component {


async componentDidMount() {
const clientId = "hello"; // it is same as https://<YOUR COMPANY ID>.verloop.io
const clientId = "hello"; // it is same as https://<YOUR CLIENT ID>.verloop.io
const userId = "raghav"; // it is the unique userID to identify all the chats for this user

// VerloopSdk.createAnonymousUserConfig(clientId);
Expand Down
14 changes: 14 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Uncomment the next line to define a global platform for your project
platform :ios, '11.0'

target 'RNVerloopSdk' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!

pod 'VerloopSDKiOS', '~> 0.2'
pod 'React'


# Pods for RNVerloopSdk

end
14 changes: 6 additions & 8 deletions ios/RNVerloopSdk.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Pod::Spec.new do |s|
s.name = "RNVerloopSdk"
s.version = "1.0.0"
s.version = "1.0.72-rc14"
s.summary = "RNVerloopSdk"
s.description = <<-DESC
This is a wrapper over the verloop iOS SDk.
Expand All @@ -10,15 +10,13 @@ Pod::Spec.new do |s|
s.homepage = "https://verloop.io"
s.license = "MIT"
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
s.author = { "author" => "raghav@verloop.io" }
s.platform = :ios, "9.0"
s.source = { :git => "https://github.com/verloop/react-native-sdk.git", :tag => "master" }
s.source_files = "RNVerloopSdk/**/*.{h,m}"
s.author = { "author" => "tarun@verloop.io" }
s.platform = :ios, "11.0"
s.source = { :git => "https://github.com/verloop/react-native-sdk.git", :tag => "#{s.version}" }
s.source_files = "RNVerloopSdk/**/*.{h,m,swift}"
s.requires_arc = true
s.vendored_frameworks = "VerloopSDK.framework"


s.dependency "React"
s.dependency "VerloopSDKiOS"
#s.dependency "others"

end
Expand Down
105 changes: 90 additions & 15 deletions ios/RNVerloopSdk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
objects = {

/* Begin PBXBuildFile section */
A077E707258A3C1100194B88 /* RNVerloopSdk.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNVerloopSdk.m */; };
A08AD79C24AB9C18005E51FB /* VerloopSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A08AD79B24AB9C18005E51FB /* VerloopSDK.framework */; };
6BD44E6C285AF6B5007039EA /* RNVerloopSdk.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BD44E6A285AF6B5007039EA /* RNVerloopSdk.m */; };
A0D2791924A2347100CFD63C /* libRNVerloopSdk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 134814201AA4EA6300B7C361 /* libRNVerloopSdk.a */; };
ACBDA2769896D9D19BF1E534 /* Pods_RNVerloopSdk.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D1872F5A4A21B3F9AFB080F6 /* Pods_RNVerloopSdk.framework */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
Expand All @@ -26,9 +26,12 @@

/* Begin PBXFileReference section */
134814201AA4EA6300B7C361 /* libRNVerloopSdk.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNVerloopSdk.a; sourceTree = BUILT_PRODUCTS_DIR; };
A08AD79B24AB9C18005E51FB /* VerloopSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = VerloopSDK.framework; sourceTree = "<group>"; };
B3E7B5881CC2AC0600A0062D /* RNVerloopSdk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNVerloopSdk.h; sourceTree = "<group>"; };
B3E7B5891CC2AC0600A0062D /* RNVerloopSdk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNVerloopSdk.m; sourceTree = "<group>"; };
26CA341B84D021D623D0CF3E /* Pods-RNVerloopSdk.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNVerloopSdk.release.xcconfig"; path = "Target Support Files/Pods-RNVerloopSdk/Pods-RNVerloopSdk.release.xcconfig"; sourceTree = "<group>"; };
6B53D1D1285CAF2700E3DD28 /* React.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = React.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6BD44E6A285AF6B5007039EA /* RNVerloopSdk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RNVerloopSdk.m; path = RNVerloopSdk/RNVerloopSdk.m; sourceTree = "<group>"; };
6BD44E6B285AF6B5007039EA /* RNVerloopSdk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNVerloopSdk.h; path = RNVerloopSdk/RNVerloopSdk.h; sourceTree = "<group>"; };
C9EBD6E07AF7C2061E325803 /* Pods-RNVerloopSdk.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNVerloopSdk.debug.xcconfig"; path = "Target Support Files/Pods-RNVerloopSdk/Pods-RNVerloopSdk.debug.xcconfig"; sourceTree = "<group>"; };
D1872F5A4A21B3F9AFB080F6 /* Pods_RNVerloopSdk.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RNVerloopSdk.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -37,13 +40,22 @@
buildActionMask = 2147483647;
files = (
A0D2791924A2347100CFD63C /* libRNVerloopSdk.a in Frameworks */,
A08AD79C24AB9C18005E51FB /* VerloopSDK.framework in Frameworks */,
ACBDA2769896D9D19BF1E534 /* Pods_RNVerloopSdk.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
0529E365A82A2BD68781D6E4 /* Frameworks */ = {
isa = PBXGroup;
children = (
6B53D1D1285CAF2700E3DD28 /* React.framework */,
D1872F5A4A21B3F9AFB080F6 /* Pods_RNVerloopSdk.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
134814211AA4EA7D00B7C361 /* Products */ = {
isa = PBXGroup;
children = (
Expand All @@ -55,20 +67,31 @@
58B511D21A9E6C8500147676 = {
isa = PBXGroup;
children = (
B3E7B5881CC2AC0600A0062D /* RNVerloopSdk.h */,
B3E7B5891CC2AC0600A0062D /* RNVerloopSdk.m */,
6BD44E6B285AF6B5007039EA /* RNVerloopSdk.h */,
6BD44E6A285AF6B5007039EA /* RNVerloopSdk.m */,
134814211AA4EA7D00B7C361 /* Products */,
A08AD79B24AB9C18005E51FB /* VerloopSDK.framework */,
F2B6ED95147F112CF264C531 /* Pods */,
0529E365A82A2BD68781D6E4 /* Frameworks */,
);
sourceTree = "<group>";
};
F2B6ED95147F112CF264C531 /* Pods */ = {
isa = PBXGroup;
children = (
C9EBD6E07AF7C2061E325803 /* Pods-RNVerloopSdk.debug.xcconfig */,
26CA341B84D021D623D0CF3E /* Pods-RNVerloopSdk.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
58B511DA1A9E6C8500147676 /* RNVerloopSdk */ = {
isa = PBXNativeTarget;
buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNVerloopSdk" */;
buildPhases = (
AC8790EAB9B8FAEAFF900BA8 /* [CP] Check Pods Manifest.lock */,
58B511D71A9E6C8500147676 /* Sources */,
58B511D81A9E6C8500147676 /* Frameworks */,
58B511D91A9E6C8500147676 /* CopyFiles */,
Expand All @@ -88,7 +111,10 @@
58B511D31A9E6C8500147676 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0830;
KnownAssetTags = (
New,
);
LastUpgradeCheck = 1320;
ORGANIZATIONNAME = Facebook;
TargetAttributes = {
58B511DA1A9E6C8500147676 = {
Expand All @@ -98,11 +124,11 @@
};
buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNVerloopSdk" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
mainGroup = 58B511D21A9E6C8500147676;
productRefGroup = 58B511D21A9E6C8500147676;
Expand All @@ -114,12 +140,37 @@
};
/* End PBXProject section */

/* Begin PBXShellScriptBuildPhase section */
AC8790EAB9B8FAEAFF900BA8 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-RNVerloopSdk-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
58B511D71A9E6C8500147676 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A077E707258A3C1100194B88 /* RNVerloopSdk.m in Sources */,
6BD44E6C285AF6B5007039EA /* RNVerloopSdk.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -130,18 +181,28 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand All @@ -163,7 +224,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -174,18 +235,28 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand All @@ -200,7 +271,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
Expand All @@ -209,6 +280,7 @@
};
58B511F01A9E6C8500147676 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = C9EBD6E07AF7C2061E325803 /* Pods-RNVerloopSdk.debug.xcconfig */;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -219,6 +291,7 @@
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../../../React/**",
"$(SRCROOT)/../../react-native/React/**",
"$(SRCROOT)/../node_modules/react-native/React",
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "-ObjC";
Expand All @@ -229,6 +302,7 @@
};
58B511F11A9E6C8500147676 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 26CA341B84D021D623D0CF3E /* Pods-RNVerloopSdk.release.xcconfig */;
buildSettings = {
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -239,6 +313,7 @@
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../../../React/**",
"$(SRCROOT)/../../react-native/React/**",
"$(SRCROOT)/../node_modules/react-native/React",
);
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "-ObjC";
Expand Down
Loading