2222#if FIREBASE_PLATFORM_ANDROID
2323#include < jni.h>
2424#endif // FIREBASE_PLATFORM_ANDROID
25+
2526#include < map>
2627#include < string>
2728
29+ #if FIREBASE_PLATFORM_IOS
30+ #ifdef __OBJC__
31+ @class FIRApp;
32+ #endif // __OBJC__
33+ #endif // FIREBASE_PLATFORM_IOS
34+
2835// / @brief Namespace that encompasses all Firebase APIs.
2936#if !defined(FIREBASE_NAMESPACE)
3037#define FIREBASE_NAMESPACE firebase
@@ -36,6 +43,7 @@ namespace FIREBASE_NAMESPACE {
3643#ifdef INTERNAL_EXPERIMENTAL
3744namespace internal {
3845class FunctionRegistry;
46+ class AppInternal;
3947} // namespace internal
4048#endif // INTERNAL_EXPERIMENTAL
4149
@@ -594,7 +602,7 @@ class App {
594602 // / @note This method is specific to the Android implementation.
595603 // /
596604 // / @return JNI Java virtual machine object.
597- JavaVM* java_vm () const { return java_vm_; }
605+ JavaVM* java_vm () const ;
598606 // / Get JNI environment, needed for performing JNI calls, set on creation.
599607 // / This is not trivial as the correct environment needs to retrieved per
600608 // / thread.
@@ -725,19 +733,24 @@ class App {
725733 static void SetDefaultConfigPath (const char * path);
726734#endif // INTERNAL_EXPERIMENTAL
727735
728- private:
729- // / @cond FIREBASE_APP_INTERNAL
730- friend class auth ::Auth;
731- friend class crashlytics ::internal::CrashlyticsInternal;
732- friend class database ::internal::DatabaseInternal;
733736#ifdef INTERNAL_EXPERIMENTAL
734- friend class firestore ::FirestoreInternal;
737+ #if FIREBASE_PLATFORM_ANDROID
738+ // / Get the platform specific app implementation referenced by this object.
739+ // /
740+ // / @return Global reference to the FirebaseApp. The returned reference
741+ // / most be deleted after use.
742+ jobject GetPlatformApp () const ;
743+ #elif FIREBASE_PLATFORM_IOS
744+ #ifdef __OBJC__
745+ // / Get the platform specific app implementation referenced by this object.
746+ // /
747+ // / @return Reference to the FIRApp object owned by this app.
748+ FIRApp* GetPlatformApp () const ;
749+ #endif // __OBJC__
750+ #endif // FIREBASE_PLATFORM_ANDROID, FIREBASE_PLATFORM_IOS
735751#endif // INTERNAL_EXPERIMENTAL
736- friend class functions ::internal::FunctionsInternal;
737- friend class instance_id ::InstanceId;
738- friend class internal ::InstanceId;
739- friend class storage ::internal::StorageInternal;
740752
753+ private:
741754 // / Construct the object.
742755 App ();
743756
@@ -746,10 +759,6 @@ class App {
746759// Unity doesn't need the JNI from here, it has its method to access JNI.
747760// </SWIG>
748761#if FIREBASE_PLATFORM_ANDROID || defined(DOXYGEN)
749- // / JNI reference to the Java virtual machine associated with the App's
750- // / process.
751- // / @note This is specific to Android.
752- JavaVM* java_vm_;
753762 // / Android activity.
754763 // / @note This is specific to Android.
755764 jobject activity_;
@@ -763,7 +772,7 @@ class App {
763772 // / Module initialization results.
764773 std::map<std::string, InitResult> init_results_;
765774 // / Pointer to other internal data used by this instance.
766- void * data_ ;
775+ internal::AppInternal* internal_ ;
767776
768777 // / @endcond
769778};
0 commit comments