Skip to content

Commit

Permalink
Merge pull request #4 from SourcePointUSA/DIA-2473-manage-package
Browse files Browse the repository at this point in the history
[DIA-2473] manage package
  • Loading branch information
Nevazhnovu authored Jul 29, 2023
2 parents bd852ef + 9e3b0ae commit 07b4277
Show file tree
Hide file tree
Showing 34 changed files with 239 additions and 85 deletions.
10 changes: 0 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# This .gitignore file should be placed at the root of your Unity project directory
/[Ll]ibrary/
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/[Ll]ogs/
/[Uu]ser[Ss]ettings/

# Unzipped ConsentViewController.xcframework
Assets/ConsentManagementProvider/xcframework/ConsentViewController.xcframework/*
Assets/ConsentManagementProvider/xcframework/ConsentViewController.xcframework.meta

# Visual Studio cache directory
.vs/

Expand All @@ -23,11 +18,6 @@ Assets/ConsentManagementProvider/xcframework/ConsentViewController.xcframework.m

# Builds
*.apk
DemoBuilds/ios_demo/*
!DemoBuilds/ios_demo/ios_demo.zip

# Exclude specific demo builds
!ConsentManagementProviderDemo.apk

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
Expand Down
13 changes: 0 additions & 13 deletions Assets/ConsentManagementProvider/Editor/CMPPostProcessBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ public static class CMPPostProcessBuild
[PostProcessBuild]
public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)
{
// const string defaultLocationInProj = "Plugins/iOS";
// const string coreFrameworkName = "ConsentViewController.xcframework";
if (buildTarget == BuildTarget.iOS)
{
PBXProject pbxProject = new PBXProject();
Expand All @@ -28,11 +26,6 @@ public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)
EnableCppModules(pbxProject);
EnableObjectiveCExceptions(pbxProject);
EnableBitcode(pbxProject, unityProjectGuid, false);
// EnableBitcode(pbxProject, unityMainTargetGuid, false);

// LinkBinaryWithLibraries(pbxProject, unityMainGUID);
// LinkBinaryWithLibraries(pbxProject,unityMainTargetGuid, "libswiftWebKit.tbd");
// EnableSwift(pbxProject, unityProjectGuid);

pbxProject.WriteToFile(projPath);

Expand All @@ -47,7 +40,6 @@ static void AddParameterToInfoPlist(string plistPath)
plist.ReadFromString(File.ReadAllText(plistPath));
PlistElementDict rootDict = plist.root;

// var buildKey = "Privacy - Tracking Usage Description";
var buildKey = "NSUserTrackingUsageDescription";
rootDict.SetString(buildKey,"This identifier will be used to deliver personalized ads to you.");

Expand All @@ -57,11 +49,6 @@ static void AddParameterToInfoPlist(string plistPath)
static void ConfigureFrameworks(PBXProject pbxProject, string targetGuid)
{
pbxProject.AddBuildProperty(targetGuid, "LD_RUNPATH_SEARCH_PATHS", "/usr/lib/swift");
/*pbxProject.AddBuildProperty(targetGuid, "FRAMERWORK_SEARCH_PATHS",
"$(inherited) $(PROJECT_DIR) $(PROJECT_DIR)/Frameworks");
pbxProject.AddBuildProperty(targetGuid, "DYLIB_INSTALL_NAME_BASE", "@rpath");
pbxProject.AddBuildProperty(targetGuid, "LD_DYLIB_INSTALL_NAME",
"@executable_path/../Frameworks/$(EXECUTABLE_PATH)");*/
}

