From 973d5fcb5917fca1ec51db6488d3daa1780e3cd7 Mon Sep 17 00:00:00 2001 From: DevHossamHassan Date: Thu, 6 Jul 2017 20:08:53 +0200 Subject: [PATCH] Fix Sample app --- InstabugSample/android/app/build.gradle | 2 +- .../com/instabugsample/MainApplication.java | 6 ++-- InstabugSample/android/settings.gradle | 4 +-- InstabugSample/index.android.js | 10 +++--- .../InstabugSample.xcodeproj/project.pbxproj | 34 ++++++++++++++++--- .../RNInstabugReactnativeModule.java | 6 +++- 6 files changed, 45 insertions(+), 17 deletions(-) diff --git a/InstabugSample/android/app/build.gradle b/InstabugSample/android/app/build.gradle index ada23d9..1bbfdbf 100644 --- a/InstabugSample/android/app/build.gradle +++ b/InstabugSample/android/app/build.gradle @@ -129,8 +129,8 @@ android { } dependencies { - compile project(':react-native-dialogs') compile project(':instabug-reactnative') + compile project(':react-native-dialogs') compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.0.1" compile "com.facebook.react:react-native:+" // From node_modules diff --git a/InstabugSample/android/app/src/main/java/com/instabugsample/MainApplication.java b/InstabugSample/android/app/src/main/java/com/instabugsample/MainApplication.java index 46bb7e6..d1c8015 100644 --- a/InstabugSample/android/app/src/main/java/com/instabugsample/MainApplication.java +++ b/InstabugSample/android/app/src/main/java/com/instabugsample/MainApplication.java @@ -4,8 +4,8 @@ import android.app.Application; import android.util.Log; import com.facebook.react.ReactApplication; -import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage; import com.instabug.reactlibrary.RNInstabugReactnativePackage; +import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage; import com.facebook.react.ReactInstanceManager; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; @@ -27,8 +27,8 @@ public class MainApplication extends Application implements ReactApplication { protected List getPackages() { return Arrays.asList( new MainReactPackage(), - new ReactNativeDialogsPackage(), - new RNInstabugReactnativePackage("YOUR_ANDROID_APPLICATION_TOKEN",MainApplication.this) + new RNInstabugReactnativePackage("YOUR_ANDROID_APPLICATION_TOKEN",MainApplication.this,"shake","#1D82DC"), + new ReactNativeDialogsPackage() ); } }; diff --git a/InstabugSample/android/settings.gradle b/InstabugSample/android/settings.gradle index a8770c7..df6c5f6 100644 --- a/InstabugSample/android/settings.gradle +++ b/InstabugSample/android/settings.gradle @@ -1,7 +1,7 @@ rootProject.name = 'InstabugSample' -include ':react-native-dialogs' -project(':react-native-dialogs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-dialogs/android') include ':instabug-reactnative' project(':instabug-reactnative').projectDir = new File(rootProject.projectDir, '../node_modules/instabug-reactnative/android') +include ':react-native-dialogs' +project(':react-native-dialogs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-dialogs/android') include ':app' diff --git a/InstabugSample/index.android.js b/InstabugSample/index.android.js index e940985..23c8523 100644 --- a/InstabugSample/index.android.js +++ b/InstabugSample/index.android.js @@ -25,11 +25,11 @@ export default class InstabugSample extends Component { constructor(props) { super(props); - Instabug.startWithToken('0f0dc916bd9175e3b5d2fdf0cfa49a69', - Instabug.invocationEvent.floatingButton); - Instabug.setPreInvocationHandler(() => { - Alert.alert("PreInvocationEvent", "Done :) "); - }); + + Instabug.setColorTheme(Instabug.colorTheme.light); + Instabug.setPrimaryColor(processColor('#aaff00')); + Instabug.setEmailFieldRequired(false); + const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); this.state = { dataSource: ds.cloneWithRows(this._genRows({})), diff --git a/InstabugSample/ios/InstabugSample.xcodeproj/project.pbxproj b/InstabugSample/ios/InstabugSample.xcodeproj/project.pbxproj index 0514a81..1686b4c 100644 --- a/InstabugSample/ios/InstabugSample.xcodeproj/project.pbxproj +++ b/InstabugSample/ios/InstabugSample.xcodeproj/project.pbxproj @@ -36,7 +36,7 @@ 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; FB6237B8BC81FC0C990E8BE6 /* libPods-InstabugSample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E9562565B465A2839B076D83 /* libPods-InstabugSample.a */; }; - DCC755EDCD9B460F84658AAD /* libRNInstabug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FED4204D49074081B94F4448 /* libRNInstabug.a */; }; + 62F9158A7B074929B2D8A561 /* libRNInstabug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6C533A1EEE6342FA8421CF36 /* libRNInstabug.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -259,8 +259,8 @@ 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 8601D784DB38337F6E545397 /* Pods-InstabugSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-InstabugSample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-InstabugSample/Pods-InstabugSample.debug.xcconfig"; sourceTree = ""; }; E9562565B465A2839B076D83 /* libPods-InstabugSample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-InstabugSample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - A0FE88E32F084FD8A95E38DF /* RNInstabug.xcodeproj */ = {isa = PBXFileReference; name = "RNInstabug.xcodeproj"; path = "../node_modules/instabug-reactnative/ios/RNInstabug.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; - FED4204D49074081B94F4448 /* libRNInstabug.a */ = {isa = PBXFileReference; name = "libRNInstabug.a"; path = "libRNInstabug.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; + 1B17852ABF654B8D8B056F8E /* RNInstabug.xcodeproj */ = {isa = PBXFileReference; name = "RNInstabug.xcodeproj"; path = "../node_modules/instabug-reactnative/ios/RNInstabug.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + 6C533A1EEE6342FA8421CF36 /* libRNInstabug.a */ = {isa = PBXFileReference; name = "libRNInstabug.a"; path = "libRNInstabug.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -288,7 +288,7 @@ 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, FB6237B8BC81FC0C990E8BE6 /* libPods-InstabugSample.a in Frameworks */, - DCC755EDCD9B460F84658AAD /* libRNInstabug.a in Frameworks */, + 62F9158A7B074929B2D8A561 /* libRNInstabug.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -480,7 +480,7 @@ 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, - A0FE88E32F084FD8A95E38DF /* RNInstabug.xcodeproj */, + 1B17852ABF654B8D8B056F8E /* RNInstabug.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -1064,6 +1064,10 @@ ); PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/InstabugSample.app/InstabugSample"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/instabug-reactnative/ios/RNInstabug/**", + ); }; name = Debug; }; @@ -1085,6 +1089,10 @@ ); PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/InstabugSample.app/InstabugSample"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/instabug-reactnative/ios/RNInstabug/**", + ); }; name = Release; }; @@ -1106,6 +1114,10 @@ ); PRODUCT_NAME = InstabugSample; VERSIONING_SYSTEM = "apple-generic"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/instabug-reactnative/ios/RNInstabug/**", + ); }; name = Debug; }; @@ -1126,6 +1138,10 @@ ); PRODUCT_NAME = InstabugSample; VERSIONING_SYSTEM = "apple-generic"; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/instabug-reactnative/ios/RNInstabug/**", + ); }; name = Release; }; @@ -1156,6 +1172,10 @@ SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.2; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/instabug-reactnative/ios/RNInstabug/**", + ); }; name = Debug; }; @@ -1186,6 +1206,10 @@ SDKROOT = appletvos; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.2; + HEADER_SEARCH_PATHS = ( + "$(inherited)", + "$(SRCROOT)/../node_modules/instabug-reactnative/ios/RNInstabug/**", + ); }; name = Release; }; diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index b22e036..a9e866f 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -122,7 +122,11 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule { super(reactContext); this.androidApplication = androidApplication; this.mInstabug = mInstabug; - Instabug.invoke(); + try { + Instabug.invoke(); + } catch (Exception e) { + e.printStackTrace(); + } } @Override