File tree Expand file tree Collapse file tree 9 files changed +70
-18
lines changed Expand file tree Collapse file tree 9 files changed +70
-18
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ set(FIREBASE_MESSAGING_ANDROID_DEPS
6565 "com.google.firebase:firebase-messaging:23.1.2"
6666 "com.google.firebase:firebase-analytics:21.2.0"
6767 "com.google.firebase:firebase-iid:21.1.0"
68+ "com.google.flatbuffers:flatbuffers-java:1.12.0"
6869)
6970
7071set (FIREBASE_REMOTE_CONFIG_ANDROID_DEPS
Original file line number Diff line number Diff line change @@ -298,29 +298,40 @@ endfunction()
298298#
299299# unity_pack_file(<file>
300300# PACK_PATH
301+ # RENAME_TO
301302# )
302303#
303304# Args:
304305# file: Path of file to pack
305- # pack_path: Destination to put the file in.
306+ # PACK_PATH: Destination to put the file in.
307+ # RENAME_TO: Optional parameter to rename the file.
306308#
307309# Notes:
308310# * Files are put into build arch folder
309311#
310312function (unity_pack_file file)
311- set (multi PACK_PATH)
312- # Parse the arguments into UNITY_MONO_SOURCES and UNITY_MONO_DEPENDS .
313- cmake_parse_arguments (UNITY_PACK "" "" " ${multi} " ${ARGN} )
313+ set (single PACK_PATH RENAME_TO )
314+ # Parse the arguments into UNITY_PACK_* .
315+ cmake_parse_arguments (UNITY_PACK "" "${single} " " " ${ARGN} )
314316
315317 if ("${UNITY_PACK_PACK_PATH} " STREQUAL "" )
316318 set (UNITY_PACK_PACK_PATH ${UNITY_PACK_DEFAULT_CS_PATH} )
317319 endif ()
318320
319- # meta file
320- install (
321- FILES ${file}
322- DESTINATION ${UNITY_PACK_PACK_PATH}
323- )
321+ # Install the file to the PACK_PATH, renaming it if given RENAME_TO
322+ if ("${UNITY_PACK_RENAME_TO} " STREQUAL "" )
323+ # Install the file to the PACK_PATH
324+ install (
325+ FILES ${file}
326+ DESTINATION ${UNITY_PACK_PACK_PATH}
327+ )
328+ else ()
329+ install (
330+ FILES ${file}
331+ DESTINATION ${UNITY_PACK_PACK_PATH}
332+ RENAME ${UNITY_PACK_RENAME_TO}
333+ )
334+ endif ()
324335endfunction ()
325336
326337# Packs a aar file into the unity zip
Original file line number Diff line number Diff line change @@ -69,6 +69,12 @@ Support
6969
7070Release Notes
7171-------------
72+ ### Upcoming
73+ - Changes
74+ - Messaging (Android): Provide the custom MessagingUnityPlayerActivity
75+ as a Java file instead of precompiling it. This is to better support
76+ changes with the UnityPlayerActivity in the Unity 2023 editor.
77+
7278### 10.6.0
7379- Changes
7480 - General (Android): Update to Firebase Android BoM version 31.2.3.
Original file line number Diff line number Diff line change @@ -71,8 +71,6 @@ build_firebase_shared(
7171 FirebaseCppMessaging
7272 ANDROID_MANIFEST
7373 "${CMAKE_CURRENT_LIST_DIR} /AndroidManifest.xml"
74- CLASSES_JAR
75- "${CMAKE_CURRENT_LIST_DIR} /activity/classes.jar"
7674)
7775endif ()
7876
@@ -89,6 +87,29 @@ if (FIREBASE_INCLUDE_UNITY)
8987 )
9088endif ()
9189
90+ if (ANDROID)
91+ # Add the additional Messaging files needed for Android
92+ unity_pack_file(
93+ "activity/com/google/firebase/MessagingUnityPlayerActivity.java"
94+ PACK_PATH
95+ "Firebase/Plugins/Android/"
96+ )
97+ # Get the Messaging Java AAR file from the C++ SDK.
98+ add_custom_target (
99+ firebase_messaging_java_aar_unity
100+ ALL
101+ DEPENDS firebase_messaging_java_aar
102+ )
103+ get_target_property (messaging_aar_file firebase_messaging_java_aar OBJECT_OUTPUTS )
104+ unity_pack_file(
105+ ${messaging_aar_file}
106+ PACK_PATH
107+ "Firebase/Plugins/Android/"
108+ RENAME_TO
109+ "firebase-messaging-cpp.aar"
110+ )
111+ endif ()
112+
92113set_property (TARGET firebase_messaging_cs
93114 PROPERTY FOLDER
94115 "Firebase ${FIREBASE_PLATFORM_NAME} "
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 296296 " Firebase/Plugins/x86_64/FirebaseCppMessaging*"
297297 ]
298298 },
299+ {
300+ "importer" : " PluginImporter" ,
301+ "platforms" : [" Android" ],
302+ "cpu" : " AnyCPU" ,
303+ "paths" : [
304+ " Firebase/Plugins/Android/MessagingUnityPlayerActivity.java" ,
305+ " Firebase/Plugins/Android/firebase-messaging-cpp.aar"
306+ ]
307+ },
299308 {
300309 "importer" : " DefaultImporter" ,
301310 "paths" : [
Original file line number Diff line number Diff line change 742742 " Firebase/Plugins/x86_64/FirebaseCppMessaging*"
743743 ]
744744 },
745+ {
746+ "importer" : " PluginImporter" ,
747+ "platforms" : [" Android" ],
748+ "cpu" : " AnyCPU" ,
749+ "paths" : [
750+ " Firebase/Plugins/Android/MessagingUnityPlayerActivity.java" ,
751+ " Firebase/Plugins/Android/firebase-messaging-cpp.aar"
752+ ]
753+ },
745754 {
746755 "importer" : " DefaultImporter" ,
747756 "paths" : [" Firebase/Editor/FirebaseMessaging*_manifest.txt" ]
Original file line number Diff line number Diff line change 437437 "Firebase/Editor/FirebaseMessaging_version-10.4.0_manifest.txt": "b3485828d4234137a8280f00a1f7b9ee",
438438 "Firebase/Editor/FirebaseRemoteConfig_version-10.4.0_manifest.txt": "b2256be1dfd54952908252655336b218",
439439 "Firebase/Editor/FirebaseStorage_version-10.4.0_manifest.txt": "981f0090257a44369332d6a7437869f3",
440+ "Firebase/Plugins/Android/MessagingUnityPlayerActivity.java": "794c5e69320a44ca9d01f87f1019164e",
441+ "Firebase/Plugins/Android/firebase-messaging-cpp.aar": "0be2cda49adc4b61a7e9eb9bf669fdab",
440442 "Firebase/Plugins/x86_64/FirebaseCppApp-10_4_0.bundle": "377df3b93de5491f8ca5dd75a1c63285",
441443 "Firebase/Plugins/x86_64/FirebaseCppApp-10_4_0.dll": "6008badfe2a9454c897af3b59668d865",
442444 "Firebase/Plugins/x86_64/FirebaseCppApp-10_4_0.so": "e2c049b2b0a44e3cb32171ad383d7bb1",
You can’t perform that action at this time.
0 commit comments