Skip to content

Commit

Permalink
Merge pull request #10 from SourcePointUSA/develop
Browse files Browse the repository at this point in the history
Release 2.0.0
  • Loading branch information
Nevazhnovu authored Aug 18, 2023
2 parents ac8b8ec + 316c924 commit c4c3eed
Show file tree
Hide file tree
Showing 72 changed files with 1,460 additions and 172 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ Thumbs.db.meta
*.DS_Store

# VS Code
*.vscode
*.vscode

*.keystore
8 changes: 8 additions & 0 deletions Assets/ConsentManagementProvider/Plugins/Android.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/ConsentManagementProvider/Plugins/Android/cmp.meta

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

4 changes: 2 additions & 2 deletions Assets/ConsentManagementProvider/Plugins/iOS/Source/Unity.mm
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ void _addTargetingParamForCampaignType(int campaignType, char * key, char * valu
[unityBridgePlugin addTargetingParamForCampaignType:campaignType :key :value];
}

void _consrtuctLib(int accountId, char* propName, int arrSize, int campaignTypes[], int campaignsEnvironment, long timeOutSeconds)
void _consrtuctLib(int accountId, int propId, char* propName, int arrSize, int campaignTypes[], int campaignsEnvironment, long timeOutSeconds)
{
[unityBridgePlugin consrtuctLib:accountId _:propName _:arrSize _:campaignTypes _: campaignsEnvironment _: timeOutSeconds];
[unityBridgePlugin consrtuctLib:accountId _:propId _:propName _:arrSize _:campaignTypes _: campaignsEnvironment _: timeOutSeconds];
}

