@metarouter/react-native-sdk 0.1.12 → 0.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,24 +11,6 @@ A lightweight React Native analytics SDK that transmits events to your MetaRoute
11
11
  npm install @metarouter/react-native-sdk
12
12
  ```
13
13
 
14
- ### Native Dependencies
15
-
16
- This library includes all required native dependencies and handles the linking automatically.
17
-
18
- #### iOS
19
-
20
- The iOS dependencies are automatically installed via CocoaPods when you run:
21
-
22
- ```sh
23
- cd ios && pod install
24
- ```
25
-
26
- #### Android
27
-
28
- The Android dependencies are automatically linked when you install this package. No additional steps required.
29
-
30
- **Note**: This library completely wraps the required native dependencies, so you don't need to install them separately.
31
-
32
14
  ## Usage
33
15
 
34
16
  ### Basic Setup
@@ -168,34 +150,6 @@ The analytics client provides the following methods:
168
150
  - 🔧 **TypeScript Support**: Full TypeScript support included
169
151
  - 🚀 **Lightweight**: Minimal overhead and dependencies
170
152
 
171
- ## Troubleshooting
172
-
173
- ### Android Build Issues
174
-
175
- If you encounter build issues on Android, make sure:
176
-
177
- 1. **Clean and rebuild**: Try cleaning your Android build:
178
-
179
- ```sh
180
- cd android && ./gradlew clean
181
- ```
182
-
183
- 2. **Check React Native version**: Ensure you're using a compatible React Native version.
184
-
185
- 3. **Verify library installation**: Make sure the library is properly installed and linked.
186
-
187
- ### iOS Build Issues
188
-
189
- If you encounter build issues on iOS:
190
-
191
- 1. **Install pods**: Make sure to run `pod install` in the iOS directory:
192
-
193
- ```sh
194
- cd ios && pod install
195
- ```
196
-
197
- 2. **Clean build folder**: Clean the Xcode build folder and rebuild.
198
-
199
153
  ## License
200
154
 
201
155
  MIT
@@ -1,35 +1,39 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
- android {
4
- namespace 'com.metarouterreactnative' // <- required in modern RN, change as needed
5
- compileSdkVersion 33
3
+ def safeExtGet(prop, fallback) {
4
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
5
+ }
6
6
 
7
+ android {
8
+ compileSdkVersion safeExtGet('compileSdkVersion', 33)
9
+
7
10
  defaultConfig {
8
- minSdkVersion 21
9
- targetSdkVersion 33
11
+ minSdkVersion safeExtGet('minSdkVersion', 21)
12
+ targetSdkVersion safeExtGet('targetSdkVersion', 33)
10
13
  versionCode 1
11
14
  versionName "0.1.0"
12
-
13
- consumerProguardFiles "consumer-rules.pro"
14
15
  }
15
-
16
+
16
17
  compileOptions {
17
- sourceCompatibility JavaVersion.VERSION_11
18
- targetCompatibility JavaVersion.VERSION_11
18
+ sourceCompatibility JavaVersion.VERSION_1_8
19
+ targetCompatibility JavaVersion.VERSION_1_8
19
20
  }
20
21
  }
21
22
 
23
+ repositories {
24
+ google()
25
+ mavenCentral()
26
+ maven { url "https://www.jitpack.io" }
27
+ }
28
+
22
29
  dependencies {
23
- // Core RN dependency (linked by consumer app)
30
+ // React Native core
24
31
  implementation 'com.facebook.react:react-native:+'
25
-
26
- // Segment SDK + Sovran
27
- implementation "com.segment.analytics.reactnative:analytics-react-native:2.21.2"
28
- implementation "com.segment.analytics.reactnative:sovran-react-native:1.1.3"
29
-
30
- // Async storage
31
- implementation "com.reactnativecommunity:async-storage:2.2.0"
32
-
33
- // Note: react-native-get-random-values is a JavaScript-only package
34
- // No native Android dependency needed
32
+
33
+ // Your SDK's native dependencies - these will be installed when users add your SDK
34
+ // Using the exact source directories from the config output
35
+ implementation project(':react-native-async-storage_async-storage')
36
+ implementation project(':segment-analytics-react-native')
37
+ implementation project(':sovran-react-native')
38
+ implementation project(':react-native-get-random-values')
35
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metarouter/react-native-sdk",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "exports": {
@@ -1,40 +1,15 @@
1
1
  module.exports = {
2
2
  dependencies: {
3
- '@segment/analytics-react-native': {
4
- platforms: {
5
- android: {
6
- sourceDir: './android',
7
- packageImportPath: 'import com.segment.analytics.reactnative.AnalyticsReactNativePackage;',
8
- packageInstance: 'new AnalyticsReactNativePackage()',
9
- },
10
- },
11
- },
12
- '@segment/sovran-react-native': {
13
- platforms: {
14
- android: {
15
- sourceDir: './android',
16
- packageImportPath: 'import com.segment.analytics.reactnative.sovran.SovranReactNativePackage;',
17
- packageInstance: 'new SovranReactNativePackage()',
18
- },
19
- },
20
- },
21
- '@react-native-async-storage/async-storage': {
22
- platforms: {
23
- android: {
24
- sourceDir: './android',
25
- packageImportPath: 'import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;',
26
- packageInstance: 'new AsyncStoragePackage()',
27
- },
28
- },
29
- },
3
+ '@segment/analytics-react-native': {},
4
+ '@segment/sovran-react-native': {},
5
+ 'react-native-get-random-values': {},
6
+ '@react-native-async-storage/async-storage': {},
30
7
  },
31
8
  dependency: {
32
9
  platforms: {
33
10
  ios: {},
34
11
  android: {
35
12
  sourceDir: './android',
36
- packageImportPath: 'import com.metarouterreactnative.MetaRouterReactNativePackage;',
37
- packageInstance: 'new MetaRouterReactNativePackage()',
38
13
  },
39
14
  },
40
15
  },
@@ -1,3 +0,0 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.metarouterreactnative">
3
- </manifest>
@@ -1,29 +0,0 @@
1
- package com.metarouterreactnative;
2
-
3
- import com.facebook.react.bridge.ReactApplicationContext;
4
- import com.facebook.react.bridge.ReactContextBaseJavaModule;
5
- import com.facebook.react.bridge.ReactMethod;
6
- import com.facebook.react.bridge.Promise;
7
- import com.facebook.react.bridge.ReadableMap;
8
-
9
- public class MetaRouterReactNativeModule extends ReactContextBaseJavaModule {
10
-
11
- private final ReactApplicationContext reactContext;
12
-
13
- public MetaRouterReactNativeModule(ReactApplicationContext reactContext) {
14
- super(reactContext);
15
- this.reactContext = reactContext;
16
- }
17
-
18
- @Override
19
- public String getName() {
20
- return "MetaRouterReactNative";
21
- }
22
-
23
- // Add your native methods here
24
- // Example:
25
- // @ReactMethod
26
- // public void initialize(ReadableMap config, Promise promise) {
27
- // // Implementation
28
- // }
29
- }
@@ -1,25 +0,0 @@
1
- package com.metarouterreactnative;
2
-
3
- import com.facebook.react.ReactPackage;
4
- import com.facebook.react.bridge.NativeModule;
5
- import com.facebook.react.bridge.ReactApplicationContext;
6
- import com.facebook.react.uimanager.ViewManager;
7
-
8
- import java.util.ArrayList;
9
- import java.util.Collections;
10
- import java.util.List;
11
-
12
- public class MetaRouterReactNativePackage implements ReactPackage {
13
-
14
- @Override
15
- public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
16
- return Collections.emptyList();
17
- }
18
-
19
- @Override
20
- public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
21
- List<NativeModule> modules = new ArrayList<>();
22
- modules.add(new MetaRouterReactNativeModule(reactContext));
23
- return modules;
24
- }
25
- }