I’ve been trying to follow the integration for Push Notifications but the outdated documentation and code has been giving me trouble. First, it tells you to add an older version to your manifest file. 2.0.0-pre2 is the current version as of this post, but the documentation has you add in 1.1.0-pre2.
Also, I tried to add the sample script to register for push notifications found here: Push Notifications SDK documentation | Push Notifications | 2.0.0-pre.2 (unity3d.com)
But the code is wrong. It tells you to call “PushNotificationService.Instance” but this won’t work, because the correct name is PushNotificationsService.Instance
The documentation was also unclear if the firebase SDK needed to be added to the project. When setting up firebase for the first time, and creating the app within firebase to get the app ID, the instructions prompt you to install firebase SDK to your unity project. I also use the Unity Mediation service, which has files that conflict with the firebase SDK (specifically the resolver files), so I deleted the external dependancy manager that came with the Firebase SDK but now I have an error in my project:
TypeLoadException: Could not resolve type with token 01000074 from typeref (expected class 'Google.EditorInitializer' in assembly 'Google.VersionHandlerImpl, Version=1.2.0.0, Culture=neutral, PublicKeyToken=null')
Rethrow as TypeInitializationException: The type initializer for 'Firebase.Editor.GenerateXmlFromGoogleServicesJson' threw an exception.
(wrapper write-barrier) System.Object.wbarrier_conc(intptr)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <f3aec01a34d14c7080754e28743c8472>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <f3aec01a34d14c7080754e28743c8472>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <f3aec01a34d14c7080754e28743c8472>:0)
UnityEditor.AssetPostprocessingInternal.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) (at <f90799373c314538a0c910377078306d>:0)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets, System.Boolean didDomainReload) (at <f90799373c314538a0c910377078306d>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
Does the firebase sdk need to be included in the project? What files do I or don’t I need to add if any?