static void TieBridgingHeader(PBXProject pbxProject, string targetGuid)
Expand Down
32 changes: 30 additions & 2 deletions Assets/ConsentManagementProvider/Scripts/facade/CMP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,17 @@ namespace ConsentManagementProviderLib
public static class CMP
{
private static GameObject mainThreadBroadcastEventsExecutor;

public static void Initialize(List<SpCampaign> spCampaigns, int accountId, string propertyName, MESSAGE_LANGUAGE language, CAMPAIGN_ENV campaignsEnvironment, long messageTimeoutInSeconds = 3)
private static bool IsEditor => Application.platform == RuntimePlatform.LinuxEditor
|| Application.platform == RuntimePlatform.WindowsEditor
|| Application.platform == RuntimePlatform.OSXEditor;


public static void Initialize(
List<SpCampaign> spCampaigns,
int accountId, string propertyName,
MESSAGE_LANGUAGE language,
CAMPAIGN_ENV campaignsEnvironment,
long messageTimeoutInSeconds = 3)
{
if(!IsSpCampaignsValid(spCampaigns))
{
Expand Down Expand Up @@ -51,6 +60,12 @@ public static void Initialize(List<SpCampaign> spCampaigns, int accountId, strin

public static void LoadMessage(string authId = null)
{
if (IsEditor)
{
Debug.LogWarning("Emulating LoadMessage call... Sourcepoint CMP works only for real Android/iOS devices, not the Unity Editor.");
return;
}

#if UNITY_ANDROID
if (Application.platform == RuntimePlatform.Android)
{
Expand All @@ -66,6 +81,13 @@ public static void LoadMessage(string authId = null)

public static void LoadPrivacyManager(CAMPAIGN_TYPE campaignType, string pmId, PRIVACY_MANAGER_TAB tab)
{
if (IsEditor)
{
Debug.LogWarning($"Emulating LoadPrivacyManager call for {campaignType}... " +
$"Sourcepoint CMP works only for real Android/iOS devices, not the Unity Editor.");
return;
}

#if UNITY_ANDROID
if (Application.platform == RuntimePlatform.Android)
{
Expand Down Expand Up @@ -189,6 +211,12 @@ private static bool IsSpCampaignsValid(List<SpCampaign> spCampaigns)
Debug.LogError("You should add at least one SpCampaign to use CMP! Aborting...");
return false;
}
if (IsEditor)
{
Debug.LogWarning("ATTENTION! Sourcepoint CMP works only for real Android/iOS devices, not the Unity Editor.");
return false;
}

return true;
}
#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1747985672}
m_Father: {fileID: 613571621}
Expand Down Expand Up @@ -351,6 +352,7 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1098732044}
m_Father: {fileID: 0}
Expand Down Expand Up @@ -382,6 +384,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1671120540}
- {fileID: 83923767}
Expand Down Expand Up @@ -425,6 +428,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 937883056}
m_Father: {fileID: 613571621}
Expand Down Expand Up @@ -572,6 +576,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 759187202}
m_RootOrder: 0
Expand Down Expand Up @@ -652,6 +657,7 @@ RectTransform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 613571621}
m_Father: {fileID: 519420032}
Expand Down Expand Up @@ -751,6 +757,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
Expand All @@ -777,7 +784,7 @@ MonoBehaviour:
accountId: 22
propertyName: mobile.multicampaign.demo
campaignEnvironment: 1
messageTimeoutInSeconds: 3
messageTimeoutInSeconds: 30
authID:
--- !u!114 &1221699451
MonoBehaviour:
Expand Down Expand Up @@ -821,6 +828,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SendPointerHoverToParent: 1
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
Expand Down Expand Up @@ -853,6 +861,7 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
Expand Down Expand Up @@ -885,6 +894,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 613571621}
m_RootOrder: 0
Expand Down Expand Up @@ -960,6 +970,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2071415500}
m_RootOrder: 0
Expand Down Expand Up @@ -1039,6 +1050,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 83923767}
m_RootOrder: 0
Expand Down Expand Up @@ -1109,7 +1121,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &2071415500
RectTransform:
m_ObjectHideFlags: 0
Expand All @@ -1120,6 +1132,7 @@ RectTransform:
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1701965165}
m_Father: {fileID: 613571621}
Expand Down
4 changes: 2 additions & 2 deletions Assets/ExampleApp/Scripts/ConsentMessageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public class ConsentMessageProvider : MonoBehaviour
[SerializeField]
int accountId = 22;
[SerializeField]
string propertyName = "sid-multi-campaign.com";
string propertyName = "mobile.multicampaign.demo";
[SerializeField]
private CAMPAIGN_ENV campaignEnvironment = CAMPAIGN_ENV.PUBLIC;
[SerializeField]
long messageTimeoutInSeconds = 3;
long messageTimeoutInSeconds = 30;
[SerializeField]
string authID = null;

Expand Down
8 changes: 8 additions & 0 deletions Assets/UI/Animations.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/UI/Animations/CMP Button.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/UI/Animations/CMP Cell.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/UI/DataLayer.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/UI/DataLayer/Model.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/UI/DataLayer/Model/GetMessagesRequestBody.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/UI/DataLayer/Model/GetMessagesResponse.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/UI/DataLayer/Model/GetMessagesResponse/LocalState.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/UI/DataLayer/Model/UiElement.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/UI/DataLayer/Model/VendorsAndCategories.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/UI/DataLayer/Model/VendorsAndCategories/Category.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 07b4277

Please sign in to comment.