Enable UNITY_USES_REMOTE_NOTIFICATIONS
How can I set something within PlayerSettings to make UNITY_USES_REMOTE_NOTIFICATIONS=1
instead of manually editing the preprocessor.h file?
Setting UNITY_USES_REMOTE_NOTIFICATIONS=1
in the 'Scripting Define Symbols' text field doesn't work.
Can somebody please answer this? I am facing the same issue.
Also got this problem. Can not find any way to manage this macros from Unity (5.4.0f3). Seems that it should be handled by Unity while generating xcode project.
Answer by crh0716 · Aug 30, 2016 at 11:03 AM
It's a little bit hacky but a post-build processor should solve the issue.
using System.Collections;
using System.IO;
#if UNITY_IOS
using UnityEditor.iOS.Xcode;
#endif
public static class PostBuildProcessor
{
#if UNITY_IOS
[PostProcessBuild(999)]
public static void OnPostProcessBuild(BuildTarget buildTarget, string path)
{
string preprocessorPath = path + "/Classes/Preprocessor.h";
string text = File.ReadAllText(preprocessorPath);
text = text.Replace("UNITY_USES_REMOTE_NOTIFICATIONS 0", "UNITY_USES_REMOTE_NOTIFICATIONS 1");
File.WriteAllText(preprocessorPath, text);
}
#endif
}
Answer by r2digi · Sep 03, 2016 at 01:53 PM
thanks. i used this too. this wasn't broken before. wonder if it's a bug that got introduced.
Your answer
Follow this Question
Related Questions
How to detect if push notification is launched from lock screen or received in-app 0 Answers
if the Android/ios device rotate (x) degrees do animation 0 Answers
Smooth Camera Rotation with Deceleration 1 Answer
How to disable Push Notifications capability in iOS build made by Unity 2018.2.0f3 1 Answer
Firebase Messaging Unity plugin 0 Answers