Skip to content

Commit f7d5d15

Browse files
TheBuggedYRNymabdallah
authored andcommitted
[MOB-11946] Delegate Native SDKs (#919)
Allow native apps that have recently integrated React Native within their apps to use Instabug native SDKs via the `instabug-reactnative` npm package.
1 parent 5ffd395 commit f7d5d15

File tree

5 files changed

+25
-3
lines changed

5 files changed

+25
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Bumps Instabug Android SDK to v11.8.0
44
- Bumps Instabug iOS SDK to v11.7.0
55
- Adds monorepo support for source maps scripts
6+
- Adds gradle and ruby files to integrate native SDKs within exiting native apps. See [#919](https://github.com/Instabug/Instabug-React-Native/pull/919) for more info.
67
- Fixes global error handler not being called.
78
- Deprecates all module-enums (e.g. `Instabug.invocationEvent`) in favour of standalone-enums (e.g. `InvocationEvent`). See [#914](https://github.com/Instabug/Instabug-React-Native/pull/914) for more info and detailed list of Enums.
89
- Deprecates Instabug.start in favour of Instabug.init that takes a configuration object for SDK initialization.

RNInstabug.podspec

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
require 'json'
2+
require_relative './ios/native'
3+
24
package = JSON.parse(File.read('package.json'))
35

46
Pod::Spec.new do |s|
@@ -14,5 +16,5 @@ Pod::Spec.new do |s|
1416
s.source_files = "ios/**/*.{h,m,mm}"
1517

1618
s.dependency 'React-Core'
17-
s.dependency 'Instabug', '11.7.0'
19+
use_instabug!(s)
1820
end

android/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
apply plugin: 'com.android.library'
22

33
apply from: './jacoco.gradle'
4+
apply from: './native.gradle'
45

56
String getExtOrDefault(String name) {
67
if (rootProject.ext.has(name)) {
@@ -35,8 +36,6 @@ dependencies {
3536
implementation "androidx.multidex:multidex:2.0.1"
3637
implementation 'com.facebook.react:react-native:+'
3738

38-
api 'com.instabug.library:instabug:11.8.0'
39-
4039
testImplementation "org.mockito:mockito-inline:3.4.0"
4140
testImplementation "org.mockito:mockito-android:3.4.0"
4241
testImplementation 'junit:junit:4.13.2'

android/native.gradle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
project.ext.instabug = [
2+
version: '11.8.0'
3+
]
4+
5+
dependencies {
6+
api "com.instabug.library:instabug:${project.ext.instabug.version}"
7+
}

ios/native.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
$instabug = { :version => '11.7.0' }
2+
3+
def use_instabug! (spec = nil)
4+
version = $instabug[:version]
5+
6+
if (!spec)
7+
pod 'Instabug', version
8+
else
9+
spec.dependency 'Instabug', version
10+
end
11+
12+
$instabug
13+
end

0 commit comments

Comments
 (0)