improve plugin implementation: update method signatures, consolidate event emitter, and regenerate dependencies
This commit is contained in:
parent
ad9b15801b
commit
124380e1fc
@ -71,7 +71,7 @@ dependencies {
|
|||||||
implementation "com.google.code.gson:gson:2.10.1"
|
implementation "com.google.code.gson:gson:2.10.1"
|
||||||
|
|
||||||
implementation("com.facebook.react:react-android")
|
implementation("com.facebook.react:react-android")
|
||||||
def product_catalog_version = "15.1.1"
|
def product_catalog_version = "15.3.0"
|
||||||
|
|
||||||
implementation ("de.webid-solutions:android_meta_plugin:$product_catalog_version") {
|
implementation ("de.webid-solutions:android_meta_plugin:$product_catalog_version") {
|
||||||
changing = true
|
changing = true
|
||||||
|
|||||||
@ -7,9 +7,12 @@ import com.facebook.react.uimanager.ViewManager
|
|||||||
|
|
||||||
|
|
||||||
class WebIdMetaPluginPackage : ReactPackage {
|
class WebIdMetaPluginPackage : ReactPackage {
|
||||||
override fun createNativeModules(reactContext: ReactApplicationContext)
|
override fun createNativeModules(reactContext: ReactApplicationContext): List<NativeModule> {
|
||||||
= listOf(WebIdMetaPluginModule(reactContext))
|
return listOf(WebIdMetaPluginModule(reactContext))
|
||||||
|
}
|
||||||
|
|
||||||
override fun createViewManagers(reactContext: ReactApplicationContext)
|
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
||||||
= emptyList<ViewManager<*, *>>()
|
return emptyList()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import com.facebook.react.ReactActivity
|
|||||||
import com.facebook.react.ReactActivityDelegate
|
import com.facebook.react.ReactActivityDelegate
|
||||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
||||||
import com.facebook.react.defaults.DefaultReactActivityDelegate
|
import com.facebook.react.defaults.DefaultReactActivityDelegate
|
||||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
|
|
||||||
|
|
||||||
class MainActivity : ReactActivity() {
|
class MainActivity : ReactActivity() {
|
||||||
|
|
||||||
@ -19,5 +18,5 @@ class MainActivity : ReactActivity() {
|
|||||||
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
|
||||||
*/
|
*/
|
||||||
override fun createReactActivityDelegate(): ReactActivityDelegate =
|
override fun createReactActivityDelegate(): ReactActivityDelegate =
|
||||||
DefaultReactActivityDelegate(this, mainComponentName, false)
|
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,9 +11,8 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "19.2.3",
|
"react": "19.2.3",
|
||||||
"react-dom": "19.2.3",
|
|
||||||
"react-native": "0.84.0",
|
"react-native": "0.84.0",
|
||||||
"react-native-web-id-meta-plugin": "file:.."
|
"react-native-bouncy-checkbox": "^4.1.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.0",
|
"@babel/core": "^7.20.0",
|
||||||
|
|||||||
@ -57,12 +57,18 @@ export default function App() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
paddingHorizontal: 16,
|
||||||
|
paddingBottom: 16,
|
||||||
|
paddingTop: 64,
|
||||||
|
},
|
||||||
input: {
|
input: {
|
||||||
height: 40,
|
height: 40,
|
||||||
margin: 12,
|
margin: 12,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
padding: 10,
|
padding: 10,
|
||||||
},
|
},
|
||||||
|
btn: { marginVertical: 8 },
|
||||||
});
|
});
|
||||||
|
|
||||||
const showAlert = (title: string, message: string) => {
|
const showAlert = (title: string, message: string) => {
|
||||||
@ -122,7 +128,7 @@ export default function App() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView style={styles.container}>
|
||||||
<StatusBar />
|
<StatusBar />
|
||||||
<View>
|
<View>
|
||||||
<View>
|
<View>
|
||||||
@ -164,16 +170,22 @@ export default function App() {
|
|||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
<View style={styles.btn}>
|
||||||
<Button title="Create Meta Plugin" onPress={onCreateMetaPlugin} />
|
<Button title="Create Meta Plugin" onPress={onCreateMetaPlugin} />
|
||||||
|
</View>
|
||||||
<TextInput
|
<TextInput
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
onChangeText={onChangeActionId}
|
onChangeText={onChangeActionId}
|
||||||
value={actionId}
|
value={actionId}
|
||||||
placeholder="Action Id"
|
placeholder="Action Id"
|
||||||
/>
|
/>
|
||||||
|
<View style={styles.btn}>
|
||||||
<Button title="Verify Action Id" onPress={onVerifyActionId} />
|
<Button title="Verify Action Id" onPress={onVerifyActionId} />
|
||||||
|
</View>
|
||||||
|
<View style={styles.btn}>
|
||||||
<Button title="Start" onPress={onStart} />
|
<Button title="Start" onPress={onStart} />
|
||||||
</View>
|
</View>
|
||||||
|
</View>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,7 +135,9 @@
|
|||||||
"@react-native",
|
"@react-native",
|
||||||
"prettier"
|
"prettier"
|
||||||
],
|
],
|
||||||
"plugins": ["prettier"],
|
"plugins": [
|
||||||
|
"prettier"
|
||||||
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"react/react-in-jsx-scope": "off",
|
"react/react-in-jsx-scope": "off",
|
||||||
"prettier/prettier": [
|
"prettier/prettier": [
|
||||||
|
|||||||
@ -17,9 +17,7 @@ const WebIdMetaPlugin = NativeModules.WebIdMetaPlugin
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
export const webIdEventEmitter = new NativeEventEmitter(
|
export const webIdEventEmitter = new NativeEventEmitter(WebIdMetaPlugin);
|
||||||
Platform.OS === 'android' ? undefined : WebIdMetaPlugin
|
|
||||||
);
|
|
||||||
|
|
||||||
export function createMetaPlugin(
|
export function createMetaPlugin(
|
||||||
uri: string,
|
uri: string,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user