@@ -110,7 +110,7 @@ public class FirebaseMessagingActivityGenerator : IPreprocessBuildWithReport {
110
110
" @Override" ,
111
111
" protected void onCreate(Bundle savedInstanceState) {{" ,
112
112
" if (mUnityPlayer != null) {{" ,
113
- " mUnityPlayer.quit ();" ,
113
+ " mUnityPlayer.{1} ();" ,
114
114
" mUnityPlayer = null;" ,
115
115
" }}" ,
116
116
" super.onCreate(savedInstanceState);" ,
@@ -122,6 +122,12 @@ public class FirebaseMessagingActivityGenerator : IPreprocessBuildWithReport {
122
122
private readonly string BaseGameActivityClass = "UnityPlayerGameActivity" ;
123
123
#endif
124
124
125
+ #if UNITY_2023_1_OR_NEWER
126
+ private readonly string UnityPlayerQuitFunction = "destroy" ;
127
+ #else
128
+ private readonly string UnityPlayerQuitFunction = "quit" ;
129
+ #endif
130
+
125
131
private readonly string GeneratedFileTag = "FirebaseMessagingActivityGenerated" ;
126
132
// If this tag is present on the generated file, it will not be replaced.
127
133
private readonly string PreserveTag = "FirebasePreserve" ;
@@ -144,7 +150,8 @@ public void OnPreprocessBuild(BuildReport report) {
144
150
baseClass = BaseGameActivityClass ;
145
151
}
146
152
#endif
147
- string fileContents = System . String . Format ( System . String . Join ( "\n " , ActivityClassContents ) , baseClass ) ;
153
+ string fileContents = System . String . Format ( System . String . Join ( "\n " , ActivityClassContents ) ,
154
+ baseClass , UnityPlayerQuitFunction ) ;
148
155
149
156
// Check if the file has already been generated.
150
157
string [ ] oldAssetGuids = AssetDatabase . FindAssets ( "l:" + GeneratedFileTag ) ;
0 commit comments