Skip to content

Commit e1c5753

Browse files
committed
react native sdk
1 parent e01f24c commit e1c5753

File tree

6 files changed

+23
-3
lines changed

6 files changed

+23
-3
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ repositories {
3636

3737
dependencies {
3838
implementation 'com.facebook.react:react-native:0.20.1'
39-
implementation 'com.github.verloop:android-sdk:1.0.6'
39+
implementation 'com.github.verloop:android-sdk:v1.0.8-rc04'
4040
}

android/src/main/java/com/reactlibrary/VerloopSdkPackage/RNVerloopSdkModule.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
import io.verloop.sdk.LiveChatUrlClickListener;
1919
import io.verloop.sdk.VerloopConfig;
2020

21+
import android.util.Log;
22+
23+
2124
public class RNVerloopSdkModule extends ReactContextBaseJavaModule implements LifecycleEventListener {
2225

2326
private final ReactApplicationContext reactContext;
@@ -83,11 +86,23 @@ public void createAnonymousUserConfig(String clientId) {
8386

8487
@ReactMethod
8588
public void setFcmToken(String token) {
89+
Log.d("Passing FCM Token Config Check",token);
8690
if (verloopConfig != null) {
91+
Log.d("Passing FCM Token", token);
8792
verloopConfig.setFcmToken(token);
8893
}
8994
}
9095

96+
97+
@ReactMethod
98+
public void getFcmToken(String token) {
99+
Log.d("Getting FCM Token Config Check",token);
100+
if (verloopConfig != null) {
101+
Log.d("Passing FCM Token", token);
102+
verloopConfig.getFcmToken(token);
103+
}
104+
}
105+
91106
@ReactMethod
92107
public void setStaging(Boolean isStaging) {
93108
if (verloopConfig != null) {
@@ -132,11 +147,13 @@ public void setUserPhone(String userPhone) {
132147

133148
@ReactMethod
134149
public void showChat() {
150+
Log.d("Show Chat", verloopConfig);
135151
if (verloopConfig != null) {
136152
if(verloop == null){
137153
final Activity activity = getCurrentActivity();
138154
verloop = new Verloop(activity, verloopConfig);
139155
}
156+
140157
verloop.showChat();
141158
}
142159
}

sample/SampleProject/VerloopLivechat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default class VerloopLiveChat extends Component {
7272
const notification: Notification = notificationOpen.notification;
7373
}
7474

75-
await VerloopSdk.createAnonymousUserConfig('hello.dev');
75+
await VerloopSdk.createAnonymousUserConfig('hello.stage');
7676

7777

7878
// const eventEmitter = new NativeEventEmitter(VerloopSdk);

sample/SampleProject/android/app/src/main/java/com/sampleproject/MainApplication.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.facebook.react.PackageList;
66
import com.facebook.react.ReactApplication;
77
import io.invertase.firebase.RNFirebasePackage;
8+
import io.invertase.firebase.RNFirebasePackage;
89
import com.reactlibrary.VerloopSdkPackage.RNVerloopSdkPackage;
910
import com.reactlibrary.VerloopSdkPackage.RNVerloopSdkPackage;
1011
import com.facebook.react.ReactInstanceManager;
@@ -39,6 +40,7 @@ protected List<ReactPackage> getPackages() {
3940
// protected List<ReactPackage> getPackages() {
4041
// return Arrays.<ReactPackage>asList(
4142
// new MainReactPackage(),
43+
// new RNFirebasePackage(),
4244
// new RNFirebasePackage(),
4345
// new RNFirebaseMessagingPackage(),
4446
// new RNFirebaseNotificationsPackage()

sample/SampleProject/android/settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
rootProject.name = 'SampleProject'
22
include ':react-native-firebase'
33
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
4+
include ':react-native-firebase'
5+
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
46
include ':react-native-verloop-sdk'
57
project(':react-native-verloop-sdk').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-verloop-sdk/android')
68
include ':react-native-firebase'

sample/SampleProject/ios/Podfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ target 'SampleProject' do
7878
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
7979

8080

81-
pod 'RNFirebase', :path => '../node_modules/react-native-firebase'
8281

8382
target 'SampleProjectTests' do
8483
inherit! :complete

0 commit comments

Comments
 (0)