void _loadMessage(char * authId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

-(void) setUnityCallback :(const char *)gameObjectName;

-(void) consrtuctLib : (int) accountId _:(char*) propName _: (int) arrSize _: (int[]) campaignTypes _: (int) campaignsEnvironment _: (long) timeOutSeconds;
-(void) consrtuctLib : (int) accountId _:(int) propId _:(char*) propName _: (int) arrSize _: (int[]) campaignTypes _: (int) campaignsEnvironment _: (long) timeOutSeconds;

-(void) loadMessage : (char*) authId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ - (void) addTargetingParamForCampaignType : (int) campaignType : (char*) key : (
// NSLog(@"params => %@", params);
}

-(void) consrtuctLib : (int) accountId _:(char*) propName _: (int) arrSize _: (int[]) campaignTypes _: (int) campaignsEnvironment _: (long) timeOutSeconds
-(void) consrtuctLib : (int) accountId _:(int) propId _:(char*) propName _: (int) arrSize _: (int[]) campaignTypes _: (int) campaignsEnvironment _: (long) timeOutSeconds
{
SPError * err = [self checkIfPropNameNotNull: propName];
if(err != nil)
Expand All @@ -129,6 +129,8 @@ -(void) consrtuctLib : (int) accountId _:(char*) propName _: (int) arrSize _: (i
NSMutableDictionary<NSString *, NSString *> * gdprParams;
NSMutableDictionary<NSString *, NSString *> * ccpaParams;
NSMutableDictionary<NSString *, NSString *> * ios14Params;



for (int index=0; index < arrSize; index++)
{
Expand All @@ -149,7 +151,9 @@ -(void) consrtuctLib : (int) accountId _:(char*) propName _: (int) arrSize _: (i
// initWithEnvironment:env
// targetingParams:gdprParams];
gdpr = [[SPCampaign alloc]
initWithTargetingParams:gdprParams];
initWithTargetingParams:gdprParams
groupPmId:nil
gppConfig:nil];

}else if(type == SPCampaignTypeCcpa){
ccpaParams = campaignParams;
Expand All @@ -160,7 +164,10 @@ -(void) consrtuctLib : (int) accountId _:(char*) propName _: (int) arrSize _: (i
// initWithEnvironment:env
// targetingParams: ccpaParams];
ccpa = [[SPCampaign alloc]
initWithTargetingParams: ccpaParams];
initWithTargetingParams: ccpaParams
groupPmId:nil
gppConfig:nil];

}else if(type == SPCampaignTypeIos14){
ios14Params = campaignParams;
if([ios14Params count] == 0){
Expand All @@ -170,7 +177,10 @@ -(void) consrtuctLib : (int) accountId _:(char*) propName _: (int) arrSize _: (i
// initWithEnvironment:env
// targetingParams: ios14Params];
ios14 = [[SPCampaign alloc]
initWithTargetingParams: ios14Params];
initWithTargetingParams: ios14Params
groupPmId:nil
gppConfig:nil];

}else{
SPError *myErr = [SPError errorWithDomain:@"SPConsentManager"
code:100
Expand All @@ -182,19 +192,22 @@ -(void) consrtuctLib : (int) accountId _:(char*) propName _: (int) arrSize _: (i
}
// NSLog(@"%@ ||| %@ ||| %@", gdpr.description, ccpa.description, ios14.description);

SPCampaignEnv * env = campaignsEnvironment;

SPCampaigns * campaigns = [[SPCampaigns alloc]
initWithGdpr: gdpr
ccpa: ccpa
ios14: ios14];
ios14: ios14
environment:env];

SPCampaignEnv * env = campaignsEnvironment;
NSLog(@" ENVIRONMENT: %ld", (long)env);

consentManager = [[SPConsentManager alloc]
initWithAccountId:accountId
propertyId:propId
propertyName: propertyName
campaignsEnv: env
campaigns: campaigns
language: nil
delegate: self];
consentManager.messageTimeoutInSeconds = timeOutSeconds;
} @catch (SPError *exception) {
Expand All @@ -209,10 +222,10 @@ -(void) loadMessage : (char*) authId
{
NSString * nsAuthId = [self convertCharToNSString: authId];
if ([nsAuthId isEqual: @""] || authId == nil) {
[consentManager loadMessageForAuthId: NULL];
[consentManager loadMessageForAuthId: NULL publisherData: NULL];
// NSLog(@"loadMessage");
}else{
[consentManager loadMessageForAuthId: nsAuthId];
[consentManager loadMessageForAuthId: nsAuthId publisherData: NULL];
// NSLog(@"loadMessage with authId");
}
}
Expand All @@ -222,7 +235,7 @@ - (void) loadGDPRPrivacyManager : (char *) pmId _: (int) tabId{
if([self checkIfConsentManagerNotNull]){
NSString * nsPmId = [self convertCharToNSString:pmId];
SPPrivacyManagerTab tab = tabId;
[consentManager loadGDPRPrivacyManagerWithId:nsPmId tab:tab];
[consentManager loadGDPRPrivacyManagerWithId:nsPmId tab:tab useGroupPmIfAvailable:NULL];
}
}

Expand All @@ -231,7 +244,7 @@ - (void) loadCCPAPrivacyManager : (char *) pmId _: (int) tabId{
NSString * nsPmId = [self convertCharToNSString:pmId];
SPPrivacyManagerTab tab = tabId;
// NSLog(@"pmId %s", pmId);
[consentManager loadCCPAPrivacyManagerWithId:nsPmId tab:tab];
[consentManager loadCCPAPrivacyManagerWithId:nsPmId tab:tab useGroupPmIfAvailable:NULL];
}
}

Expand Down
7 changes: 5 additions & 2 deletions Assets/ConsentManagementProvider/Scripts/facade/CMP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ public static class CMP
|| Application.platform == RuntimePlatform.WindowsEditor
|| Application.platform == RuntimePlatform.OSXEditor;


public static void Initialize(
List<SpCampaign> spCampaigns,
int accountId, string propertyName,
int accountId,
int propertyId,
string propertyName,
MESSAGE_LANGUAGE language,
CAMPAIGN_ENV campaignsEnvironment,
long messageTimeoutInSeconds = 3)
Expand All @@ -39,6 +40,7 @@ public static void Initialize(
}
ConsentWrapperAndroid.Instance.InitializeLib(spCampaigns: spCampaigns,
accountId: accountId,
propertyId: propertyId,
propertyName: propertyName,
language: language,
campaignsEnvironment: campaignsEnvironment,
Expand All @@ -50,6 +52,7 @@ public static void Initialize(
CreateBroadcastExecutorGO();
ConsentWrapperIOS.Instance.InitializeLib(spCampaigns: spCampaigns,
accountId: accountId,
propertyId: propertyId,
propertyName: propertyName,
language: language,
campaignsEnvironment: campaignsEnvironment,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
using ConsentManagementProviderLib.EventHandlerInterface;
using UnityEngine.EventSystems;

namespace ConsentManagementProviderLib
{
public interface IOnConsentSpFinished : IConsentEventHandler
{
void OnConsentSpFinished(SpConsents spConsent);
}
}

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

Loading

0 comments on commit c4c3eed

Please sign in to comment.