Create "Notification Service Extension" from post build script

Hi!
We are using a postbuild-script to modify our xcode project.

Works great, but now we need your help. We are trying to add a “Notification Service Extension”-target from code (see picture).
Picture

We can add a new xcode target by using PBXProject.AddAppExtension, but with this we only get a “normal” target, not a specific “Notification Service Extension”-template-one…

Reason why we want this done by code is that we are trying to get OneSignal to work with Unity Cloud Build. We have step 1 ready and working from our script, but struggling with the second part in the setup guide found here: Unity SDK Setup

Any input would be very nice. Thanks!

The type of extension is determined by the NSExtensionPointIdentifier entry in your extension’s Info.plist.
I managed to automate the creation of a notification service extension target and setting of all the annoying things that need to be set.
Below is the code I’m using

    [PostProcessBuild]
    public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
    {
        if(target == BuildTarget.iOS)
        {
            var projPath = PBXProject.GetPBXProjectPath(pathToBuiltProject);
            PBXProject proj = new PBXProject ();
            proj.ReadFromFile (projPath);
            string targetGUID = proj.TargetGuidByName ("Unity-iPhone");

            var plistPath = pathToBuiltProject + "/Info.plist";
            PlistDocument plist = new PlistDocument();
			plist.ReadFromFile (plistPath);

			var pathToNotificationService = /* PATH TO YOUR NOTIFICATION SERVICE SOURCEFILES */;
			var notificationServicePlistPath = pathToNotificationService + "/Info.plist";
			PlistDocument notificationServicePlist = new PlistDocument();
			notificationServicePlist.ReadFromFile (notificationServicePlistPath);
			notificationServicePlist.root.SetString ("CFBundleShortVersionString", PlayerSettings.bundleVersion);
			notificationServicePlist.root.SetString ("CFBundleVersion", PlayerSettings.iOS.buildNumber.ToString ());
			var notificationServiceTarget = PBXProjectExtensions.AddAppExtension (proj, targetGUID, "notificationservice", PlayerSettings.GetApplicationIdentifier (BuildTargetGroup.iOS) + ".notificationservice", notificationServicePlistPath);
			proj.AddFileToBuild (notificationServiceTarget, proj.AddFile (pathToNotificationService + "/NotificationService.h", "NotificationService/NotificationService.h"));
			proj.AddFileToBuild (notificationServiceTarget, proj.AddFile (pathToNotificationService + "/NotificationService.m", "NotificationService/NotificationService.m"));
			proj.AddFrameworkToProject (notificationServiceTarget, "NotificationCenter.framework", true);
			proj.AddFrameworkToProject (notificationServiceTarget, "UserNotifications.framework", true);
			proj.SetBuildProperty (notificationServiceTarget, "ARCHS", "$(ARCHS_STANDARD)");
			proj.SetBuildProperty (notificationServiceTarget, "DEVELOPMENT_TEAM", PlayerSettings.iOS.appleDeveloperTeamID);
			notificationServicePlist.WriteToFile (notificationServicePlistPath);

            proj.WriteToFile (projPath);
			plist.WriteToFile (plistPath);
        }
    }

Where are you setting value for NSExtensionPointIdentifier?