From b836c3dbc60b12623b8259d425b4bd015e36e323 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 2 Apr 2024 09:42:40 -0700 Subject: [PATCH] FirebaseAndroid: introduce `SwiftFirebase` JAR This introduces the Java bindings for the JNI backed implementation. When implementing an Android application which uses swift-firebase, `SwiftFirebase` provides the bridge to the JNI functions required to enable the functionality. --- Sources/FirebaseAndroid/CMakeLists.txt | 4 ++++ Sources/FirebaseAndroid/Native.java | 10 ++++++++++ 2 files changed, 14 insertions(+) create mode 100644 Sources/FirebaseAndroid/Native.java diff --git a/Sources/FirebaseAndroid/CMakeLists.txt b/Sources/FirebaseAndroid/CMakeLists.txt index 4fd4ff7..bb5567b 100644 --- a/Sources/FirebaseAndroid/CMakeLists.txt +++ b/Sources/FirebaseAndroid/CMakeLists.txt @@ -7,3 +7,7 @@ target_include_directories(FirebaseAndroidJNI PUBLIC target_link_libraries(FirebaseAndroidJNI PRIVATE log) +add_jar(SwiftFirebase + Native.java + INCLUDE_JARS + $ENV{ANDROID_SDK_ROOT}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/android.jar) diff --git a/Sources/FirebaseAndroid/Native.java b/Sources/FirebaseAndroid/Native.java new file mode 100644 index 0000000..21f0895 --- /dev/null +++ b/Sources/FirebaseAndroid/Native.java @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: BSD-3-Clause + +package company.thebrowser; + +import android.app.Activity; + +public class Native +{ + public native boolean RegisterActivity(android.app.Activity activity); +}