-
Notifications
You must be signed in to change notification settings - Fork 5
feat: React Native New Architecture Support #58
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
base: main
Are you sure you want to change the base?
Changes from 7 commits
03982a4
0080914
1719afd
380758e
87cb9ca
260328a
5604b92
af9a473
b5f2942
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ project.xcworkspace | |
.gradle | ||
local.properties | ||
android.iml | ||
**/.cxx | ||
|
||
# Cocoapods | ||
# | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.amplitude.experiment.reactnative"> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.amplitude.experiment.reactnative"> | ||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | ||
</manifest> |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New arch Android implementation. To conform to the generated spec interface. Redirect call to shared impl. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.amplitude.experiment.reactnative | ||
|
||
import com.facebook.react.bridge.Promise | ||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.bridge.WritableNativeMap | ||
|
||
class ExperimentReactNativeClientModule(reactContext: ReactApplicationContext) : | ||
NativeExperimentReactNativeClientSpec(reactContext) { | ||
|
||
private val expRnClient = ExperimentReactNativeClientImpl(reactContext) | ||
|
||
@Override | ||
override fun getName(): String { | ||
return ExperimentReactNativeClientImpl.NAME | ||
} | ||
|
||
@Override | ||
override fun getApplicationContext(promise: Promise) { | ||
expRnClient.getApplicationContext(promise) | ||
} | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Old arch Android implementation. Old interface. Redirect call to shared impl. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.amplitude.experiment.reactnative | ||
|
||
import com.facebook.react.bridge.Promise | ||
import com.facebook.react.module.annotations.ReactModule | ||
import com.facebook.react.bridge.ReactApplicationContext | ||
import com.facebook.react.bridge.ReactContextBaseJavaModule | ||
import com.facebook.react.bridge.ReactMethod | ||
import com.facebook.react.bridge.WritableNativeMap | ||
|
||
class ExperimentReactNativeClientModule(private val reactContext: ReactApplicationContext) : | ||
ReactContextBaseJavaModule(reactContext) { | ||
|
||
private val expRnClient = ExperimentReactNativeClientImpl(reactContext) | ||
|
||
@Override | ||
override fun getName(): String { | ||
return ExperimentReactNativeClientImpl.NAME | ||
} | ||
|
||
@ReactMethod | ||
fun getApplicationContext(promise: Promise) { | ||
expRnClient.getApplicationContext(promise) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shared Android native code implementation.