对于什么值得我使用Unity 5.0.0和Xcode 8.3.2与Unity5OneSignalSDK.unitypackage SDK和点5.1到5.7足够让推送通知工作。
我也在使用以下后处理器检查“远程通知”的背景模式自动化...我无法找到一种方法来自动化与UserNotifications.framework的链接但是tho ...让我知道如果任何人都有如何做到这一点的想法。
// ---------------------------------------------------------------------------------------------------------------------
public static class XCodePostProcess
{
// -----------------------------------------------------------------------------------------------------------------
[PostProcessBuild(100)]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuildProject)
{
if (target == BuildTarget.iOS)
{
UpdateInfoPlist(pathToBuildProject);
}
}
// -----------------------------------------------------------------------------------------------------------------
private static void UpdateInfoPlist(string path)
{
// load plist
string plistPath = Path.Combine(path, "Info.plist");
PlistDocument plist = new PlistDocument();
plist.ReadFromString(File.ReadAllText(plistPath));
//Get Root
PlistElementDict rootDict = plist.root;
//Add Necessary Things
PlistElementArray LSApplicationQueriesSchemes = rootDict.CreateArray("LSApplicationQueriesSchemes");
LSApplicationQueriesSchemes.AddString("itms-beta"); // test flight
// localizations
PlistElementArray CFBundleLocalizations = rootDict.CreateArray("CFBundleLocalizations");
CFBundleLocalizations.AddString("en"); // english
CFBundleLocalizations.AddString("de"); // german
CFBundleLocalizations.AddString("fr"); // french
CFBundleLocalizations.AddString("es"); // spanish
// for OneSigna remote notifications
PlistElementArray UIBackgroundModes = rootDict.CreateArray("UIBackgroundModes");
UIBackgroundModes.AddString("remote-notification");
//WriteFile
File.WriteAllText (plistPath, plist.WriteToString());
}
}
选中此链接。 http://stackoverflow.com/questions/24333981/ios-app-with-framework-crashed-on-device-dyld-library-not-loaded-xcode-6-beta/28469804#28469804 –
@OgnjenMarceta,不幸的是它doesn对我来说似乎没有用。 当我创建XCode项目时,Unity会自动导入一些.framework文件,但不包括UserNotifications.framework。对我来说这听起来很奇怪,OneSignal官方指南说了一些不起作用的东西。 我想知道是否有与v1.15.2一起使用的旧指南。 – erre