Skip to content

Commit a3ba096

Browse files
authored
fix(android): added override on receiveCommand that supports an ID of type Int (#58)
1 parent e792b4b commit a3ba096

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: android/src/main/java/io/ionic/portals/reactnative/PortalView.kt

+10
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ internal class PortalViewManager(private val context: ReactApplicationContext) :
4949
return mutableMapOf("create" to createId)
5050
}
5151

52+
@Deprecated("Deprecated, but using to support New Architecture")
53+
override fun receiveCommand(root: FrameLayout, commandId: Int, args: ReadableArray?) {
54+
super.receiveCommand(root, commandId, args)
55+
val viewId = args?.getInt(0) ?: return
56+
57+
when (commandId) {
58+
createId -> createFragment(root, viewId)
59+
}
60+
}
61+
5262
override fun receiveCommand(root: FrameLayout, commandId: String?, args: ReadableArray?) {
5363
super.receiveCommand(root, commandId, args)
5464
val viewId = args?.getInt(0) ?: return

0 commit comments

Comments
 (0)